diff options
Diffstat (limited to '.vim/lua/lsp.lua')
| -rw-r--r-- | .vim/lua/lsp.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/.vim/lua/lsp.lua b/.vim/lua/lsp.lua index 91e2e2e..47eef75 100644 --- a/.vim/lua/lsp.lua +++ b/.vim/lua/lsp.lua @@ -106,18 +106,23 @@ local setup = function() if #actions == 1 then action_chosen = actions[1] else - local option_strings = {'Code Actions:'} + local option_strings = {} for i, action in ipairs(actions) do local title = action.title:gsub('\r\n', '\\r\\n') title = title:gsub('\n', '\\n') table.insert(option_strings, string.format('%d. %s', i, title)) end - local choice = vim.fn.inputlist(option_strings) - if choice < 1 or choice > #actions then - return - end - action_chosen = actions[choice] + vim.ui.select(option_strings, + { + prompt = 'Code Actions:', + }, + function(choice) + if choice < 1 or choice > #actions then + return + end + action_chosen = actions[choice] + end) end if action_chosen.edit or type(action_chosen.command) == 'table' then |