diff options
| author | caojoshua <33404808+caojoshua@users.noreply.github.com> | 2021-05-09 02:05:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-09 11:05:12 +0200 |
| commit | e2907fc0f225a7bf33ace6915bc6b55ed1e10b31 (patch) | |
| tree | 58a373535adf3d13947965e6a0b2f16f06737d52 /lua/telescope/actions/set.lua | |
| parent | 25a7ecc289dffaa3d45870b452fa1bfb83253ba9 (diff) | |
feat: jumplist picker and jump to row/col on existing buffers. (#813)
Diffstat (limited to 'lua/telescope/actions/set.lua')
| -rw-r--r-- | lua/telescope/actions/set.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index 49dd74a..5b39c54 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -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 |
