Open tankorsmash opened 8 years ago
+1
I frequently record a one-line macro and apply it to other lines by selecting them and using
:'<,'>norm! @q
As of now, I have to be conscious not to use any of the navigation keys in my macro.
I agree this would be a nice feature, however I'm not aware of any way to detect that Vim is inside a macro and to disable hardtime.
I wasn't able to find anything either. When recording a macro, a message saying recording @{register}
is put at the bottom of the screen. If there were some way to check the value of that, it might be possible, though that solution seems super hacky.
It's not really that big of a problem. If I realize that HardTime interfered with my macro, I just undo and then :HardTimeToggle
before applying the macro.
I agree this would be a nice feature, however I'm not aware of any way to detect that Vim is inside a macro and to disable hardtime.
Now vim has a function called reg_executing()
which returns the name of the register being replayed if there is any.
We can check this in TryKey
like:
fun! TryKey(key)
- if pumvisible()
+ if pumvisible() || reg_executing() !=# ""
return 1
endif
let now = GetNow()
......
endf
If you have a macro that does an action and run it again, if the action is
j
or something else, it doesn't work. To reproduce:qqjq
to record a macro of going down a line,@q@@
to run the macro, then again. The second time you run the macro, nothing happens because HardTime is blocking you. I don't know if you can detect a macro being run though.