Skip to content

Commit

Permalink
fix: do not alter jumplist when jumping to a line in a file (#2910)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedonno1337 committed Feb 4, 2024
1 parent 7b5c5f5 commit 2360838
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 2360838

Please sign in to comment.