mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
parent
12b0ff02b6
commit
4b4ff5f549
@ -163,7 +163,11 @@ api.nvim_create_autocmd("FileType", {
|
||||
-- vim.print(string.format("mark_pos: %s", vim.inspect(mark_pos)))
|
||||
-- it seems that without vim.schedule, the cursor position can not be set correctly
|
||||
vim.schedule(function()
|
||||
api.nvim_win_set_cursor(0, mark_pos)
|
||||
local status, result = pcall(api.nvim_win_set_cursor, 0, mark_pos)
|
||||
if not status then
|
||||
api.nvim_err_writeln(string.format("Failed to resume cursor position. Context %s, error: %s",
|
||||
vim.inspect(ev), result))
|
||||
end
|
||||
end)
|
||||
end
|
||||
end,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user