From e82aef2e22a57688dcc19a978cbe083349ad8a2a Mon Sep 17 00:00:00 2001 From: Branden Call <54908229+brandencall@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:10:50 -0700 Subject: 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. --- runtime/lua/vim/_defaults.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runtime/lua/vim/_defaults.lua') diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index 1d3648ce4a..ddec0695f7 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -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()' }) -- cgit