Skip to content

Commit

Permalink
fix: Don't error if we can't set cursor. Just try our best
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdevries committed Sep 17, 2020
1 parent a9d9b3d commit cab5fc7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/telescope/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

local a = vim.api

local log = require('telescope.log')
local state = require('telescope.state')

local actions = setmetatable({}, {
Expand Down Expand Up @@ -98,7 +99,10 @@ local function goto_file_selection(prompt_bufnr, command)
local bufnr = vim.api.nvim_get_current_buf()
a.nvim_buf_set_option(bufnr, 'buflisted', true)
if row and col then
a.nvim_win_set_cursor(0, {row, col})
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)
end
end
end
end
Expand Down

0 comments on commit cab5fc7

Please sign in to comment.