fix: Cursor was not being properly placed in middle of a line

This commit is contained in:
danymat
2022-01-09 19:44:43 +01:00
parent 82f56c3da3
commit 1f31319892

View File

@@ -9,7 +9,8 @@ local current_position = 1
--- @return number --- @return number
neogen.utilities.cursor.create = function(line, col) neogen.utilities.cursor.create = function(line, col)
current_position = 1 current_position = 1
return vim.api.nvim_buf_set_extmark(0, neogen_ns, line - 1, col - 1, {}) local new_col = col == 0 and 0 or col -1
return vim.api.nvim_buf_set_extmark(0, neogen_ns, line - 1, new_col, {})
end end
--- Find next created extmark and goes to it. --- Find next created extmark and goes to it.