mirror of
https://github.com/neovim/neovim.git
synced 2026-07-18 07:01:19 +00:00
fix(lsp): show_document can't position cursor past EOL in insert-mode #38566
Problem: vim.lsp.util.show_document insert mode is unable to set the cursor after the target character position if the target character is at end of line. Solution: Move cursor after the target character (in append position) in this case.
This commit is contained in:
@@ -3574,6 +3574,13 @@ describe('LSP', function()
|
||||
local pos = show_document(location(0, 9, 0, 9), true, true)
|
||||
eq(1, pos.line)
|
||||
eq(10, pos.col)
|
||||
|
||||
-- expectation: Cursor is placed past EOL (append position) in insert mode
|
||||
n.feed('I')
|
||||
pos = show_document(location(0, 16, 0, 16), true, true)
|
||||
eq(1, pos.line)
|
||||
eq(17, pos.col)
|
||||
eq('i', api.nvim_get_mode().mode)
|
||||
end)
|
||||
|
||||
it('jumps to a Location if focus is true via handler', function()
|
||||
|
||||
Reference in New Issue
Block a user