feat: jumplist picker and jump to row/col on existing buffers. (#813)

This commit is contained in:
caojoshua
2021-05-09 02:05:12 -07:00
committed by GitHub
parent 25a7ecc289
commit e2907fc0f2
5 changed files with 94 additions and 15 deletions

View File

@@ -113,19 +113,18 @@ action_set.edit = function(prompt_bufnr, command)
if entry_bufnr then
edit_buffer(command, entry_bufnr)
else
-- check if we didn't pick a different buffer
-- prevents restarting lsp server
if vim.api.nvim_buf_get_name(0) ~= filename or command ~= "edit" then
filename = path.normalize(vim.fn.fnameescape(filename), vim.loop.cwd())
vim.cmd(string.format("%s %s", command, filename))
end
end
if row and col then
local ok, err_msg = pcall(a.nvim_win_set_cursor, 0, {row, col})
if not ok then
log.debug("Failed to move to cursor:", err_msg, row, col)
end
if row and col then
local ok, err_msg = pcall(a.nvim_win_set_cursor, 0, {row, col})
if not ok then
log.debug("Failed to move to cursor:", err_msg, row, col)
end
end
end