fix(picker): wrap vim.fn.expand cword in pcall to avoid Vim:E348 (#2961)
* fix(picker): wrap vim.fn.expand cword in pcall to avoid Vim:E348: No string under cursor * run stylua --------- Co-authored-by: James Trew <j.trew10@gmail.com>
This commit is contained in:
@@ -529,7 +529,7 @@ function Picker:find()
|
|||||||
self:reset_selection()
|
self:reset_selection()
|
||||||
|
|
||||||
self.original_win_id = a.nvim_get_current_win()
|
self.original_win_id = a.nvim_get_current_win()
|
||||||
self.original_cword = vim.fn.expand "<cword>"
|
_, self.original_cword = pcall(vim.fn.expand, "<cword>")
|
||||||
|
|
||||||
-- User autocmd run it before create Telescope window
|
-- User autocmd run it before create Telescope window
|
||||||
vim.api.nvim_exec_autocmds("User", { pattern = "TelescopeFindPre" })
|
vim.api.nvim_exec_autocmds("User", { pattern = "TelescopeFindPre" })
|
||||||
|
|||||||
Reference in New Issue
Block a user