-
-
Notifications
You must be signed in to change notification settings - Fork 59
using vim.keymap.set, breaking changes #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
https://github.com/ray-x/navigator.lua/blob/master/lua/navigator/lspclient/mapping.lua#L213
And the most strange part. require'navigator'.setup({
debug = false,
lsp = {
code_action = {
virtual_text = false
},
diagnostic = {
update_in_insert = false
},
format_on_save = false,
disable_lsp = { "rust_analyzer" }
},
lsp_installer = true,
lsp_signature_help = false,
signature_help_cfg = nil,
keymaps = {
-- THIS LINE AND ONLY THIS COMMAND MAKES ICONS NON WORKING. Other commands I add works fine. Removing this line makes everything working fine too
{ key = '<leader>ld', func = require('navigator.diagnostics').show_buf_diagnostics, doc = 'show_buf_diagnostics' },
},
icons = {
diagnostic_virtual_text = ''
}
}) So Do know what can be a cause? |
Yep, now diagnostics icon is working, thanks! |
Moving to new neovim API for key binding
The new way to bind a key is
{ key = 'gr', func = require('navigator.reference').async_ref, doc = 'async_ref' },
doc field is optional
Also as vim.keymap.set() only supported 0.7.x and greater so 0.6.x might no longer works.
Benefits:
But you may need to update the config if you override default keymappings. The string search will not work
e.g. in old config
{ key = 'gD', func = 'definition()'},
definition()
is used to replace the internal old mapping{ key = 'gd', func = 'definition()'},
and key
gd
will be removed from default config.The new config
{ key = 'gD', func = vim.lsp.buf.definition},
new default:
{ key = 'gd', func = vim.lsp.buf.definition, doc='definition'},
It will search if function reference
vim.lsp.buf.definition
matches.