See #6299
Supports getreg() and setreg() for ',' and ';' - where ',' is the current and ';' the previous command.
The initial idea was taken from the patch by Ben Schmidt. I've updated it and added support for setreg().
Warning: this is my first patch for Vim!
https://github.com/vim/vim/pull/6346
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
@yegappan commented on this pull request.
Can you add some tests for this change? You can take a look at the many test scripts available under the testdir directory for example. You can also look at the code coverage results to add additional tests.
Thanks for getting this started. Although having just the current and previous redo command will be sufficient for most cases, there might be a reason to keep more. Just like we keep nine deletes in registers 1 - 9.
Unfortunately we don't have ten register names for this. Any ideas?
In that case, how about making only the current command available in the register ,?
The history could be accessed via Vim Script, e.g. getrepeat(n).
Unfortunately, there is a problem with visual operations.. e.g., if you do v3ld then . deletes 3 characters but echo @, gives vd.
Would it make sense if @, and @; could work as expected? What about @=@,, @=@;? The former could be just an alias for . and previous . but the latter could not be handled since vd is not the same operation.
Can you add some tests for this change?
I will try once it's clear how the feature should be implemented.
Unfortunately, there is a problem with visual operations.. e.g., if you do
v3ldthen.deletes 3 characters butecho @,givesvd.
I'm not sure what is going on here since I am just using get_buffcont() that was already in Vim. The same function is IMHO used for recording where it works.
I'm not sure what is going on here since I am just using get_buffcont() that was already in Vim. The same function is IMHO used for recording where it works.
vim doesn't record the "redo buffer" like it does regular macros. For example, do qqv3l"adq, you'll get @q = v3l"ad but @, = "avd. Instead, it uses a custom format string which is roughly ["{register}, v for visual, some more operations]. vim has to do some translation- see the function start_redo(). When v is encountered, it re-enters the prior visual mode at the new cursor location.
Maybe introduce autocmd that is called when singe-repeat is used? Then one can save history of commands by saving ; register
Any progress on this PR?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #6346.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I am closing this one, as it seems to have been stalled. If you ever make progress on this feature, please create a new PR.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()