Merge pull request #1422 from NeogitOrg/delay-opening

This commit is contained in:
Cameron 2024-07-17 12:19:27 +02:00 committed by GitHub
commit af1d8d88f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,7 @@ local function translate_cursor_location(self, item)
end
local function open(type, path, cursor)
local command = ("silent! %s %s | %s | norm! zz"):format(
local command = ("silent! %s %s | %s | redraw! | norm! zz"):format(
type,
fn.fnameescape(path),
cursor and cursor[1] or "1"
@ -1098,7 +1098,7 @@ M.n_goto_file = function(self)
if item and item.absolute_path then
local cursor = translate_cursor_location(self, item)
self:close()
open("edit", item.absolute_path, cursor)
vim.schedule_wrap(open)("edit", item.absolute_path, cursor)
return
end