Skip to content

Commit 8e265d2

Browse files
authored
Merge pull request #1651 from Danthewaann/master
fix: empty buffer error on open buffer action
2 parents 0bc0a58 + b6ae9c7 commit 8e265d2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lua/neogit/buffers/status/actions.lua

+7-5
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ local function translate_cursor_location(self, item)
7272
end
7373

7474
local function open(type, path, cursor)
75-
local command = ("silent! %s %s | %s | redraw! | norm! zz"):format(
76-
type,
77-
fn.fnameescape(path),
78-
cursor and cursor[1] or "1"
79-
)
75+
local command = ("silent! %s %s | %s"):format(type, fn.fnameescape(path), cursor and cursor[1] or "1")
76+
77+
logger.debug("[Status - Open] '" .. command .. "'")
78+
79+
vim.cmd(command)
80+
81+
command = "redraw! | norm! zz"
8082

8183
logger.debug("[Status - Open] '" .. command .. "'")
8284

0 commit comments

Comments
 (0)