Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not change the jumplist when using to a line in a file #2910

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

mdedonno1337
Copy link
Contributor

@mdedonno1337 mdedonno1337 commented Feb 4, 2024

Description

While using some Telescope commands that jump directly to a line in a file (like tags), the function first opens the file, then call norm! gg and search for the target line.
This will include the top of the file in the jumplist.

Since the top of the file is not jumped-to by user, it's not a position that the user cares about; it would make sense to not include this position in the jumplist.

Reproduce the bug

To see this behaviour, open a file, call the Telescope tags command, select and confirm any tag that is in the middle of a big file (i.e. when the target tag is jumped-to, the top of the file (line 1) should ideally not be visible), then press Ctrl-O to go back in the first file you edited just before the Telescope tags invocation.
This will not set you back in the first file, but at the top of the file containing the target tag.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I've used this patch for a while in my normal workflow, to ensure no obvious problems arise.

Configuration

NVIM v0.9.5
AppImage

Debian 12

Copy link
Contributor

@jamestrew jamestrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you thank you

@jamestrew jamestrew merged commit 2360838 into nvim-telescope:master Feb 4, 2024
6 checks passed
Conni2461 pushed a commit that referenced this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants