Problem:
":restart" always executes ":qall" to exit the server.
Solution:
Support ":restart +cmd" so the user can control the command
used to exit the server.
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
Vimscript functions return number to signal ok/error. Lua doesn't
convert these to be falsey.
Solution:
Explicitly check if the return value is 0.
Problem: After filtering out all elements, ArrayIter:last still returns a stale element.
Solution: Add check for self._head == self._tail and return nil early.
Fix#34696
Problem:
- There is reference to gVim in the usr_02.txt file, even though Nvim
has no built-in GUI.
- `:h help-summary` has a section about optional features (e.g.
`+conceal`) even though such thing does not exist in Nvim (`:h
+conceal` will give E149 error).
Solution:
- Remove reference to gVim.
- Replace the section about optional features with a section about Lua.
Problem: cannot easily trigger wildcard expansion
Solution: Introduce wildtrigger() function
(Girish Palya)
This PR introduces a new `wildtrigger()` function.
See `:h wildtrigger()`
`wildtrigger()` behaves like pressing the `wildchar,` but provides a
more refined and controlled completion experience:
- Suppresses beeps when no matches are found.
- Avoids displaying irrelevant completions (like full command lists)
when the prefix is insufficient or doesn't match.
- Skips completion if the typeahead buffer has pending input or if a
wildmenu is already active.
- Does not print "..." before completion.
This is an improvement on the `feedkeys()` based autocompletion script
given in vim/vim#16759.
closes: vim/vim#17806b486ed8266
While at it, also make Ctrl-Z trigger search completion.
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: Routing based on message kinds can be perceived as unpredictable.
Solution: Implement phase 1 of #34281, always showing the full message
in a window dismissed on any user input when it does not fit
in the 'cmdheight'. Also show spill "[+n]" indicator if needed.
Problem: unlike win_close, win_close_othertab could be used to close the
autocommand window from a different tabpage. This causes aucmd_restbuf to close
the wrong window, potentially causing a crash.
Solution: disallow closing it. Also replace a deprecated use of exc_exec in the
test file.
Fixes#21409.
Problem: no check for nvim_open_win opening a new floating window into a closing
buffer, which can lead to crashes.
Solution: call check_split_disallowed; opening a new float semantically splits
from a window, so the same problems as regular splits apply. Also restore the
error if switch_win_noblock in win_set_buf fails (may not be possible to hit
this, but win_set_buf can silently succeed there since #31595).
As the lock check applies to curbuf (not the target buffer) this may feel a bit
restrictive, though this isn't different to how things like ":split" or
nvim_open_win with "split = true" works when targeting a different buffer. Only
checking the target buffer's lock will cause issues if win_set_buf doesn't end
up in the target buffer for whatever reason.
Maybe we could consider checking the lock of the buffer after win_set_buf and
close the window if it's locked (maybe a bit fiddly, especially as closing a
window can fail...), or make the open + switch operation more atomic, like how
Vim does for its popup windows..?
It also used to be the case that win_set_buf would set an error if autocommands
sent us to a different buffer than what was requested, but #31595 appears to
have also changed that... I haven't touched that here.
Problem: can't accurately know if close_buffer directly (e.g: not via autocmds)
decremented b_nwindows. This can cause crashes if win_close_othertab decides to
keep the window after calling close_buffer (if it did not free the buffer), as
b_nwindows may remain out-of-sync.
Solution: change the return value of close_buffer to accurately depict whether
it decremented b_nwindows. Check it in win_close_othertab to avoid a crash.
Similar issues may exist in other places that call close_buffer, but I've not
addressed those here (not to mention only one other place even checks its return
value...)
Problem: TabClosed is fired after close_buffer is called (after b_nwindows is
decremented) and after the tab page is removed from the list, but before it's
freed. This causes inconsistencies such as the removed tabpage having a valid
handle and functions like nvim_tabpage_get_number returning nonsense.
Solution: fire it after free_tabpage. Try to maintain the Nvim-specific
behaviour of setting `<amatch>` to the old tab page number, and the
(undocumented) behaviour of setting `<abuf>` to the buffer it was showing
(close_buffer sets w_buffer to NULL if it was freed, so it should be OK pass it
to apply_autocmds_group, similar to before).
Problem: No check for closing the only non-floating window in a non-current
tabpage that contains floats. This can lead to a tabpage that contains only
floats, causing crashes.
Solution: Copy the relevant check from win_close to win_close_othertab. Fix some
uncovered issues.
Closes#34943Fixes#31236
Co-authored-by: glepnir <glephunter@gmail.com>
**Problem:** For unchanged document diagnostic reports, the `resultId`
is ignored completely, even though it should still be saved for the
request (in fact, the spec marks it as mandatory for unchanged reports,
so it should be extra important).
**Solution:** Always store the `resultId`.
Problem: Memory leak when pressing Ctrl-D in cmdline mode
(after 9.1.1571).
Solution: Free prev_cmdbuff before assigning to it.
(zeertzjq).
Existing tests already cover this. This change fixes the CI failure.
closes: vim/vim#17807c02bef26fd
Problem: The CmdlineChanged event was firing unnecessarily, even when
the command line's content hadn't actually changed.
Solution: I've added a check to compare the command-line buffer's state
before and after key processing. The `CmdlineChanged` event
now only triggers if the buffer's contents are genuinely
different (Girish Palya).
closes: vim/vim#17803239c4e4abe
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: Functions used in one file are global.
Solution: Add "static". (Yegappan Lakshmanan, closesvim/vim#4840)
5843f5f37b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
https://github.com/neovim/neovim/pull/9674 removed switch_to_win_for_buf().
This vim-patch removed the last relevant usage of find_win_for_buf()
Vim uses switch_to_win_for_buf() only for if_py_both.
Problem: Viminfo support is spread out.
Solution: Move more viminfo code to viminfo.c. (Yegappan Lakshmanan,
closesvim/vim#4717) Reorder code to make most functions static.
c3328169d5735aa4c4c8 was the partial port for
the typedefs.
This patch completes the viminfo->shada port.
- get_shada_parameter()
- find_shada_parameter()
Other patches below are N/A.
vim-patch:8.1.1728: wrong place for command line history viminfo support
Problem: Wrong place for command line history viminfo support.
Solution: Move it to viminfo.c.
5f32ece459
vim-patch:8.1.1730: wrong place for mark viminfo support
Problem: Wrong place for mark viminfo support.
Solution: Move it to viminfo.c. (Yegappan Lakshmanan, closesvim/vim#4716)
1e78e69680
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: The evalfunc.c file is getting too big.
Solution: Move channel and job related functions to channel.c.
0a1f56fcfe
---
N/A patches below:
vim-patch:8.1.0770: inconsistent use of ELAPSED_FUNC
Problem: Inconsistent use of ELAPSED_FUNC.
Solution: Consistently use ELAPSED_FUNC. Also turn ELAPSED_TYPE into a
typedef. (Ozaki Kiichi, closesvim/vim#3815)
1ac56c2d11
vim-patch:8.1.0914: code related to findfile() is spread out
Problem: Code related to findfile() is spread out.
Solution: Put findfile() related code into a new source file. (Yegappan
Lakshmanan, closesvim/vim#3934)
5fd0f5052f
vim-patch:8.1.1004: function "luaV_setref()" not covered with tests
Problem: Function "luaV_setref()" not covered with tests.
Solution: Add a test. (Dominique Pelle, closesvim/vim#4089)
e165f63598
vim-patch:8.1.1551: warning for shadowing popup_dragwin
Problem: Warning for shadowing popup_dragwin. (Dominique Pelle)
Solution: Add missing change.
6c17543b56
vim-patch:8.1.1629: terminal function help is in the wrong file
Problem: Terminal function help is in the wrong file.
Solution: Move the function details to terminal.txt.
6bf2c6264b
vim-patch:8.1.1641: garbage collection may run at a wrong moment
Problem: Garbage collection may run at a wrong moment. (Trygve Aaberge)
Solution: Postpone garbage collection while parsing messages. (closesvim/vim#4620)
6cc7e21412
vim-patch:8.1.1703: breaking out of loop by checking window pointer insufficient
Problem: Breaking out of loop by checking window pointer is insufficient.
Solution: Check the window ID and the buffer number. (closesvim/vim#4683)
6138640806
vim-patch:8.1.1802: missing change to call_callback()
Problem: Missing change to call_callback().
Solution: Add missing change.
b2129068a5
vim-patch:8.1.1853: timers test is still flaky
Problem: Timers test is still flaky.
Solution: Compute the time to sleep more accurately.
52953194af
---
Seems N/A now because of commit 09370eae77
---
vim-patch:8.1.2200: crash when memory allocation fails
Problem: Crash when memory allocation fails.
Solution: Check for NULL curwin and curbuf. (Christian Brabandt,
closesvim/vim#4839)
1cac70953d
vim-patch:8.2.3922: cannot build with dynamic Ruby 3.1
Problem: Cannot build with dynamic Ruby 3.1.
Solution: Add "_EXTRA" variables for CI. Add missing functions. (Ozaki
Kiichi, closesvim/vim#9420)
8bb3fe4d4d
vim-patch:9.0.0546: supporting Ruby 1.8 makes code complicated
Problem: Supporting Ruby 1.8 makes code complicated.
Solution: Drop Ruby 1.8 support, it is ancient. (Ken Takata, closesvim/vim#11195)
236ccbf6f8
vim-patch:9.0.0928: using Ruby LDFLAGS may cause build problems
Problem: Using Ruby LDFLAGS may cause build problems.
Solution: Do not add Ruby LDFLAGS to Vim's LDFLAGS. (Zdenek Dohnal,
closesvim/vim#11592)
1d822afaf6
vim-patch:9.1.1382: if_ruby: unused compiler warnings from ruby internals
Problem: if_ruby: unused compiler warnings from ruby internals
Solution: disable -Wunused-parameter for if_ruby internal code
(Philip H.)
closes: vim/vim#17297411730e277
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: No numerical value for the patchlevel.
Solution: Add v:versionlong.
37df9a4401
Restore "highest_patch()" solely for "v:versionlong".
Copy/paste Test_vvar_scriptversion2() from patch 9.1.1540.
It works without ":scriptversion 2".
In general, if Vim's test works with ":scriptversion 1", just port it
for additional coverage.
---
vim-patch:8.1.1565: MS-Windows: no sound support
Problem: MS-Windows: no sound support.
Solution: Add sound support for MS-Windows. (Yasuhiro Matsumoto, Ken Takata,
closesvim/vim#4522)
9b283523f2
----
"sound" feature is N/A now but this updates "v:versionlong" docs.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Blob not tested with Ruby.
Solution: Add more test coverage. fixes a crash. (Dominique Pelle,
closesvim/vim#4036)
0d13cce345
-----
https://github.com/neovim/neovim/pull/15211 ports Blob type.
"Test_ruby_Vim_blob()" was already committed.
Skipped because "ruby provider" did not implement Blob API.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: The indent.c file is a bit big.
Solution: Move C-indent code a a new cindent.c file. Move other
indent-related code to indent.c. (Yegappan Lakshmanan,
closesvim/vim#5031)
14c01f8348
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Ignore functionality is not separated.
Solution: Move indent functionality into a new file. (Yegappan Lakshmanan,
closesvim/vim#3886)
4b47162cce
----
Partial port of v8.1.2127 by porting directly to indent_c.c,
not indent.c.
----
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: expanding $var does not escape whitespace for 'path'
Solution: Escape whitespace when expanding 'path' option.
(Miguel Barro)
closes: vim/vim#178018b004081c4
Co-authored-by: Miguel Barro <miguel.barro@live.com>
- Match :autocmd options and special buffer pattern.
- Normalise ellipsis (three dots) in Ex command argument lists.
closes: vim/vim#1779331ec66403d
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: Copilot suggested some improvements in cmdexpand.c
(after v9.1.1556)
Solution: Use better variable names and comments
(John Marriott).
closes: vim/vim#1779588b735973c
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: Crash when using inline diff mode
(Ilya Grigoriev)
Solution: Set tp_diffbuf to NULL when skipping a diff block
(Yee Cheng Chin).
Fix an array out of bounds crash when using diffopt+=inline:char when 4
or more buffers are being diff'ed. This happens when one of the blocks
is empty. The inline highlight logic skips using that buffer's block,
but when another buffer is used later and calls diff_read() to merge the
diff blocks together, it could erroneously consider the empty block's
diff info which has not been initialized, leaving to diff numbers that
are invalid. Later on the diff num is used without bounds checking which
leads to the crash.
Fix this by making sure to unset tp_diffbuf to NULL when we skip a
block, so diff_read() will not consider this buffer to be used within
inline diff. Also, add more bounds checking just to be safe.
closes: vim/vim#17805c8b99e2d13
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Problem:
`:EditQuery` command accepts a language argument, but it doesn't
highlight properly for injected languages.
Solution:
- Fully parse with the root language and then filter the query on the
child trees that are of the language requested.
- Also support completion (`EditQuery <tab>`).