Skip to content

Commit f36be3c

Browse files
committed
Merge remote-tracking branch 'evnoj/recording-val'
2 parents 237dd3e + 84626df commit f36be3c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

doc/pages/expansions.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ The following expansions are supported (with required context _in italics_):
339339
an inner selection, `to_begin` if the user wants to select to the
340340
beginning, and `to_end` if the user wants to select to the end
341341

342+
*%val{recording_register}*::
343+
the register being recorded to if currently recording a macro, empty when not recording
344+
342345
*%val{register}*::
343346
_in `map` command <keys> parameter and `<a-;>` from the object menu_ +
344347
current register when the mapping was triggered

src/main.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ const EnvVarDesc builtin_env_vars[] = { {
257257
[](StringView name, const Context& context) -> Vector<String>
258258
{ auto cursor = context.selections().main().cursor();
259259
return {to_string(context.buffer().distance({0,0}, cursor))}; }
260+
}, {
261+
"recording_register", false,
262+
[](StringView name, const Context& context) -> Vector<String>
263+
{ const char reg = context.client().input_handler().recording_reg();
264+
return {reg ? String{static_cast<Codepoint>(reg)} : ""}; }
260265
}, {
261266
"selection_desc", false,
262267
[](StringView name, const Context& context) -> Vector<String>

0 commit comments

Comments
 (0)