Skip to content

Commit 88ca8b2

Browse files
committed
Buffer: When moving cursor, place it at beginning of line.
1 parent 0e73dd0 commit 88ca8b2

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lua/neogit/lib/buffer.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,7 @@ function Buffer:set_text(first_line, last_line, first_col, last_col, lines)
148148
end
149149

150150
function Buffer:move_cursor(line)
151-
if line < 0 then
152-
self:focus()
153-
vim.cmd("norm! G")
154-
else
155-
self:focus()
156-
vim.cmd("norm! " .. line .. "G")
157-
end
151+
api.nvim_win_set_cursor(0, { line, 0 })
158152
end
159153

160154
function Buffer:close(force)

0 commit comments

Comments
 (0)