Follow-up refactor patches, mixed with unrelated patches in the middle,
is normal in vim-dev when the original patch is not fully tested
across all builds via CI or reviewed by others.
Unless core maintainers push "vim-patch:" directly to master/main branch
without running the full test-suite,
there is little reason to merge incomplete ports that will fail
on Nvim's CI or code review.
Relevant changes in patches like v8.2.0514 are either ported
or (will) become N/A.
Ignoring incompatible implementation,
TerminalOpen and TermOpen events are not 1-1.
"TerminalWinOpen" was accepted as N/A in
commit c7ee6af777 .
I planned to not do this to have more test cases
after manipulating the hunks header to filter out more hunks
but Justin is eager to just mark these N/A
to bump the Vim major.minor version.
Time to move on from v8.1.x.
Target v8.1.2195 .
Nvim did not port Vim's ":terminal" opts.
Incompatible implementations.
Ex-command was ported from C to Lua.
Vim needs them partly because of splitting the current window.
I keep forgetting `++close` option so I either run ":qall!"
or kill the parent process (ie. terminal emulator).
Unsatisfied users should create their Ex-command that runs jobstart().
Vim's TerminalWinOpen seems to be required because of Vim
buffer-job-popupwin implementation.
Based on the patch, I'm puzzled why fzf needs this on Vim.
Nvim's TermOpen, TermEnter, and detection mechanisms to know
if buffer is on a (active,visible) window should suffice to not port it.
If there was a feature request or issue without a merged fix,
then I can't find it.
https://github.com/junegunn/fzf/pull/2000
Vim core did not leverage it to override/customize bell/beep.
It wasn't used for custom sounds for system/user (autocmd) events.
It should be in-scope for GUI, unlike terminal, even as a plugin
by leveraging some internal option similar to `set guioptions+=!`.
No progress as of Vim 9.2 so I quit.
vim-patch.sh fails to detect n/a patches
because of ifdef FEAT_ guards and reserved Vim9script error codes.
Ignore all conditional directives for Vim's "FEAT_" guards.
https://cppreference.com/c/preprocessor/conditional
Problem: Vim9: can't use v:true for option flags.
Solution: Add tv_get_bool_chk(). (closesvim/vim#6725)
----
"tv_get_bool_or_number_chk()" without vim9 params is identical to
"tv_get_number_chk()".
"tv_get_number_chk()" and tv"_get_bool_chk()" are identical
after excluding new vim9 params.
Yes, "want_bool" param is N/A because of "in_vim9script()".
If I port it, then I will refactor these macros or "static inline"
functions within "src/nvim/eval/typval.h".
----
https://github.com/vim/vim/commit/36967b32fd02eaab4273c1a1e7a1210a5fe45d09
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Following remain relevant:
- src/testdir/Makefile (default setup in Unix-like OS)
- src/testdir/Make_all.mak (define old/new style Vim tests)
Rest are n/a because Nvim runs Vim's tests on GHA Windows runner.
* build(vim-patch): n/a func in version.c
init_longVersion() sets datetime for ":version".
Nvim removed it for more deterministic builds.
* build(vim-patch): n/a header from amiga
* build(vim-patch): n/a vim9 err msg for declaring vars
* build(vim-patch): nvim support.txt replaces *os-support*
* build(vim-patch): vim xdg is n/a
* build(vim-patch): n/a 1-line err msg
Vim error message can be 1-line (globals.h), not multi-line (errors.h).
Target v8.2.1032
Target v8.2.0543
This can catch stray '#define' but they're most likely 'TTFLAG' for
Vim9 types. N/A.
TTFLAG is used in 'static_types[]'.
See v9.0.0623.
1. Vim9 error messages, ex commands, are N/A.
2. ":scriptversion" is N/A:
3. Most `#.*define.*ex_ni$` are N/A
because `FEAT_` compile guards are N/A.
----
Target patch: v8.2.2238
Actual patch list:
```
vim-patch:8.2.4240: error for using flatten() in Vim9 script is unclear
vim-patch:9.0.0170: various minor code formatting issues
vim-patch:9.1.0356: MS-Windows: --remote may change working directory
vim-patch:9.2.0251: Link error when building without channel feature
vim-patch:9.2.0714: Coverity warns for NULL deref
vim-patch:9.2.0818: tests: client-server test fails without X11 server
vim-patch:9.2.0868: GTK: Window Manager hint prevents giving focus to dialog
```
----
Ignore diff blanklines via regex ("-I"), not "--ignore-blank-lines".
Almost useless.
I tried with/without "--word-diff=porcelain", "--word-diff-regex",
and diff algorithms like `--histogram`.
Nvim diverged from Vim's ":version".
- no date
- different compiled features list
- different config file and directory
- no compiler flags
* build(vim-patch): n/a doc for balloon feature (8.2.3917)
Vim patches for Vim help files must use Vim tags as diff hunk header
to reliably detect if a hunk is N/A or not.
Git does not know which files are Vim help files
so that it can use custom "diff.<filetype>.xfuncname" regexp
to create the header.
Update Neovim's gitattributes to detect Vim help files
and then use it on vim-patch.sh to scan Vim patches.
Add non-function tags from ":h vim_diff"
to detect N/A Vim runtime patches.
"vim-patch.sh -L" includes gpg signature for "log.showSignature=true"
in user's .gitconfig.
vim-patch.sh expects no signature for 1-line output per patch.
Vim's code and test for channel,job API are already N/A.
Blacklisting runtime/doc/channel.txt ensures most patches for it
will be detected as N/A.
Vim's API that is too incompatible with Neovim must be handled
outside vim-patch.sh .
Note this doesn't find new N/A patches by itself
and this is to align with ':h dev-vimpatch'.
Neovim refactored Vim's "char/string" functions to be either safer
(ie. xstrlcat) or target Unicode.
Note this doesn't find new N/A patches by itself
and this is to align with ':h dev-vimpatch'.
I use the 'vim_na_*' files to debug the filtered diff of files
that seem N/A but contain relevant code.
I can't blacklist the entire file.
Filter out `#ifdef` line changes when analyzing C files (*.c, *.h)
via git "-I" flag.
```
-I<regex>
--ignore-matching-lines=<regex>
Ignore changes whose all lines match <regex>. This option may be specified more than once.
```
- https://git-scm.com/docs/diff-options#Documentation/diff-options.txt--Iregex
Following features must be N/A to detect v8.Y.0000 as N/A
- VisVim
- Windows *.def files
- Gvim
- runtime/doc/version8.txt ("too old")
(https://github.com/neovim/neovim/pull/1116 deletes version7.txt)
PR https://github.com/neovim/neovim/pull/36585 enabled
"scripts/vim-patch.sh", "scripts/vimpatch.lua" to optimize out
(all?) macros from Vim's "src/version.h".
If it does have relevant updates, then the applicable files
(ie. src/version.c) will use them to make the patch applicable.
Goal - Detect N/A patches for Vim release vX.Y.0000.
Nvim relies on commit history for automated updates
to ported Vim patches across Vim releases via "included_patchsets[]".
Each Vim commit is suppose to manually adjust "included_patches[]"
but it is prone to human error such that vim-patch.sh found
the following N/A commits:
```
495282b6e Correct list of patch numbers
85d9b03f8 Correct list of patches.
```
Prior to this commit, vim-patch doesn't find the following N/A commit:
```
9.0.2172: Vim9: compiling :defer may fail
```
https://github.com/neovim/neovim/pull/40519#issuecomment-4850337525
vim_na_cfuncs.txt lists Vim C functions that are N/A to Nvim.
Listed in 'src/proto/*.proto' files.
Based on ':h vim-diff'.
- features (ie. balloon, tabpanel)
- Ex-commands
- eval functions (ie. f_err_teapot())
On top of the existing algorithm,
scan diff hunks on C files to filter out N/A C functions.
If the remaining hunk contains applicable changes,
then the patch is applicable.
If the patch does not modify C files, then it is likely applicable.
socketserver.c is not compatible with Neovim's server implementation.
cairo, kitty, sixel, and similar backends for image rendering in popup
are not required in Neovim's C core.
Neovim can do this and even run Doom.
See patch 9.2.0612.
Problem: When defining a dictionary function, the function name string
is allocated with vim_strnsave() but the result is not
checked. On allocation failure the dict entry is left with
type VAR_FUNC and a NULL name, and in the overwrite case the
previous entry has already been freed before the NULL is
stored.
Solution: Allocate the name before modifying the dict entry and bail out
on failure, freeing it on all error paths (thinca)
closes: vim/vim#20376https://github.com/vim/vim/commit/2b2dfc4f5a6064efd192c19750b551a01f393e83
Co-authored-by: thinca <thinca@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Problem: Problem with initializing the length of range() lists
Solution: Set length explicitly when it shouldn't contain any items
range() may cause a wrong calculation of list length, which may later
then cause a segfault in list_find(). This is usually not a problem,
because range_list_materialize() calculates the length, when it
materializes the list.
In addition, in list_find() when the length of the range was wrongly
initialized, it may seem to be valid, so the check for list index
out-of-bounds will not be true, because it is called before the list is
actually materialized. And so we may eventually try to access a null
pointer, causing a segfault.
So this patch does 3 things:
- In f_range(), when we know that the list should be empty, explicitly
set the list->lv_len value to zero. This should happen, when
start is larger than end (in case the stride is positive) or
end is larger than start when the stride is negative.
This should fix the underlying issue properly. However,
- as a safety measure, let's check that the requested index is not
out of range one more time, after the list has been materialized
and return NULL in case it suddenly is.
- add a few more tests to verify the behaviour.
fixes: vim/vim#13557closes: vim/vim#13563
--------
Vim9 (non) materialize list is N/A.
Port only tests.
https://github.com/vim/vim/commit/df63da98d8dc284b1c76cfe1b17fa0acbd6094d8
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Tim Pope <tpope@github.com>
Problem: test_channel may fail because of IPv6 config issues
Solution: Catch and skip the test, if getaddrinfo() fails with
'Address family not supported'
Mark tests as skipped when ch_open encounters E901
On some of the Debian build systems, the IPv6 channel tests fail because
`ch_open('[::1]:<port>', ...)` raises the error "E901: getaddrinfo() in
channel_open(): Address family for hostname not supported".
This appears to happen because getaddrinfo() can't perform the reverse
lookup for the ::1, which is a config issue on that system. Therefore,
instead of reporting a test failure, mark the test as skipped due to the
bad network config
closes: vim/vim#13473https://github.com/vim/vim/commit/43cb8e1c3b60f6fcd30a9a0f9b01b86d640b2165
Co-authored-by: James McCoy <jamessan@jamessan.com>
Problem: There is no way to do something on CTRL-Z.
Solution: Add VimSuspend and VimResume autocommand events. (closesvim/vim#7450)
https://github.com/vim/vim/commit/100118c73ac068137cd298d22953896242752523
----
Nvim implemented these events first and has enough tests.
test_suspend.vim relies on Vim 'terminal' feature.
Treat it as N/A even if all tests could be ported as Lua functional
screen/terminal tests.
----
Co-authored-by: Bram Moolenaar <Bram@vim.org>
* build(vim-patch): test_clientserver.vim is N/A
Requires 'job' and 'clientserver' features.
Both N/A for Neovim.
* build(vim-patch): test_gui_init.vim is N/A
Starts with command 'CheckCanRuiGui' .
Nvim doesn't support ':gui' (yet).
* build(vim-patch): test_plugin_vimball.vim is N/A
Run ':h vimball'.
* build(vim-patch): test_remote.vim is N/A
Needs 'clientserver', 'terminal' features.
* build(vim-patch): test_short_sleep.py is for test_terminal.vim. Both N/A
* build(vim-patch): mark N/A files from test_crypt.vim
* build(vim-patch): mark N/A file for test_terminal3.vim
* build(vim-patch): mark N/A files channel/terminal/vim9 tests