patch 8.1.0020: cannot tell whether a register is executing or recording
Problem: Cannot tell whether a register is being used for executing or
recording.
Solution: Add reg_executing() and reg_recording(). (Hirohito Higashi,
closes #2745) Rename the global variables for consistency. Store
the register name in reg_executing.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index de4bb02..905074c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2302,6 +2302,8 @@
List items from {expr} to {max}
readfile({fname} [, {binary} [, {max}]])
List get list of lines from file {fname}
+reg_executing() Number get the executing register name
+reg_recording() String get the recording register name
reltime([{start} [, {end}]]) List get time value
reltimefloat({time}) Float turn the time value into a Float
reltimestr({time}) String turn time value into a String
@@ -6558,6 +6560,15 @@
the result is an empty list.
Also see |writefile()|.
+reg_executing() *reg_executing()*
+ Returns the single letter name of the register being executed.
+ Returns an empty string when no register is being executed.
+ See |@|.
+
+reg_recording() *reg_recording()*
+ Returns the single letter name of the register being recorded.
+ Returns an empty string string when not recording. See |q|.
+
reltime([{start} [, {end}]]) *reltime()*
Return an item that represents a time value. The format of
the item depends on the system. It can be passed to
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 279dd20..f891f44 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1018,6 +1018,8 @@
getreg() get contents of a register
getregtype() get type of a register
setreg() set contents and type of a register
+ reg_executing() return the name of the register being executed
+ reg_recording() return the name of the register being recorded
shiftwidth() effective value of 'shiftwidth'