update readme for on_attach

fix-keymap-buffer
ray-x 2 years ago
parent f24a337f5d
commit 6c0e286170

@ -196,7 +196,7 @@ code_action.range_code_action = function(startpos, endpos)
end, 1000) end, 1000)
end end
code_action.code_action_prompt = function() code_action.code_action_prompt = function(bufnr)
if special_buffers[vim.bo.filetype] then if special_buffers[vim.bo.filetype] then
log('skip buffer', vim.bo.filetype) log('skip buffer', vim.bo.filetype)
return return

@ -71,10 +71,10 @@ M.on_attach = function(client, bufnr)
if client.server_capabilities.codeActionProvider and client.name ~= 'null-ls' then if client.server_capabilities.codeActionProvider and client.name ~= 'null-ls' then
log('code action enabled for client', client.server_capabilities.codeActionProvider) log('code action enabled for client', client.server_capabilities.codeActionProvider)
api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
group = api.nvim_create_augroup('NGCodeActGroup', {}), group = api.nvim_create_augroup('NGCodeActGroup_'..tostring(bufnr), {}),
buffer = bufnr, buffer = bufnr,
callback = function() callback = function()
require('navigator.codeAction').code_action_prompt() require('navigator.codeAction').code_action_prompt(bufnr)
end, end,
}) })
end end

Loading…
Cancel
Save