-
-
Notifications
You must be signed in to change notification settings - Fork 629
chore(mappings): migrate legacy mappings under the hood #1476
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
64b1387
to
11d97de
Compare
11d97de
to
9da4462
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE2: this should not be merged before the help menu is rewritten
We could be lazy: retain the view.mappings.list for help to look up, if we want to merge this before.
NOTE3: this can be used to print the on_attach migration to the user.
Yes. vim.keymap.set
is ready to print.
@@ -666,8 +666,9 @@ function M.setup(conf) | |||
validate_options(conf) | |||
|
|||
local opts = merge_options(conf) | |||
local netrw_disabled = opts.disable_netrw or opts.hijack_netrw | |||
legacy.move_mappings_to_keymap(opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach: moving the mappings after merge means we only have to do this once.
@@ -297,6 +298,99 @@ local function removed(opts) | |||
end | |||
end | |||
|
|||
local OLD_MAPPING_TABLE = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could be lazy and move this to DEFAULT_KEYMAPS
with a legacy_action
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, also i've noticed from some PRs on nvim-treesitter that vim.keymap.set takes an optional "desc" argument which we should use so the nvim-tree will work in which-key and allow us to use that in the help menu
See #1579 |
NOTE: this should not be merged before we tested it thoroughly.
NOTE2: this should not be merged before the help menu is rewritten
NOTE3: this can be used to print the on_attach migration to the user.