Problem:
`:lua vim.cmd.win_getid(30,10)` is interpreted as `:win[size] 30 10`.
User intention was to call `vim.fn.win_getid(30,10)`.
Solution:
Check that the `cmd` actually matches the resolved command.
Problem: Resetting local option to global value is inconsistent.
Solution: Handle "<" specifically for 'scrolloff' and 'sidescrolloff'.
(closesvim/vim#12594)
bf5f189e44
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Treesitter fold is not updated if treesitter hightlight is not
active. More precisely, updating folds requires `LanguageTree:parse()`.
Solution: Call `parse()` before computing folds and compute folds when
lines are added/removed.
This doesn't guarantee correctness of the folds, because some changes
that don't add/remove line won't update the folds even if they should
(e.g. adding pair of braces). But it is good enough for most cases,
while not introducing big overhead.
Also, if highlighting is active, it is likely that
`TSHighlighter._on_buf` already ran `parse()` (or vice versa).
Problem: Regression test doesn't fail when fix is reverted.
Solution: Add "n" to 'cpoptions' instead of using :winsize. (closesvim/vim#12587,
issue vim/vim#12528)
e429893741
Problem: Divide by zero when scrolling with 'smoothscroll' set.
Solution: Avoid using a negative width. (closesvim/vim#12540, closesvim/vim#12528)
8154e642aa
Co-authored-by: fullwaywang <fullwaywang@tencent.com>
Problem: Not all cabal config files are recognized.
Solution: Add a couple of patterns. (Marcin Szamotulski, closesvim/vim#12463)
166cd7b801
Also:
- Do not expand Lua patterns in environment variables used in file patterns.
- Test $XDG_CONFIG_HOME on Windows, as it can be used by Nvim (and the runner
sets it).
Co-authored-by: Marcin Szamotulski <coot@coot.me>
Problem:
Using "nvim -l args.lua" without passing extra script args, does not set `_G.arg[0]`.
Steps to reproduce:
```
cat > args.lua<<EOF
vim.print(_G.arg, '')
vim.print(vim.v.argv, '')
EOF
nvim --clean -l args.lua
```
Solution:
Fix condition in command_line_scan.
Problem: Empty CmdlineEnter autocommand causes errors in Ex mode.
Solution: Save and restore ex_pressedreturn. (Christian Brabandt,
closes # 12581, closesvim/vim#12578)
590aae3557
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Not all filetype file name matches are tested.
Solution: Add more file names to test with. (Jonas Strittmatter,
closesvim/vim#12569)
bd087ae8f0
Co-authored-by: smjonas <jonas.strittmatter@gmx.de>
Redrawing of 'statusline' and 'winbar' are actually already inhibited by
RedawingDisabled in Ex mode.
In Vim there is a check for `msg_scrolled == 0` (which is false in Ex
mode) since Vim doesn't have msgsep. Add a `!exmode_active` check here
in Nvim instead.
Problem: zserio files are not recognized.
Solution: Add a pattern for zserio files. (Dominique Pellé,
closesvim/vim#12544)
2b994da57a
Co-authored-by: =?UTF-8?q?Dominique=20Pell=C3=A9?= <dominique.pelle@gmail.com>
Enforce consistent terminology (defined in
`gen_help_html.lua:spell_dict`) for common misspellings.
This does not spellcheck English in general (perhaps a future TODO,
though it may be noisy).
Problem:
- `vim.json` exposes various global options which:
- affect all Nvim Lua plugins (especially the LSP client)
- are undocumented and untested
- can cause confusing problems such as: cc76ae3abe
- `vim.json` exposes redundant mechanisms:
- `vim.json.null` is redundant with `vim.NIL`.
- `array_mt` is redundant because Nvim uses a metatable
(`vim.empty_dict()`) for empty dict instead, which `vim.json` is
configured to use by default (see `as_empty_dict`).
Example:
```
:lua vim.print(vim.json.decode('{"bar":[],"foo":{}}'))
--> { bar = {}, foo = vim.empty_dict() }
```
Thus we don't need to also decorate empty arrays with `array_mt`.
Solution:
Remove the functions from the public vim.json interface.
Comment-out the implementation code to minimize drift from upstream.
TODO:
- Expose the options as arguments to `vim.json.new()`
Add automatic refresh and a public interface on top of #23736
* add on_reload, on_detach handlers in `enable()` buf_attach, and
LspDetach autocommand in case of manual detach
* unify `__buffers` and `hint_cache_by_buf`
* use callback bufnr in `on_lines` callback, bufstate: remove __index override
* move user-facing functions into vim.lsp.buf, unify enable/disable/toggle
Closes#18086
Co-authored by: zeertzjq <zeertzjq@outlook.com>
Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com>
Co-authored by: nobe4 <nobe4@users.noreply.github.com>
- docs: mention --luadev-mod to run with lua runtime files
When changing a lua file in the ./runtime folder, a new contributor
might expect changes to be applied to the built Neovim binary.
Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.
Co-authored by: notomo <notomo.motono@gmail.com>
Previously, filtering code actions with the "only" option failed
if the code action kind contained special Lua pattern chars such as "-"
(e.g. the ocaml language server supports a "type-annotate" code action).
Solution: use string comparison instead of string.find
Problem: Error message is cleared when removing mode message.
Solution: Also reset flags when the message is further down.
da51ad51bf
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Message is cleared when removing mode message (Gary Johnson).
Solution: Do not clear the command line after displaying a message.
800cdbb7ca
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Expanding a pattern interferes with command line completion.
Solution: Set the file index only when appropriate. (closesvim/vim#12519)
094dd152fe
Problem: Having utf16idx() rounding up is inconvenient.
Solution: Make utf16idx() round down. (Yegappan Lakshmanan, closesvim/vim#12523)
95707037af
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>