On Mon, May 25, 2015 at 5:58 PM, Carlo Baldassi <carlobalda...@gmail.com> wrote:
> Ok, here is my attempt at a recursive version of the keepjumps command.
> It's called lockjumps, and works in the same way as keepjumps except that:
> 1) it's recursive
> 2) it only locks the jumplist, it does not affect the marks list
>
> Again, it seems to work as intended, "make test" passes and valgrind too.
>
> The reason for not touching the marks is that:
> 1) I think it is actually fairly common for functions/plugins/etc to use 
> marks in jumping around, e.g. calling "normal ``" to get back after a jump, 
> or having a mapping which does things like "ggdd``". It is much more uncommon 
> to use CTRL-O in a script I think.
> 2) The marks can be set explicitly by the user and are much easier to control 
> from user code (e.g. it is trivial to write a save_marks()/restore_marks() 
> pair if needed).

In my case at least, allowing the marks to be modified defeats the
purpose. And the inconsistency between :keepjumps (keeps '. '^
jumplist and changelist) and :lockjumps (keeps only jumplist...?)
would be unpleasant.

In your implementation, you could save the './'^/jumplist/changelist
and then restore it after the script ends. This would allow plugins to
use marks et. al. as needed but the user can use :keepjumps! to
prevent side effects from the plugin.

Justin M. Keyes

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to