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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: do not change the jumplist when using to a line in a file
  • Loading branch information
mdedonno1337 committed Feb 4, 2024
commit 85d4c7dc5393abd738c25a0ebfc5dcb745b16b48
2 changes: 1 addition & 1 deletion lua/telescope/builtin/__files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ files.tags = function(opts)
return "\\" .. x
end)

vim.cmd "norm! gg"
vim.cmd "keepjumps norm! gg"
vim.fn.search(scode)
vim.cmd "norm! zz"
else
Expand Down
6 changes: 3 additions & 3 deletions lua/telescope/previewers/buffer_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ local search_cb_jump = function(self, bufnr, query)
end
vim.api.nvim_buf_call(bufnr, function()
pcall(vim.fn.matchdelete, self.state.hl_id, self.state.winid)
vim.cmd "norm! gg"
vim.cmd "keepjumps norm! gg"
vim.fn.search(query, "W")
vim.cmd "norm! zz"

Expand Down Expand Up @@ -612,7 +612,7 @@ previewers.ctags = defaulter(function(opts)
end)

pcall(vim.fn.matchdelete, self.state.hl_id, self.state.winid)
vim.cmd "norm! gg"
vim.cmd "keepjumps norm! gg"
vim.fn.search(scode, "W")
vim.cmd "norm! zz"

Expand Down Expand Up @@ -1115,7 +1115,7 @@ previewers.highlights = defaulter(function(_)

vim.schedule(function()
vim.api.nvim_buf_call(self.state.bufnr, function()
vim.cmd "norm! gg"
vim.cmd "keepjumps norm! gg"
vim.fn.search(entry.value .. " ")
local lnum = vim.api.nvim_win_get_cursor(self.state.winid)[1]
-- That one is actually a match but its better to use it like that then matchadd
Expand Down
Loading