diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2024-05-28 14:54:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 14:54:50 -0500 |
commit | efa45832ea02e777ce3f5556ef3cd959c164ec24 (patch) | |
tree | 8f389204e0fcc05b150af4beb69143445fbe7eeb /runtime/lua/vim/shared.lua | |
parent | f09f5c45facc597bb3f70b7821412641bf31a592 (diff) | |
download | rneovim-efa45832ea02e777ce3f5556ef3cd959c164ec24.tar.gz rneovim-efa45832ea02e777ce3f5556ef3cd959c164ec24.tar.bz2 rneovim-efa45832ea02e777ce3f5556ef3cd959c164ec24.zip |
feat: add "jump" options to vim.diagnostic.config() (#29067)
Problem: There is no easy way to configure the behavior of the default
diagnostic "jump" mappings. For example, some users way want to show the
floating window, and some may not (likewise, some way want to only move
between warnings/errors, or disable the "wrap" parameter).
Solution: Add a "jump" table to vim.diagnostic.config() that sets
default values for vim.diagnostic.jump().
Alternatives: Users can override the default mappings to use the exact
options to vim.diagnostic.jump() that they want, but this has a couple
issues:
- While the default mappings are not complicated, they are also not
trivial, so overriding them requires users to understand
implementation details (specifically things like setting "count"
properly).
- If plugins want to change the default mappings, or configure the
behavior in any way (e.g. floating window display), it becomes even
harder for users to tweak specific behavior.
vim.diagnostic.config() already works quite well as the "entry point"
for tuning knobs with diagnostic UI elements, so this fits in nicely and
composes well with existing mental models and idioms.
Diffstat (limited to 'runtime/lua/vim/shared.lua')
-rw-r--r-- | runtime/lua/vim/shared.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index 2641d1feb0..0ec79e1dc7 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -379,7 +379,7 @@ local function tbl_extend(behavior, deep_extend, ...) for i = 1, select('#', ...) do local tbl = select(i, ...) - vim.validate({ ['after the second argument'] = { tbl, 't' } }) + vim.validate('after the second argument', tbl, 'table') --- @cast tbl table<any,any> if tbl then for k, v in pairs(tbl) do |