On Sunday, June 7, 2015 at 8:57:38 AM UTC-5, Bram Moolenaar wrote: > Carlo Baldassi 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). > > > > All things considered, I prefer this version to the previous one with > > the option. (I just hope it's correct!) > > Makes sense. I didn't like the solution with an option. > > I don't like using ":keepjumps!", adding an exclamation mark to a > command modifier is weird, I don't think this exists yet. We only have > the exclamation mark on commands. > > Any comments from plugin writers? >
Justin mentioned that he needed a solution that also keeps marks. I guess it may be possible to use getpos/setpos to save/restore specific mark positions, but I'm not 100% sure this patch plus that method would meet his needs. -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
