mirror of
https://github.com/neovim/neovim.git
synced 2026-02-15 00:03:29 +00:00
feat(lsp): incremental-selection operator-pending mode #36575
Problem: LSP incremental selection provides default visual-mode keymaps for `an` and `in`. Operator-pending mode is not supported, so `dan` and `can` do not apply the operation. Solution: Modify selection_range() to be synchronous. Add operator-pending mappings.
This commit is contained in:
@@ -227,6 +227,14 @@ do
|
||||
vim.lsp.buf.selection_range(-vim.v.count1)
|
||||
end, { desc = 'vim.lsp.buf.selection_range(-vim.v.count1)' })
|
||||
|
||||
vim.keymap.set('o', 'an', function()
|
||||
vim.lsp.buf.selection_range(vim.v.count1, 1000)
|
||||
end, { desc = 'vim.lsp.buf.selection_range(vim.v.count1, timeout_ms)' })
|
||||
|
||||
vim.keymap.set('o', 'in', function()
|
||||
vim.lsp.buf.selection_range(-vim.v.count1, 1000)
|
||||
end, { desc = 'vim.lsp.buf.selection_range(-vim.v.count1, timeout_ms)' })
|
||||
|
||||
vim.keymap.set('n', 'gO', function()
|
||||
vim.lsp.buf.document_symbol()
|
||||
end, { desc = 'vim.lsp.buf.document_symbol()' })
|
||||
|
||||
Reference in New Issue
Block a user