Problem: Renaming a buffer on startup may cause using freed memory.
Solution: Check if the buffer is used in a window. (closesvim/vim#8955)
d3710cf01e
Cherry-pick Test_echo_true_in_cmd() from Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: tests: zip test still resets 'shellslash' option
Solution: Remove resetting the 'shellslash' option, the zip
plugin should now be able to handle this options
closes: vim/vim#1543491efcd115e
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: the zip plugin is not tested.
Solution: include tests (Damien)
closes: vim/vim#15411d7af21e746
Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
Problem: [security] double-free in dialog_changed()
(SuyueGuo)
Solution: Only clear pointer b_sfname pointer, if it is different
than the b_ffname pointer. Don't try to free b_fname,
set it to NULL instead.
fixes: vim/vim#15403
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-46pw-v7qw-xc2fb29f4abcd4
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: goaccess config file not recognized
Solution: detect 'goaccess.conf' as goaccess filetype, also
include a basic syntax and ftplugin (Adam Monsen)
Add syntax highlighting for GoAccess configuration file.
GoAccess is a real-time web log analyzer and interactive viewer that
runs in a terminal in *nix systems or through your browser.
GoAccess home page: https://goaccess.iocloses: vim/vim#154140aa65b48fb
Co-authored-by: Adam Monsen <haircut@gmail.com>
Problem: Calling a function from an "expr" option has too much overhead.
Solution: Add call_simple_func() and use it for 'foldexpr'
87b4e5c5db
Cherry-pick a call_func() change from patch 8.2.1343.
Add expr-option-function docs to options.txt.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: using a script-local function requires using "s:" when
setting 'completefunc'.
Solution: Do not require "s:" in Vim9 script. (closesvim/vim#9796)
1fca5f3e86
vim-patch:8.2.4417: using NULL pointer
Problem: Using NULL pointer.
Solution: Set offset after checking for NULL pointer.
e89bfd212b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: ex: trailing dot is optional for :g and :insert/:append
Solution: don't break out early, when the next command is empty.
(Mohamed Akram)
The terminating period is optional for the last command in a global
command list.
closes: vim/vim#154070214680a8e
Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
Problem: [security] use-after-free in tagstack_clear_entry
(Suyue Guo )
Solution: Instead of manually calling vim_free() on each of the tagstack
entries, let's use tagstack_clear_entry(), which will
also free the stack, but using the VIM_CLEAR macro,
which prevents a use-after-free by setting those pointers
to NULL
This addresses CVE-2024-41957
Github advisory:
https://github.com/vim/vim/security/advisories/GHSA-f9cr-gv85-hcr48a0bbe7b8a
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: use-after-free in check_argument_type
Solution: Reset function type pointer when freeing the function type
list
function pointer fp->uf_func_type may point to the same memory, that was
allocated for fp->uf_type_list. However, when cleaning up a function
definition (e.g. because it was invalid), fp->uf_type_list will be
freed, but fp->uf_func_type may still point to the same (now) invalid
memory address.
So when freeing the fp->uf_type_list, check if fp->func_type points to
any of those types and if it does, reset the fp->uf_func_type pointer to
the t_func_any (default) type pointer
closes: vim/vim#136520f28791b21
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: [security]: use-after-free in exec_instructions()
Solution: get tv pointer again
[security]: use-after-free in exec_instructions()
exec_instructions may access freed memory, if the GA_GROWS_FAILS()
re-allocates memory. When this happens, the typval tv may still point to
now already freed memory. So let's get that pointer again and compare it
with tv. If those two pointers differ, tv is now invalid and we have to
refresh the tv pointer.
closes: vim/vim#136215dd41d4b63
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Cannot use an autoload function from a package under start.
Solution: Also look in the "start" package directory. (Bjorn Linse,
closesvim/vim#7193)
223a950a85
Nvim already does this in do_in_cached_path(), and this change has no
effect in Nvim as Nvim removes DIP_START after do_in_cached_path().
Accidentally failed to mark as ported:
vim-patch:8.2.1731: Vim9: cannot use += to append to empty NULL list
Co-authored-by: bfredl <bjorn.linse@gmail.com>
Problem: eval.c not sufficiently tested
Solution: Add a few more additional tests for eval.c,
(Yegappan Lakshmanan)
closes: vim/vim#147994776e64e72
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Some functions are not tested
Solution: Add a few more tests, fix a few minor problems
(Yegappan Lakshmanan)
closes: vim/vim#14789fe424d13ef
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: regex: wrong match when searching multi-byte char
case-insensitive (diffsetter)
Solution: Apply proper case-folding for characters and search-string
This patch does the following 4 things:
1) When the regexp engine compares two utf-8 codepoints case
insensitive it may match an adjacent character, because it assumes
it can step over as many bytes as the pattern contains.
This however is not necessarily true because of case-folding, a
multi-byte UTF-8 character can be considered equal to some
single-byte value.
Let's consider the pattern 'ſ' and the string 's'. When comparing and
ignoring case, the single character 's' matches, and since it matches
Vim will try to step over the match (by the amount of bytes of the
pattern), assuming that since it matches, the length of both strings is
the same.
However in that case, it should only step over the single byte value
's' by 1 byte and try to start matching after it again. So for the
backtracking engine we need to ensure:
* we try to match the correct length for the pattern and the text
* in case of a match, we step over it correctly
There is one tricky thing for the backtracing engine. We also need to
calculate correctly the number of bytes to compare the 2 different
utf-8 strings s1 and s2. So we will count the number of characters in
s1 that the byte len specified. Then we count the number of bytes to
step over the same number of characters in string s2 and then we can
correctly compare the 2 utf-8 strings.
2) A similar thing can happen for the NFA engine, when skipping to the
next character to test for a match. We are skipping over the regstart
pointer, however we do not consider the case that because of
case-folding we may need to adjust the number of bytes to skip over.
So this needs to be adjusted in find_match_text() as well.
3) A related issue turned out, when prog->match_text is actually empty.
In that case we should try to find the next match and skip this
condition.
4) When comparing characters using collections, we must also apply case
folding to each character in the collection and not just to the
current character from the search string. This doesn't apply to the
NFA engine, because internally it converts collections to branches
[abc] -> a\|b\|c
fixes: vim/vim#14294closes: vim/vim#1475622e8e12d9f
N/A patches:
vim-patch:9.0.1771: regex: combining chars in collections not handled
vim-patch:9.0.1777: patch 9.0.1771 causes problems
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Illegal memory access when pattern starts with illegal byte.
Solution: Do not match a character with an illegal byte.
f50940531d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot use items() on a string.
Solution: Make items() work on a string. (closesvim/vim#11016)
3e518a8ec7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: items() does not work on a list. (Sergey Vlasov)
Solution: Make items() work on a list. (closesvim/vim#11013)
976f859763
Skip CHECK_LIST_MATERIALIZE.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Check that mapping rhs starts with lhs doesn't work if lhs is
not simplified.
Solution: Keep track of the mapblock containing the alternative lhs and
also compare with it (zeertzjq).
fixes: vim/vim#15376closes: vim/vim#153849d997addc7
Cherry-pick removal of save_m_str from patch 8.2.4059.
Problem: E1510 may happen when formatting a message
(after 9.1.0181).
Solution: Only give E1510 when using typval. (zeertzjq)
closes: vim/vim#153910dff31576a
Problem: filetype: SuperHTML template files not recognized
Solution: Update the filetype detection code to detect '*.shtml' either
as HTML (Server Side Includes) or SuperHTML (template files)
(EliSauder)
related: vim/vim#15355
related: vim/vim#15367e57c9a19ed
Co-authored-by: EliSauder <24995216+EliSauder@users.noreply.github.com>
Problem: Rename of pum hl_group is incomplete in source.
Solution: Also rename the test function. Rename to user_hlattr in code
to avoid confusion with pum_extra. Add test with matched text
highlighting (zeertzjq).
closes: vim/vim#153484100852e09
Problem: cannot mark deprecated attributes in completion menu
Solution: add hl_group to the Dictionary of supported completion fields
(glepnir)
closes: vim/vim#15314508e7856ec
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: filetype: Make syntax highlighting off for MS Makefiles
Solution: Try to detect MS Makefiles and adjust syntax rules to it.
(Ken Takata)
Highlighting of variable expansion in Microsoft Makefile can be broken.
E.g.:
2979cfc262/src/Make_mvc.mak (L1331)
Don't use backslash as escape characters if `make_microsoft` is set.
Also fix that `make_no_comments` was not considered if `make_microsoft`
was set.
Also add description for `make_microsoft` and `make_no_comments` to the
documentation and include a very simple filetype test
closes: vim/vim#15341eb4b903c9b
Co-authored-by: Ken Takata <kentkt@csc.jp>
Problem: Swapname has double slash when 'directory' ends in double slash.
(Shane Smith)
Solution: Remove the superfluous slash. (closesvim/vim#8876)
8b0e62c93b
The test got lost in #29758...
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cursor moves beyond start of a folded range at the end of a buffer.
Solution: Move cursor to start of fold when going beyond end of buffer.
Check that cursor moved to detect FAIL in outer cursor function.
(Luuk van Baal)
dc373d456b
Problem: filetype: OpenGL Shading Language files are not detected
Solution: detect various file extensions as GLSL filetype, include
indent and syntax script, do no longer recognize '*.comp'
as Mason filetype (Gregory Anders)
closes: vim/vim#15317e4b991ed36
Problem: pattern detection for Dracula language uses "*lvs" and "*lpe".
as there is no dot, those are not treated as extensions which
they should (judging by 'runtime/syntax/dracula.vim' and
common sense).
Solution: use "*.lvs" and "*.lpe" patterns (Evgeni Chasnovski)
closes: vim/vim#153035fb801a74f
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Problem: filetype: prolog detection can be improved
Solution: Improved the Prolog file detection regex and added tests for
all cases. (igna_martinoli)
fixes: vim/vim#10835closes: vim/vim#1520650dc83cf92
Only include the tests, as code changes are superseded by later patches.
Co-authored-by: igna_martinoli <ignamartinoli@protonmail.com>
Problem: Wrong cursor position with 'breakindent' when a double-width
character doesn't fit in a screen line (mikoto2000)
Solution: Include the width of the 'breakindent' properly.
(zeertzjq)
fixes: vim/vim#15289closes: vim/vim#15290b5d6b5caac
Problem: Termdebug: still get E1023 when specifying arguments and using
a prompt buffer.
Solution: Use empty() instead of len(). Add a test. Fix wrong order of
arguments to assert_equal() in Test_termdebug_basic().
(zeertzjq)
closes: vim/vim#15288aef6179bcf
Problem: filetype: Debian devscripts config files are not recognized
Solution: detect devscripts.conf and .devscripts files as sh filetype
(sourced by /bin/sh)
closes: vim/vim#1522776c19028ff
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: Functions are global while they could be local.
Solution: Add "static". Add a few tests. (Yegappan Lakshmanan,
closesvim/vim#10612)
ee47eaceaa
Omit script_name_after_autoload(), untrans_function_name(): Vim9 script
only.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Test may leave file behind.
Solution: Delete the temporary file. Don't profile in the running Vim
instance.
8c801b374b
This only includes test_quickfix.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Various inconsistencies in test files.
Solution: Add modelines where they were missing. Use Check commands instead
of silently skipping over tests. Adjust indents and comments.
(Ken Takata, closesvim/vim#6695)
6d91bcb4d2
This only includes test_quickfix.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Code style is not check in test scripts.
Solution: Add basic code style check for test files.
94722c5107
Use Test_test_files() from latest Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
56564964e6
This includes all changes expect changes in test_startup.vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: In :let-heredoc line continuation is recognized.
Solution: Do not consume line continuation. (Ozaki Kiichi, closesvim/vim#4580)
e96a2498f9
Nvim already sets may_garbage_collect to false in nv_event(), so the
timer change isn't needed.
Other changes have already been ported.
Also fix incorrect port of test in patch 8.1.1356.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: filetype: Mediawiki files are not recognized
Solution: detect "*.mw" and "*.wiki" as mediawiki filetype,
include basic syntax and filetype plugins.
(AvidSeeker)
closes: vim/vim#15266b5844104ab
Co-authored-by: AvidSeeker <avidseeker7@protonmail.com>
Problem: Some command line arguments and regexp errors not tested.
Solution: Add a few test cases. (Dominique Pellé, closesvim/vim#8013)
a2b3e7dc92
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: matchstr() still does not match column offset when done after a
text search.
Solution: Only use the line number for a multi-line search. Fix the test.
(closesvim/vim#10938)
753aead960
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: matchstr() does match column offset. (Yasuhiro Matsumoto)
Solution: Accept line number zero. (closesvim/vim#10938)
75a115e8d6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when pattern looks below the last line.
Solution: Consider invalid lines to be empty. (closesvim/vim#10938)
13ed494bb5
Comment out the test as it uses Vim9 script and text properties.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Two placed signs in the same line are not combined. E.g. in the
terminal debugger a breakpoint and the PC cannot be both be
displayed.
Solution: Combine the sign column and line highlight attributes.
a2f6e42ded
Nvim already does this in decor_redraw_signs().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Spellfile code not completely tested.
Solution: Add a few more test cases. (Yegappan Lakshmanan, closesvim/vim#6929)
96fdf4348a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Spellfile code not completely tested.
Solution: Add a few more test cases. (Yegappan Lakshmanan, closesvim/vim#6918)
64e2db6dc6
Fix incorrect spellfile message.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when using NULL list with sign functions.
Solution: Handle a NULL list like an empty list. (issue vim/vim#8260)
5c56da4de8
Nvim's TV_LIST_ITER_MOD() already checks for NULL.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Signals test often fails on FreeBSD.
Solution: Use separate files for Suspend and Resume. (Ken Takata,
closesvim/vim#11065)
a9480dbc8c
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: TSTP and INT signal tests are not run with valgrind.
Solution: Sleep a bit longer. (closesvim/vim#10614)
61e3784819
Cherry-pick Test_signal_TSTP() from patch 8.2.3941.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: List of distributed files is outdated.
Solution: Update the file list. Minor comment updates.
a72514945b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Tests fail when the float feature is disabled.
Solution: Skip tests that don't work without float support.
5feabe00c4
Cherry-pick Test_ruby_Vim_blob() from patch 8.1.0977 and skip it.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash when assert_equal() runs into a NULL string.
Solution: Check for NULL. (Dominique) Add a test.
f155196444
Use the latest version of the test from Vim.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: CI sometimes fails for MinGW.
Solution: Use backslashes in HandleSwapExists(). (Christian Brabandt,
closesvim/vim#9078)
4b2c804767
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: check for DO_NOT_FREE_CNT is very slow.
Solution: Move to a separate function so it can be skipped by setting
$TEST_SKIP_PAT.
dae453f339
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: tests: test_cpoptions leaves swapfiles around
Solution: Use :bw! instead of :close!
bb5d27dc79
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Manually deleting temp test files.
Solution: Use the 'D' flag of writefile() and mkdir().
45bbaef038
This only includes test_cpoptions.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: ocaml runtime files are outdated
Solution: sync those files with the upstream repo,
detect a few more ocaml files
(Yinzuo Jiang)
closes: vim/vim#15260700cf8cfa1
Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Problem: filetype: *.pdf_tex files are not recognized
Solution: Detect '*.pdf_tex' files as tex filetype
(Jonas Dujava)
Those files are generated by inkscape, when exporting, see e.g.
https://inkscape.org/doc/inkscape-man.htmlcloses: vim/vim#1525028145e005d
Co-authored-by: Jonas Dujava <jonas.dujava@gmail.com>
Problem: Printed line no longer overwrites colon when pressing Enter in
Ex mode (after 9.1.0573).
Solution: Restore the behavior of pressing Enter in Ex mode.
(zeertzjq)
closes: vim/vim#152587d664bf0eb
Problem: An :lmap mapping for a printable keypad key is not applied
when typing it in Select mode.
Solution: Change keypad key to ASCII after setting vgetc_char.
(zeertzjq)
closes: vim/vim#1524590a800274d
Problem: Ex command is still executed after giving E1247.
Solution: Indicate the error properly and set cmd to NULL.
(zeertzjq)
closes: vim/vim#15241d1b5ea984d
Problem: Unnecessary checks for v:sizeoflong in test_put.vim. They are
no longer necessary as patch 8.2.3661 has changed the count to
be within 32-bit integer limit.
Solution: Remove the checks (zeertzjq).
closes: vim/vim#1523969a28f6c08
Problem: fnamemodify() treats ".." and "../" differently.
Solution: Expand ".." properly like how "/.." is treated in 8.2.3388.
(zeertzjq)
closes: vim/vim#152181ee7420460
Problem: Manually deleting temp test files.
Solution: Use the 'D' flag of writefile() and mkdir().
45bbaef038
This only includes test_cd.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
3b0d70f4ff
This only includes test_cd.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot use relative paths as findfile() stop directories.
Solution: Change a relative path to an absolute path.
(zeertzjq)
related: vim/vim#15200closes: vim/vim#15202764526e279
Problem: Stop directory in findfile() doesn't work properly without a
trailing slash.
Solution: Always use fnamencmp(), not fnamecmp().
related: vim/vim#15200
related: vim/vim#15202e6ab23bd4a
Problem: Stop directory doesn't work properly in 'tags'.
(Jesse Pavel)
Solution: Also move the stop directory forward by one byte.
(zeertzjq)
This doesn't support relative stop directories yet, as they are not
supported in other places like findfile() either.
fixes: vim/vim#15200
related: vim/vim#1520268819afb2c
Problem: Using common name in tests leads to flaky tests.
Solution: Rename files and directories to be more specific.
3b0d70f4ff
This only includes test_findfile.vim changes.
vim-patch:9.1.0562: tests: inconsistency in test_findfile.vim
Problem: tests: inconsistency in test_findfile.vim, it saves and
restores 'shellslash', but doesn't actually set it
Solution: Set shellslash explicitly (zeertzjq)
closes: vim/vim#15217e7b98ab96e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: fnamemodify('path/..', ':p') differs from using 'path/../'.
Solution: Include the "/.." in the directory name. (closesvim/vim#8808)
4eaef9979f
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: moving in the buffer list doesn't work as documented
(SenileFelineS)
Solution: Skip non-help buffers, when run from normal buffers, else
only move from help buffers to the next help buffer (LemonBoy)
As explained in the help section for :bnext and :bprev the commands
should jump from help buffers to help buffers (and from regular ones to
regular ones).
fixes: vim/vim#4478closes: vim/vim#15198893eeeb445
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: filetype: angular ft detection is still problematic
(after 9.1.0551)
Solution: detect htmlangular filetype only by inspecting the content,
do not try to determine it from a generic name like
'*.component.html'
For the reasons mentioned here:
https://github.com/vim/vim/pull/13594#issuecomment-1834465890
related: vim/vim#15190
related: vim/vim#13594
related: vim/vim#13604c03f631b7b
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: :bwipe doesn't remove file from jumplist and tagstack of other
tabpages. Time complexity of mark_forget_file() is O(n^2) when
removing all entries (after v9.1.0554)
Solution: Use FOR_ALL_TAB_WINDOWS(). Start the loops over the arrays
from the end instead of the start (zeertzjq)
closes: vim/vim#151992e7d89b398
Problem: filetype: htmlangular files are not properly detected
Solution: Use the new htmlangular filetype for angular files, because
since angular v17, those are no longer valid HTML files.
(Dennis van den Berg)
Since Angular 17, the new Control Flow Syntax is not valid HTML. This PR
adds a new filetype detection for the HTML templates of Angular.
It first checks the filename. The Angular convention is to use
*.component.html for the template. However, this is not mandatory.
If the filename does not match, it will check the contents of the file
if it contains:
- One of the Control-Flow blocks: @if, @for, @switch, @defer
- A structural directive: *ngIf, *ngFor, *ngSwitch, *ngTemplateOutlet
- Builtin Angular elements: ng-template or ng-content
- String interpolation: {{ something }}
This enables the Angular LSP to attach only to htmlangular filetypes, as
well as language parsers, such as tree-sitter.
closes: vim/vim#151901ad194c0df
Co-authored-by: Dennis van den Berg <dennis.vandenberg@nedap.com>
Problem: No test for antlr4 filetype
(after 9.1.0550)
Solution: Add a simple filename test
related: vim/vim#151918fc23bb8a4
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: :bw leaves jumplist and tagstack data around
(Paul "Joey" Clark)
Solution: Wipe jumplist and tagstack references to the wiped buffer
(LemonBoy)
As documented the :bwipeout command brutally deletes all the references
to the buffer, so let's make it delete all the entries in the jump list
and tag stack referring to the wiped-out buffer.
fixes: vim/vim#8201closes: vim/vim#151854ff3a9b1e3
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: No way to get the arity of a Vim function
(Austin Ziegler)
Solution: Enhance get() Vim script function to return the function
argument info using get(func, "arity") (LemonBoy)
fixes: vim/vim#15097closes: vim/vim#1510948b7d05a4f
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: Behavior of CursorMovedC is strange.
Solution: Also trigger when the cmdline has changed.
(zeertzjq)
fixes: vim/vim#15069closes: vim/vim#150718145620a95
Problem: not possible to assign priority when defining a sign
(Mathias Fußenegger)
Solution: Add the priority argument for the :sign-define ex command and
the sign_define() function (LemonBoy)
Use the specified value instead of the default one (SIGN_DEF_PRIO) when
no priority is explicitly specified in sign_place or :sign place.
fixes: vim/vim#8334closes: vim/vim#15124b975ddfdf9
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: filetype: zone files are not recognized
(rpdprd)
Solution: Detect '*.zone' files as bindzone filetype
fixes: vim/vim#14222f095539b39
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: signed number detection for CTRL-X/A can be improved
(Chris Patuzzo)
Solution: Add the new "blank" value for the 'nrformat' setting. This
will make Vim assume a signed number only if there is a blank
in front of the sign.
(distobs)
fixes: vim/vim#15033closes: vim/vim#1511025ac6d67d9
Co-authored-by: distobs <cuppotatocake@gmail.com>
Problem: completion wrong with fuzzy when cycling back to original
(Quan Nguyen)
Solution: reset show_match_ok when cp_score is zero (glepnir)
fixes: vim/vim#15095closes: vim/vim#1510565407ce1d2
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: the recursive parameter in the *_equal functions can be removed
Solution: Remove the recursive parameter in dict_equal(), list_equal()
object_equal and tv_equal(). Use a comparison of the static
var recursive_cnt == 0 to determine whether or not tv_equal()
has been called recursively (Yinzuo Jiang).
closes: vim/vim#150707ccd1a2e85
Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Problem: Cursor is moved to bottom of window trying to pagescroll when
already at the start of the buffer (Asheq Imran, after v9.1.0357)
Solution: Don't move cursor when buffer content did not move.
(Luuk van Baal)
8ccb89016e
Problem: Right release selects immediately when pum is truncated.
Solution: Use pum_height instead of pum_size when checking click row.
Don't place it above mouse row when there is more space below.
(zeertzjq)
fixes: vim/vim#15101closes: vim/vim#15102761a420c66
Problem: silent! causes following try/catch to not work
(Malcolm Rowe)
Solution: consider emsg_silent in handle_did_throw() and do not abort
evaluation flow for :silent! (LemonBoy)
The silent! flag causes the evaluation not to be aborted in case of
uncaught exceptions, adjust handle_did_throw to take this detail into
account.
Fixes the long-standing todo.txt item:
```
Problem that a previous silent ":throw" causes a following try/catch not
to work. (ZyX, 2013 Sep 28) With examples: (Malcolm Rowe, 2015 Dec 24)
Also see vim/vim#8487 for an example.
```
fixes: vim/vim#538closes: vim/vim#15128749ba0f6d9
Cherry-pick Test_deeply_nested_source() from patch 8.2.5169.
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Problem: need more tests for nested dicts and list comparison
Solution: Add tests for comparing deeply nested List/Dict values
(Yegappan Lakshmanan)
closes: vim/vim#1508188bbdb04c2
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: filetype: .envrc & .prettierignore not recognized
Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore
filetype (Tyler Miller)
Support ft detection for `.envrc` files used by direnv, and
`.prettierignore` files used by prettier.
closes: vim/vim#15053resolves: neovim/neovim#2940549012cd8c2
Co-authored-by: Tyler Miller <tmillr@proton.me>
Problem: Mode message for spell completion doesn't match allowed keys
(Kyle Kovacs)
Solution: Show "^S" instead of "s".
(zeertzjq)
This matches the code in vim_is_ctrl_x_key():
case CTRL_X_SPELL:
return (c == Ctrl_S || c == Ctrl_P || c == Ctrl_N);
fixes: neovim/neovim#29431closes: vim/vim#150657002c055d5
Problem: hard to detect cursor movement in the command line
Solution: Add the CursorMovedC autocommand
(Shougo Matsushita)
closes: vim/vim#15040d09521476f
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Problem: too complicated mapping restore in termdebug
Solution: simplify unmapping logic, add a few more tests
(Ubaldo Tiberi)
closes: vim/vim#1504646f2823807
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Problem: inner-tag textobject confused about ">" in attributes
Solution: Skip over quoted '>' when determining the start position
fixes: vim/vim#15043closes: vim/vim#15049ca7f93e6f3
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: termdebug can be further improved
Solution: refactor save/restore, update docs,
add a new save/restore test (Ubaldo Tiberi)
closes: vim/vim#15032a48637c105
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Problem: CurSearch highlight is often wrong.
Solution: Remember the last highlighted position and redraw when needed.
368137aa52
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: MS-Windows: doesn't handle symlinks properly
(Timothy Madden)
Solution: Implement lstat() on MS-Windows
(author)
lstat() differs from stat() in how it handles symbolic links, the former
doesn't resolve the symlink while the latter does so.
Implement a simple yet effective fallback using Win32 APIs.
fixesvim/vim#14933closes: vim/vim#1501423c5ebeb95
Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: matched text is highlighted case-sensitively
Solution: use MB_STRNICMP, update highlighting when the base changes
(glepnir)
fixes: vim/vim#15021closes: vim/vim#15023f189138b39
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: Matched text isn't highlighted in cmdline pum.
Solution: Use cmdline completion pattern in cmdline mode.
(zeertzjq)
closes: vim/vim#15029d8c9340fc6
Cherry-pick syntax.txt change from runtime update.
Problem: Wrong matched text highlighted in pum with 'rightleft'.
Solution: Match using the original text instead of the reversed text.
(zeertzjq)
closes: vim/vim#1502063901e8963
Problem: Vim-script files may not be recognised
Solution: Add shebang line detection (Doug Kearns)
closes: vim/vim#150120d4d23dac0
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: Test for patch 9.1.0489 doesn't fail without the fix.
Solution: Use "!" flag of feedkeys() so that ex_normal_busy is not set
and ins_compl_check_keys() is not skipped (zeertzjq).
closes: vim/vim#15018acc8746941
Problem: default completion may break with fuzzy
Solution: check that completion_match_array is not null
(glepnir)
closes: vim/vim#15010aced8c2f4f
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: Cmdline pum doesn't work properly with 'rightleft'.
Solution: Don't use curwin->w_p_rl in cmdline mode in pum_redraw(). Use
a static variable since pum_may_redraw() may be called in any
mode. Also correct position of other popups with 'rightleft'.
(zeertzjq)
closes: vim/vim#15005883018feff
Problem: completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
(glepnir)
closes: vim/vim#14955f94c9c482a
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: Matched text shouldn't be highlighted in "kind" and "menu".
Solution: Pass hlf_T instead of the attribute. Fix indent.
(zeertzjq)
closes: vim/vim#14996afbe5359e9
Problem: Cannot see matched text in popup menu
Solution: Introduce 2 new highlighting groups: PmenuMatch and
PmenuMatchSel (glepnir)
closes: vim/vim#1469440c1c3317d
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: Sorting of completeopt+=fuzzy is not stable.
Solution: Compare original indexes when scores are the same.
(zeertzjq)
closes: vim/vim#149888e56747fd2
Problem: termdebug plugin needs more love
Solution: start with some more Vim9 refactoring
to improve maintenance and readability
(Ubaldo Tiberi)
List of Changes and the Reasoning Behind Them:
1) Introduction of InitScriptVariables() Function:
Reasoning: This function has been introduced to ensure that when you open and
close Termdebug, and then open it again, there are no leftover script variable
values from the previous session. Leftover values could potentially cause
issues. The goal is for each Termdebug session to be independent of previous
sessions. At startup, all script variables are initialized. The only exception
is g:termdebug_loaded located at the very beginning of the script to prevent
sourcing the script twice. The variables are declared at script level and
defined in InitScriptVariables().
2) More Descriptive Variable Names:
Reasoning: The names of variables have been made more comprehensive. Almost
every Termdebug buffer now has a variable to indicate its name and another
variable to indicate its number, improving code readability and
maintainability. Due to the latest discussion around the &mousemodel option
save/restore mechanism, perhaps some other variables shall be prepended with
saved_.
3) Consistent Naming for GDB Terminal Buffers:
Reasoning: The name of the GDB terminal buffer now matches the name of the GDB
program being used, e.g., 'gdb', 'mygdb', 'arm-eabi-none-gdb', etc. This
ensures clarity and consistency in identifying buffers.
4) Other minor improvements:
Moved EchoErr() on top, added another test, some refactoring, mainly changed
several 0 and 1 to true and false
closes: vim/vim#14980ef8eab86e2
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Problem: glob() not sufficiently tested
Solution: Add more tests for directory containing [] chars
related: vim/vim#149918b34aea1b0
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: block_editing errors out when using <enter>
(Ali Rizvi-Santiago, after v9.1.0274)
Solution: Change ins_len from size_t to int so that the test
if ins_len is negative actually works properly
Add a test, so that this doesn't regress.
fixes: vim/vim#149601fb9eae579
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Legacy :sign API still allows placing signs beyond the end of
the buffer. This is unaccounted for by the signcolumn tracking
logic and is disallowed in general for the extmark API which
implements it now.
Solution: Clamp legacy sign line number to the length of the buffer.
Problem: Cannot have buffer-local value for 'completeopt'
(Nick Jensen).
Solution: Make 'completeopt' global-local (zeertzjq).
Also for some reason test Test_ColonEight_MultiByte seems to be failing
sporadically now. Let's mark it as flaky.
fixes: vim/vim#5487closes: vim/vim#14922529b9ad62a
Problem: no fuzzy-matching support for insert-completion
Solution: enable insert-mode completion with fuzzy-matching
using :set completopt+=fuzzy (glepnir).
closes: vim/vim#14878a218cc6cda
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
existing filetype plugins with the new default value
(Riley Bruins)
closes: vim/vim#148430a0830624a
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Problem: Typos in test files.
Solution: Correct the typos. (Dominique Pellé, closesvim/vim#9175)
923dce2b07
Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
Problem: Left shift is incorrect with vartabstop and shiftwidth=0
Solution: make tabstop_at() function aware of shift direction
(Gary Johnson)
The problem was that with 'vartabstop' set and 'shiftwidth' equal 0,
left shifts using << were shifting the line to the wrong column. The
tabstop to the right of the first character in the line was being used
as the shift amount instead of the tabstop to the left of that first
character.
The reason was that the tabstop_at() function always returned the value
of the tabstop to the right of the given column and was not accounting
for the direction of the shift.
The solution was to make tabstop_at() aware of the direction of the
shift and to choose the tabtop accordingly.
A test was added to check this behavior and make sure it doesn't
regress.
While at it, also fix a few indentation/alignment issues.
fixes: vim/vim#14864closes: vim/vim#1488788d4f255b7
Co-authored-by: Gary Johnson <garyjohn@spocom.com>
Problem: Test for what 8.2.4436 fixes does not check for regression.
Solution: Set several options. (Ken Takata, closesvim/vim#9830)
2dada73a4e
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Crash with weird 'vartabstop' value.
Solution: Check for running into the end of the line.
4e889f98e9
Code change is N/A as it's superseded by virtual text changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: minor issues in test_filetype with rasi test
(after 9.1.0453)
Solution: re-sort test_filetype, fix wrong syntax.txt help tags
f3dd6f617c
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: rasi files are not recognized
Solution: regonize '*.rasi' files as rasi filetype,
include a filetype and syntax plugin
(Pierrick Guillaume)
ported from: https://github.com/Fymyte/rasi.vimcloses: vim/vim#14821280e5b13ca
Co-authored-by: Pierrick Guillaume <pierguill@gmail.com>
Problem: No test for escaping '<' with shellescape()
Solution: Add a test. Use memcpy() in code to make it easier to
understand. Fix a typo (zeertzjq).
closes: vim/vim#1487688c8c547d5
Problem: Testing the shell option is incomplete and spread out.
Solution: Move shell tests to one file and increase coverage. (Yegappan
Lakshmanan, closesvim/vim#8464)
054794c20f
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: getregionpos() behaves inconsistently for a partly-selected
multibyte char.
Solution: Always use column of the first byte for a partly-selected
multibyte char (zeertzjq).
closes: vim/vim#14851ef73374dc3
Problem: Can't use a blockwise selection with a width for getregion().
Solution: Add support for blockwise selection with width like the return
value of getregtype() or the "regtype" value of TextYankPost
(zeertzjq).
closes: vim/vim#14842afc2295c22
Problem: Strange error message when using islocked() with a number.
(Yegappan Lakshmanan)
Solution: Check that the name is empty.
1840a7b4e3
Use ll_name_len instead.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Cannot filter the history
Solution: Implement :filter :history
closes: vim/vim#1483542a5b5a6d0
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: getregionpos() can't properly indicate positions beyond eol.
Solution: Add an "eol" flag that enables handling positions beyond end
of line like getpos() does (zeertzjq).
Also fix the problem that a position still has the coladd beyond the end
of the line when its column has been clamped. In the last test case
with TABs at the end of the line the old behavior is obviously wrong.
I decided to gate this behind a flag because returning positions that
don't correspond to actual characters in the line may lead to mistakes
for callers that want to calculate the length of the selected text, so
the behavior is only enabled if the caller wants it.
closes: vim/vim#148382b09de9104
Problem: Wrong Ex command executed when :g uses '?' as delimiter and
pattern contains escaped '?'.
Solution: Don't use "*newp" when it's not allocated (zeertzjq).
closes: vim/vim#148373074137542
Problem: Wrong yanking with exclusive selection and virtualedit=all,
and integer overflow when using getregion() on it.
Solution: Set coladd when decreasing column and 'virtualedit' is active.
Add more tests for getregion() with 'virtualedit' (zeertzjq).
closes: vim/vim#14830701ad50a9e
Problem: getregionpos() doesn't handle one char selection.
Solution: Handle startspaces differently when is_oneChar is set.
Also add a test for an exclusive charwise selection with
multibyte chars (zeertzjq)
closes: vim/vim#1482552a6f34887
Problem: tests: some issues with termdebug mapping test
Solution: Use assert_{true,false} if suitable, change
order of expected and actual arguments in assert() calls.
(Ken Takata)
closes: vim/vim#14818
related: 7fbbd7f
ffed1540f3
Co-authored-by: Ken Takata <kentkt@csc.jp>
Problem: Tag guessing leaves wrong search history with very short names
(after 9.1.0426).
Solution: Use the correct variable for pattern length (zeertzjq).
closes: vim/vim#1481742cd192daa
Cherry-pick Test_tagbsearch() changes from patch 9.0.0767.
Problem: block_editing errors out when using del
(@Jamarley)
Solution: Change ins_len from size_t to int and
properly check that it doesn't become negative
There is a check in os.c that verifies that `ins_len` does not become
negative:
```
if (pre_textlen >= 0 && (ins_len = len - pre_textlen - offset) > 0)
```
However this only works, if ins_len can actually become negative and
unfortunately, ins_len has been declared as `size_t` so instead of
becoming negative it will wrap around and be very large.
So let's define it as integer, after which the condition above
properly catches this condition.
fixes: vim/vim#14734closes: vim/vim#14735d5c8c0920e
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: getregionpos() wrong with blockwise mode and multibyte.
Solution: Use textcol and textlen instead of start_vcol and end_vcol.
Handle coladd properly (zeertzjq).
Also remove unnecessary buflist_findnr() in add_regionpos_range(), as
getregionpos() has already switched buffer.
closes: vim/vim#14805c95e64f41f
Problem: Cannot get a list of positions describing a region
(Justin M. Keyes, after v9.1.0120)
Solution: Add the getregionpos() function
(Shougo Matsushita)
fixes: vim/vim#14609closes: vim/vim#14617b4757e627e
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: Cannot move to previous/next rare word
(Colin Kennedy)
Solution: Add the ]r and [r motions (Christ van Willegen)
fixes: vim/vim#14773closes: vim/vim#147808e4c4c7d87
Co-authored-by: Christ van Willegen - van Noort <github.com@vanwillegen-vannoort.nl>
Problem: Unable to leave long line with 'smoothscroll' and 'scrolloff'.
Corrupted screen near the end of a long line with 'scrolloff'.
(Ernie Rael, after 9.1.0280)
Solution: Only correct cursor in case scroll_cursor_bot() was not itself
called to make the cursor visible. Avoid adjusting for
'scrolloff' beyond the text line height (Luuk van Baal)
b32055e504
vim-patch:9.1.0416: some screen dump tests can be improved
Problem: some screen dump tests can be improved (after 9.1.0414)
Solution: Make sure screen state changes properly and is captured in the
screen dumps (Luuk van Baal)
2e642734f4
Problem: smoothscroll may cause infinite loop, with
very narrow windows
(Jaehwang Jung, after v9.1.0280)
Solution: Check for width1 being negative, verify
that win_linetabsize does not overflow
fixes: vim/vim#14750closes: vim/vim#14772eff20eb35d
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: No scrolling happens with half-page scrolling with line
filling entire window when 'smoothscroll' is disabled.
(Mathias Rav, after v9.1.0285)
Solution: Adjust amount to move cursor by so that it is moved the same
number of lines as was scrolled, even when scrolling different
number of lines than requested with 'nosmoothscroll'.
58448e09be
Problem: Divide by zero with getmousepos() and 'smoothscroll'.
Solution: Don't compute skip_lines when width1 is zero.
(zeertzjq)
closes: vim/vim#14747031a745608
Problem: filetype: zsh module files are not recognized
Solution: Detect '*.mdh' and '*.epro' as C filetype, '*.mdd' as zsh
filetype, determine zsh-modules '*.pro' from from it's content
(Wu, Zhenyu)
closes: vim/vim#14737887a38cee7
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: Wrong display with 'smoothscroll' when changing quickfix list.
Solution: Reset w_skipcol when replacing quickfix list (zeertzjq).
closes: vim/vim#14730c7a8eb5ff2
Problem: cursor() and getregion() don't handle v:maxcol well.
Solution: Add special handling for v:maxcol like setpos() does.
(zeertzjq)
closes: vim/vim#146982ffdae7948
Problem: filetype: stylus files not recognized
Solution: Detect '*.styl' and '*.stylus' as stylus filetype,
include indent, filetype and syntax plugin
(Philip H)
closes: vim/vim#146562d919d2744
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Problem: filetype: .out files recognized as tex files
Solution: Do not set an explicit filetype until it is clear what this
should be (shane.xb.qian)
closes: vim/vim#14670e35478bc9d
Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
Problem: Kbuild files are not recognized.
Solution: Detect Kbuild files as make files.
(Bruno Belanyi)
closes: vim/vim#146765cbc9a69e5
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
Problem: cbuffer and similar quickfix and locationlist commands don't
accept a range, even so it is documented they should
(ilan-schemoul, after 8.1.1241)
Solution: Define ex commands with ADDR_LINES instead of ADDR_OTHER
fixes: vim/vim#14638closes: vim/vim#14657652c821366
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: When :edit an existing buffer, line('w$') may return a
wrong result.
Solution: Reset w_valid in curwin_init() (Jaehwang Jung)
`do_ecmd()` reinitializes the current window (`curwin_init()`) whose
`w_valid` field may have `VALID_BOTLINE` set. Resetting `w_botline`
without marking it as invalid makes subsequent `validate_botline()`
calls a no-op, thus resulting in wrong `line('w$')` value.
closes: vim/vim#14642eb80b8304e
Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.
Closes https://github.com/neovim/neovim/issues/27004.
Problem: tests: test_vim9_builtin is a bit slow
Solution: source tests from a buffer instead of
writing and sourcing a file (Yegappan Lakshmanan)
closes: vim/vim#1461422697b6179
N/A patch:
vim-patch:9.1.0299: Vim9: return type not set for a lambda assigned to script var
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>