Hi Tim! On Mo, 23 Sep 2013, Tim Chase wrote:
> Playing around with the latest VimGolf challenge[1], I was attempting > to use "gi" to add some text, then control+O (or backtick-backtick) to > jump back to where I had issued the "gi". I was somewhat surprised to > find that "gi" doesn't modify the jump-list, even though it can > generate some pretty large jumps, losing the previous location in the > process. Not sure, but it sounds like a good idea, to add the current position to the jumplist. So here is a patch, to add this function. regards, Christian -- Vollkommenheit ist schon da, wenn das Notwendige geleistet wird, Schönheit, wenn das Notwendige geleistet, doch verborgen ist. -- Goethe, Maximen und Reflektionen, Nr. 1197 -- -- 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/groups/opt_out.
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1016,10 +1016,10 @@ ============================================================================== 8. Jumps *jump-motions* -A "jump" is one of the following commands: "'", "`", "G", "/", "?", "n", -"N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and -the commands that start editing a new file. If you make the cursor "jump" -with one of these commands, the position of the cursor before the jump is +A "jump" is one of the following commands: "'", "`", "G", "/", "?", "n", "gi", +"N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and the +commands that start editing a new file. If you make the cursor "jump" with +one of these commands, the position of the cursor before the jump is remembered. You can return to that position with the "''" and "``" command, unless the line containing that position was changed or deleted. diff --git a/src/normal.c b/src/normal.c --- a/src/normal.c +++ b/src/normal.c @@ -8292,6 +8292,7 @@ case 'i': if (curbuf->b_last_insert.lnum != 0) { + setpcmark(); curwin->w_cursor = curbuf->b_last_insert; check_cursor_lnum(); i = (int)STRLEN(ml_get_curline());