mirror of
https://github.com/neovim/neovim.git
synced 2026-07-26 02:32:02 +00:00
fix(api): nvim_buf_set_text resets changelist to 0 #39965
Problem: changed_lines got a hardcoded 0, so the changelist entry and '. mark always recorded column 0 instead of where the edit actually happened. Solution: pass start_col instead. changelist now tracks the real column.
This commit is contained in:
@@ -975,6 +975,10 @@ describe('api/buf', function()
|
||||
eq('hello foo!', curbuf_depr('get_line', 0))
|
||||
-- cursor should be moved left by two columns (replacement is shorter by 2 chars)
|
||||
eq({ 1, 9 }, api.nvim_win_get_cursor(0))
|
||||
|
||||
-- changelist entry reflects the edit column #28618
|
||||
local changes = fn.getchangelist()[1]
|
||||
eq(6, changes[#changes].col)
|
||||
end)
|
||||
|
||||
it('updates the cursor position in non-current window', function()
|
||||
|
||||
Reference in New Issue
Block a user