[vim/vim] Add an option for using jump list like tag stack (#7738)

169 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Jan 23, 2021, 3:50:51 PM1/23/21
to vim/vim, Subscribed

Port the "jumpoptions" support from NeoVim:
neovim/neovim@39094b3
neovim/neovim#11530
https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/7738

Commit Summary

  • Add an option for using jumplist like tag stack

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Yegappan Lakshmanan

unread,
Jan 23, 2021, 4:00:39 PM1/23/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • e1b599c Add values for option test


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

codecov[bot]

unread,
Jan 23, 2021, 4:07:27 PM1/23/21
to vim/vim, Subscribed

Codecov Report

Merging #7738 (e1b599c) into master (40be52b) will decrease coverage by 2.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@

##           master    #7738      +/-   ##

==========================================

- Coverage   89.01%   86.98%   -2.03%     

==========================================

  Files         148      147       -1     

  Lines      164431   160663    -3768     

==========================================

- Hits       146363   139759    -6604     

- Misses      18068    20904    +2836     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui 86.95% <100.00%> (-0.01%) ⬇️
huge-gcc-unittests 2.48% <7.14%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/mark.c 93.18% <100.00%> (+0.01%) ⬆️
src/optionstr.c 93.76% <100.00%> (-1.02%) ⬇️
src/libvterm/src/rect.h 0.00% <0.00%> (-96.56%) ⬇️
src/libvterm/src/mouse.c 0.00% <0.00%> (-48.34%) ⬇️
src/libvterm/src/state.c 49.06% <0.00%> (-40.93%) ⬇️
src/mouse.c 48.60% <0.00%> (-39.51%) ⬇️
src/libvterm/include/vterm.h 0.00% <0.00%> (-37.50%) ⬇️
src/libvterm/src/pen.c 49.85% <0.00%> (-34.81%) ⬇️
src/libvterm/src/keyboard.c 54.73% <0.00%> (-33.69%) ⬇️
src/libvterm/src/encoding.c 45.54% <0.00%> (-27.73%) ⬇️
... and 129 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40be52b...e1b599c. Read the comment docs.

Yegappan Lakshmanan

unread,
Jan 24, 2021, 2:02:01 PM1/24/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 462ddae Add an option for using jumplist like tag stack


You are receiving this because you are subscribed to this thread.

Yegappan Lakshmanan

unread,
Jan 24, 2021, 4:08:50 PM1/24/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 657fc71 Add an option for using jumplist like tag stack


You are receiving this because you are subscribed to this thread.

Bram Moolenaar

unread,
Jan 24, 2021, 4:10:36 PM1/24/21
to vim/vim, Subscribed

So with this option set you can move through a tree. When going back up a branch and then down another branch, CTRL-O still takes you further up the tree. A note in the help would help users understand this.

The disadvantage is that branches that were visited before are gone. I wonder if we could somehow remember them. The big question is what command would navigate through this? With CTRL-I you would have to pick the branch to go into. And you need to know where you are. Since jumps are not that predictable that would be too complex.

Perhaps we can use something similar to undo: add a timestamp to each position, so that you can go back and forward in time. That would combine the behavior with the option on and off, using different commands instead of setting an option. We would need to remember two jumplists.

Yegappan Lakshmanan

unread,
Jan 25, 2021, 11:08:21 AM1/25/21
to vim/vim, Push

@yegappan pushed 1 commit.


You are receiving this because you are subscribed to this thread.

Yegappan Lakshmanan

unread,
Jan 25, 2021, 11:11:32 AM1/25/21
to vim_dev, reply+ACY5DGFG5XFNA4DXHB...@reply.github.com, vim/vim, Subscribed
Hi Bram,

On Sun, Jan 24, 2021 at 1:10 PM Bram Moolenaar <vim-dev...@256bit.org> wrote:

So with this option set you can move through a tree. When going back up a branch and then down another branch, CTRL-O still takes you further up the tree. A note in the help would help users understand this.

I have updated the help text to include the above note.

The disadvantage is that branches that were visited before are gone. I wonder if we could somehow remember them. The big question is what command would navigate through this? With CTRL-I you would have to pick the branch to go into. And you need to know where you are. Since jumps are not that predictable that would be too complex.

Perhaps we can use something similar to undo: add a timestamp to each position, so that you can go back and forward in time. That would combine the behavior with the option on and off, using different commands instead of setting an option. We would need to remember two jumplists.

It makes sense to have multiple branches in the jump list and allow a user to
browse through different branches. But why do we need to associate a
timestamp with each jump location? Unlike the undo tree, why would a user
need to go back in the jump list based on time?

Regards,
Yegappan

vim-dev ML

unread,
Jan 25, 2021, 11:11:56 AM1/25/21
to vim/vim, vim-dev ML, Your activity

Bram Moolenaar

unread,
Jan 25, 2021, 1:32:08 PM1/25/21
to vim...@googlegroups.com, vim-dev ML

Yegappan wrote:

> > The disadvantage is that branches that were visited before are gone. I
> > wonder if we could somehow remember them. The big question is what command
> > would navigate through this? With CTRL-I you would have to pick the branch
> > to go into. And you need to know where you are. Since jumps are not that
> > predictable that would be too complex.
> >
> > Perhaps we can use something similar to undo: add a timestamp to each
> > position, so that you can go back and forward in time. That would combine
> > the behavior with the option on and off, using different commands instead
> > of setting an option. We would need to remember two jumplists.
> >
> It makes sense to have multiple branches in the jump list and allow a user
> to
> browse through different branches. But why do we need to associate a
> timestamp with each jump location? Unlike the undo tree, why would a user
> need to go back in the jump list based on time?

Suppose you have a tree like this:

A -- A1 -- A11
-- A2 -- A22

So the user first jumps from A to A1, then to A11.
Then moves back up to A1 and A2, then jumps to A2 and A22.

Now suppose you want to go back to A11, which you visited before.
How do you get there? Currently you just hit CTRL-O until you get
there, it should be somewhere up in the jump list, but it's a bit
unpredictable when you hit that entry in the jumplist. And any jump you
do means you have to start all over going back.

When the proposed option, you can't, the location is lost.

Now, if we mark the positions with time (or just a sequence number), you
could so "go back N positions in time". I think this requires
remembering when the position was first encountered, otherwise when
going back it would become the latest one.

It could use the jumplist as it is today, but mark the older entries
with a flag, as if they are "outdated". And instead of adding a new
option, add commands that skip the "outdated" positions. Then you get
both the old and new behavior without setting an option. That's much
better, since you often don't know before hand what navigation you're
going to do.

--
hundred-and-one symptoms of being an internet addict:
238. You think faxes are old-fashioned.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Yegappan Lakshmanan

unread,
Feb 13, 2021, 12:16:09 PM2/13/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 2 commits.

  • dd9b8e4 Add an option for using jumplist like tag stack
  • e6e2d0e Update the help text


You are receiving this because you are subscribed to this thread.

Yegappan Lakshmanan

unread,
Apr 19, 2021, 10:12:53 PM4/19/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 2 commits.

  • 9350835 Add an option for using jumplist like tag stack
  • ae4e837 Update the help text


You are receiving this because you are subscribed to this thread.

Yegappan Lakshmanan

unread,
May 1, 2021, 3:05:27 PM5/1/21
to vim/vim, vim-dev ML, Push

@yegappan pushed 2 commits.

  • cb8c5f4 Add an option for using jumplist like tag stack
  • c4a2b68 Update the help text


You are receiving this because you are subscribed to this thread.

Yegappan Lakshmanan

unread,
May 1, 2021, 3:06:36 PM5/1/21
to vim/vim, vim-dev ML, Comment

Closed #7738.


You are receiving this because you commented.

Quentin Minster

unread,
Oct 29, 2021, 11:30:23 AM10/29/21
to vim/vim, vim-dev ML, Comment

Hey @yegappan, can I ask why you closed this PR? I'd very much love to see this feature implemented in vim.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Yegappan Lakshmanan

unread,
Oct 29, 2021, 11:58:19 AM10/29/21
to vim_dev, reply+ACY5DGFDW2IPBGDUSX...@reply.github.com, vim/vim, vim-dev ML, Comment
Hi,

On Fri, Oct 29, 2021 at 8:30 AM Quentin Minster <vim-dev...@256bit.org> wrote:

Hey @yegappan, can I ask why you closed this PR? I'd very much love to see this feature implemented in vim.


As you can see from the discussion attached to the PR, Bram commented:

>
> Perhaps we can use something similar to undo: add a timestamp to each
> position, so that you can go back and forward in time. That would
> combine the behavior with the option on and off,  using different
> commands instead of setting an option. We would need to remember two
> jumplists.
>

Bram wanted an undo like tree for the jump list. This is a lot more work to implement.
So I closed this PR.

Regards,
Yegappan

vim-dev ML

unread,
Oct 29, 2021, 11:58:38 AM10/29/21
to vim/vim, vim-dev ML, Your activity

Hi,

On Fri, Oct 29, 2021 at 8:30 AM Quentin Minster ***@***.***>
wrote:

> Hey @yegappan <https://github.com/yegappan>, can I ask why you closed

> this PR? I'd very much love to see this feature implemented in vim.
>
>
> As you can see from the discussion attached to the PR, Bram commented:

>
> Perhaps we can use something similar to undo: add a timestamp to each
> position, so that you can go back and forward in time. That would
> combine the behavior with the option on and off, using different
> commands instead of setting an option. We would need to remember two
> jumplists.
>

Bram wanted an undo like tree for the jump list. This is a lot more work to
implement.
So I closed this PR.

Regards,
Yegappan


You are receiving this because you are subscribed to this thread.

Bram Moolenaar

unread,
Oct 29, 2021, 6:41:01 PM10/29/21
to vim/vim, vim-dev ML, Comment

About the timestamp: I know the experience when you know you looked at some line of code just before, but don't know how to jump back there. If we have a jump list organised by time, you could jump to each position you have seen before, in the order they were last visited. Like the :earlier and :later undo commands. You don't have to remember what path in the tree you followed and how to backtrack, you just navigate through time.


You are receiving this because you commented.

Epheien

unread,
May 29, 2022, 1:54:21 AM5/29/22
to vim/vim, vim-dev ML, Comment

So with this option set you can move through a tree. When going back up a branch and then down another branch, CTRL-O still takes you further up the tree. A note in the help would help users understand this.

The disadvantage is that branches that were visited before are gone. I wonder if we could somehow remember them. The big question is what command would navigate through this? With CTRL-I you would have to pick the branch to go into. And you need to know where you are. Since jumps are not that predictable that would be too complex.

Perhaps we can use something similar to undo: add a timestamp to each position, so that you can go back and forward in time. That would combine the behavior with the option on and off, using different commands instead of setting an option. We would need to remember two jumplists.

In actual use, some jumplists are not needed, similar to forward and backward in browsers.
Really disappointed that this PR was closed.


Reply to this email directly, view it on GitHub.
You are receiving this because you commented.Message ID: <vim/vim/pull/7738/c1140382949@github.com>

Wallace Gibbon

unread,
Jul 25, 2023, 4:49:03 AM7/25/23
to vim/vim, vim-dev ML, Comment

It's really disappointed that this PR had closed. I've switch to NeoVim just for "set jumpoptions=stack". It's so important for code navigation when you use Vim as an IDE.


Reply to this email directly, view it on GitHub.
You are receiving this because you commented.Message ID: <vim/vim/pull/7738/c1649399774@github.com>

Shane-XB-Qian

unread,
Sep 21, 2023, 8:38:30 AM9/21/23
to vim/vim, vim-dev ML, Comment

It's really disappointed that this PR had closed. I've switch to NeoVim just for "set jumpoptions=stack". It's so important for code navigation when you use Vim as an IDE.

@wallacegibbon could you try was this really matching your demand?
// was that really same experience like neovim or so-called IDE?


Reply to this email directly, view it on GitHub.
You are receiving this because you commented.Message ID: <vim/vim/pull/7738/c1729484472@github.com>

Reply all
Reply to author
Forward
0 new messages