Problem: A plugin does not know when startup scripts were already
triggered. This is useful to determine if a function is
called inside vimrc or after (like when sourcing 'plugin/'
files).
Solution: Add the v:vim_did_init variable (Evgeni Chasnovski)
closes: vim/vim#18668294bce21ee
Nvim has two more steps between sourcing startup scripts and loading
plugins. Set this variable after these two steps.
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Problem: Changing permissions fail when using `gp` if the file under
the cursor is not in the current working directory.
Solution: Use the already available `a:curdir` argument and prepend it
to the `<cfile>`, so that the path of the file is correct.
This commit also refactors some leftover `netrw#ErrorMsg` to
`netrw#msg#Notify` (the main refactoring was done in
f5e3b5c04f85b0f69cd2aae81e4938cfb191a790).
closes: vim/vim#18674fe71c56d8f
Co-authored-by: Mohammad Reza Karimi <m.r.karimi.j@gmail.com>
Problem: In visual mode, g<End> does not move to the last non-blank
character when the end of a line is on the same line as the
cursor (after v9.0.1753)
Solution: Move the cursor back by one position if it lands after the
line (varsidry)
fixes: vim/vim#18657closes: vim/vim#18658adc85151f3
Problem:
In socket_connect(), if connecting to the given TCP address times out,
libuv is still trying to connect to the address, and connect_cb may be
called when running the libuv event loop after the `status` variable
referenced by `req.data` goes out of scope.
Solution:
Close the uv_tcp_t handle and wait for connect_cb to be called before
retrying or failing in socket_connect(). This also avoid leaking libuv
handles.
The tests added here only check that the non-timeout case still works,
as checking the timeout case is very hard without modifications to the
code. Removing the first LOOP_PROCESS_EVENT_UNTIL() in socket_connect()
(the one with the timeout) is a way to check that manually.
Also add a comment about the cause of the ASAN error in #34586.
Problem:
On MSWIN, file completion (CTRL-X CTRL-F) only works for the current
drive (so not for actual absolute paths), since drive letters are never
included in the completion pattern.
e.g. when completing "F:\Hello" Nvim currently completes "\Hello"
which is relative to the current drive/volume.
vim solves this by adding ':' to the default 'isfname' value on mswin,
but that causes issues as ':' is not a valid windows path char anywhere
_except_ after the drive letter.
Solution:
detect drive letters in front of the path when creating the completion
pattern.
Problem: %P in 'statusline' doesn't behave as documented
(after 9.1.1479).
Solution: Make the percentage 3-chars wide when not translated.
(zeertzjq)
fixes: vim/vim#18669closes: vim/vim#1867173a0de4a04
Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
Problem: regression when displaying localized percentage position
(after v9.1.1291)
Solution: calculate percentage first (Emir SARI)
Cleanups made in ec032de broke the Turkish percent display, failing to
prepend it properly in cases between 0 and 10. In Turkish, the percent
sign is prepended to the number, so it was displaying it as `% 5`
(should have been `%5`), while displaying numbers bigger than 9 properly.
related: vim/vim#175978fe9e55a7d
The test was unskipped in Vim in patch 9.1.1479 which added Turkish
translation for "%d%%". However, Nvim has had Turkish translation for
"%d%%" since 2023, so don't skip the test.
Co-authored-by: Emir SARI <emir_sari@icloud.com>
compile time features are hot again.
Note: this changes the &term value for builtin definition from
'builtin_xterm' to just 'xterm'. It's an xterm regardless of we use an
external definition or an internal. Prior to this commit the vast
majority of POSIX users will have used external terminfo, so plugins and
scripts are only going to have checked for &term == 'xterm' or 'tmux' or
whatever.
The status of external loading is still available in "nvim -V3" output.
Problem: string handling in strings.c can be improved
Solution: Refactor strings.c and remove calls to STRLEN()
(John Marriott)
This change does:
- In vim_strsave_shellescape() a small cosmetic change.
- In string_count() move the call to STRLEN() outside the while loop.
- In blob_from_string() refactor to remove call to STRLEN().
- In string_from_blob() call vim_strnsave() instead of vim_strsave().
- In vim_snprintf_safelen() call vim_vsnprintf_typval() directly instead
of vim_vsnprintf() which then calls vim_vsnprintf_typval().
- In copy_first_char_to_tv() change to return -1 on failure or the length
of resulting v_string. Change string_filter_map() and string_reduce() to
use the return value of copy_first_char_to_tv().
closes: vim/vim#18617110656ba60
Co-authored-by: John Marriott <basilisk@internode.on.net>
Problem: too many strlen() calls in buffer.c
Solution: refactor buffer.c and remove strlen() calls
(John Marriott)
closes: vim/vim#17063ec032de646
Co-authored-by: John Marriott <basilisk@internode.on.net>
:restart changes the terminal under which the server process is run,
which can be confusing when combined with other testing.
Also, use COLORTERM=xterm-256color for tests with 'notermguicolors' to
avoid delay on server exit. Not all these delays are blocking, but they
increase the number of simultaneously existing Nvim processes.
Problem: Wrong display with cpo+=$, matchparen and wrapped line.
Solution: Use old cursor line height when scrolling with cpo+=$. Also
fix wrong redraw in non-current window. (zeertzjq)
fixes: vim/vim#18647closes: vim/vim#186625c3e762631
This was part of an attempt to add "git describe" to zig build
without re-building too much. This doesn't yet work as zig upstream
changes are are also needed, but I think this was a sensible refactor
even in isolation, so breaking it out.
"API dispatch" doesn't depend on any ui event stuff nor on
version, that was just an accident of the metadata collection
being crammed into the same file.
Remove "manual invocation" instruction. this is going to bitrot anyway.
Both cmake and build.zig allows you to extract the command line of a
step, so you can debug it separately.
problem: termkey/driver-ti.c had its internal dependency upon unibilium
which would completely skip builtin terminfo defs.
solution: add termkey info to TerminfoEntry struct
NOTE: this disables a lot of named function keys which are present as
terminfo "keys" both are mostly unset in terminfo entries for modern
terminals, and also not recognized by nvim as mappable keys
anyway, except a few ones like `<undo>` which this still will keep.
We probably don't want to encode up to F63 keys forever. While only 12
physical keys are available on modern keybords, instead Chords using
F-keys are usually encoded as high key numbers, like <C-S-F3>
becoming <F39> . But reconsideirg that has implications for configuration
that is best done as a separate (breaking) change.
Problem: Wrong restored cursor position when re-entering a buffer
previously viewed in a window after making changes to the same
buffer in another window.
Solution: Adjust per-window "last cursor" positions on buffer changes.
(zeertzjq)
closes: vim/vim#18655b2e6b328da
Problem:
Previously, the fallback logic to ".conf" was located outside of
`vim.filetype.match()` and directly within the AutoCmd definition. As a
result, `vim.filetype.match()` would return nil instead of ".conf" for
fallback cases (#30100).
Solution:
Added a boolean return value to `vim.filetype.match()` that indicates
whether the match was the result of fallback. If true, the filetype will
be set using `setf FALLBACK <ft>` instead of `setf <ft>`.
Problem: Wrong display with 'smoothscroll' when FEAT_DIFF is disabled.
Solution: Use plines_correct_topline() (zeertzjq).
closes: vim/vim#18649e06e70f7b1