Problem:
Using vim.defer_fn() just before Nvim exit leaks luv handles.
Solution:
Make vim.schedule() return an error message if scheduling failed.
Make vim.defer_fn() close timer if vim.schedule() failed.
Problem:
`on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true.
Solution:
Change the order of the relevant blocks.
- fix readability issue with IncSearch/CurSearch
- add highlights to some of ftplugins distributed with vim
closes: vim/vim#19295c99aaf4c87
Co-authored-by: Maxim Kim <habamax@gmail.com>
Problem:
On Windows, writing to a pipe doesn't work if the pipe isn't connected
yet. This causes an RPC request to a session newly created by connect()
to hang, as it's waiting for a response to a request that never reaches
the server.
Solution:
Wait for uv.pipe_connect() callback to be called when using connect().
Problem: using NOT with a float returns a float in legacy vim script
(kennypete)
Solution: Return a number instead of a float (Yegappan Lakshmanan)
fixes: vim/vim#19282closes: vim/vim#19289ecc3faef61
N/A patches:
vim-patch:8.2.1980: Vim9: some tests are not done at the script level
vim-patch:9.1.2122: Vim9: Negating a float doesn't result in a bool
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem:
Currently, : mark is set in start of prompt-line. But more relevant
location is where the user text starts.
Solution:
Store and update column info on ': just like the line info
Previously, adjust_start_col returned nil when completion items had
different start position from lsp textEdit range
This caused the completion to fall back to \k*$ which ignores the
non-keyword characters
Changes:
- adjust_start_col: now returns the minimum start postion among all
items instead of nil
- _lsp_to_complete_items - normalizes the items by adding the gap between
current and minimum start
Fixes: https://github.com/neovim/neovim/issues/37441
Problem: 'cursorline' and part of 'statusline' are missing after
:diffput to an empty buffer.
Solution: Make sure the cursor doesn't go beyond the last line after
:diffput (zeertzjq)
related: neovim/neovim#37621
closes: vim/vim#19281ce1e562fda
Problem: crash when using 'tagfunc' (Rodrigo Queipo)
Solution: Do not add the user_data to the 'info' dictionary when called
for insert mode completion (the TAG_INS_COMP flag is set).
Completion should not depend on the state of a previous tag
jump. (Yasuhiro Matsumoto)
fixes: vim/vim#19255closes: vim/vim#1928457b577df32
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Problem: tests: Test_language_cmd fails on OpenBSD because the test
uses an invalid locale name and expects the command to produce
an error. OpenBSD accepts (almost) any locale name as valid by
design, so the :lang command succeeds and the test fails.
Solution: Slightly update the "bad" locale name to make it something
that OpenBSD considers invalid by adding a dot (but not ending
with ".UTF-8"). Maintain the original two underscores in the
name because that ensures Windows will also see it as invalid
(Kevin Goodsell).
closes: vim/vim#19280371583642a
Problem: Unexpected behavior after PTY child process fails to chdir(),
as it then thinks it's the parent process.
Solution: Exit the child process instead of returning.
Problem: Heap UAF if a terminal buffer is deleted during TermRequest in
Normal mode.
Solution: Increment terminal refcount before triggering TermRequest, and
destroy the terminal if the buffer is closed during that.
- Add PreInsert (darkblue, habamax, lunaperche, wildcharm, retrobox).
- Update QuickFixLine (habamax, lunaperche, wildcharm, retrobox) - make
it foreground transparent in GUI.
- Make Todo in wildcharm just bold.
closes: vim/vim#18304b1b80506ce
Co-authored-by: Maxim Kim <habamax@gmail.com>
- all colorschemes were ported to colortemplate v3
- gui versions of habamax, lunaperche, wildcharm, retrobox colorschemes
have different Diff, Visual, Search and IncSearch colors compared to non-gui.
- habamax Search was changed to green instead of blue to better distinct
it with Visual (also bluish in gui)
closes: vim/vim#18061f3055eac84
Co-authored-by: Maxim Kim <habamax@gmail.com>
indent/rust.vim behaves incorrectly when a string literal contains the
substring "if".
For example, in this code:
let x = "
motif
";
struct X {
}
indent/rust.vim thinks that the closing "}" should line up with "motif".
This patch fixes the issue by checking whether the "if" is in a string
literal or comment before considering it to be a match for a subsequent
brace (and also by requiring it to start on a word boundary).
Add an indent test to ensure this does not regress.
closes: vim/vim#19265663d809194
Co-authored-by: taylor.fish <contact@taylor.fish>
Problem: long statusline may crash if using singlebyte encoding
(fizz-is-on-the-way)
Solution: Drop the non-mbyte codepath and always use the mbyte code
(zeertzjq)
3f7be0d7e1
Problem: The behavior of vim.eval() with Vim special variables is not
clearly documented. It is (partly) the reason why Nvim
Python's vim.eval gives different output when evaluating
v:true and v:false
Solution: Document it (Phạm Bình An)
closes: vim/vim#191571e54023673
Problem: Wrong terminal scrollback if BufFile* autocommand drains PTY
output but doesn't process the pending refresh.
Solution: Refresh scrollback before refreshing screen in terminal_open()
if scrollback has been allocated.
Although powerful -- especially with chained modifiers --, the
readability (and therefore maintainability) of `fnamemodify()` and its
modifiers is often worse than a function name, giving less context and
having to rely on `:h filename-modifiers`. However, it is used plenty in
the Lua stdlib:
- 16x for the basename: `fnamemodify(path, ':t')`
- 7x for the parents: `fnamemodify(path, ':h')`
- 7x for the stem (filename w/o extension): `fnamemodify(path, ':r')`
- 6x for the absolute path: `fnamemodify(path, ':p')`
- 2x for the suffix: `fnamemodify(path, ':e')`
- 2x relative to the home directory: `fnamemodify(path, ':~')`
- 1x relative to the cwd: `fnamemodify(path, ':.')`
The `fs` module in the stdlib provides a cleaner interface for most of
these path operations: `vim.fs.basename` instead of `':t'`,
`vim.fs.dirname` instead of `':h'`, `vim.fs.abspath` instead of `':p'`.
This commit refactors the runtime to use these instead of fnamemodify.
Not all fnamemodify calls are removed; some have intrinsic differences
in behavior with the `vim.fs` replacement or do not yet have a
replacement in the Lua module, i.e. `:~`, `:.`, `:e` and `:r`.
Problem:
The :intro fails to display in ui2 because wait_return(true) triggers a full
redraw. Furthermore statuslines are visible when using :intro
Solution:
Replace wait_return() with plain_vgetc(). This works with old and ui2 while also removing the unnecessary statusline and "press ENTER" prompt.
Updates tests to work with new behaviour.
Signed-off-by: ashab-k <ashabkhan2000@gmail.com>
Problem:
- Nvim supports multi-line input in prompt buffer, so line(`$`) is not
always the prompt line.
Solution:
- Use `line("':")` to get the prompt line.
Problem:
Two cases lsp.enable() won't work in the first FileType event
1. lsp.enable luals inside FileType or ftplugin/lua.lua, then:
```
nvim a.lua
```
2. lsp.enable luals inside FileType or ftplugin/lua.lua, then:
```
nvim -> :edit a.lua -> :mksession! | restart +qa! so Session.vim
```
Solution:
Currently `v:vim_did_enter` is used to detected two cases:
1. "maunally enabled" (lsp.enable() or `:lsp enable`)
2. "inside FileType event"
To detect 2. correctly we use did_filetype().