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>
Problem: Crash when typing many keys with D- modifier (after 9.1.0227).
Solution: Don't treat a 0x80 byte inside a special sequence as the start
of a special sequence (zeertzjq).
closes: vim/vim#146136b13e3d4e4
Problem: Page scrolling does not always place the cursor at the top or
bottom of the window (Mathias Rav)
Solution: Place the cursor at the top or bottom of the window.
(Luuk van Baal)
4b6b0c4024
Problem: tests: test_winfixbuf is a bit slow
Solution: use defer if possible, reset hidden option, use --not-a-term
when starting Vim using system() (Yegappan Lakshmanan)
closes: vim/vim#146114baf908d60
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: runtime(uci): No support for uci file types
(Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
(Colin Caine)
closes: vim/vim#145754b3fab14db
Co-authored-by: Colin Caine <complaints@cmcaine.co.uk>
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: No test that completing a partial mapping clears 'showcmd'.
Solution: Complete partial mappings in Test_showcmd_part_map() instead
of using :echo. Adjust some comments (zeertzjq).
closes: vim/vim#14580094c4390bd
Problem: 'showcmd' is wrong for partial mapping with multibyte char,
and isn't very readable with modifyOtherKeys.
Solution: Decode multibyte char and merge modifiers into the char.
(zeertzjq)
This improves the following situations:
- Multibyte chars whose individual bytes are considered unprintable are
now shown properly in 'showcmd' area.
- Ctrl-W with modifyOtherKeys now shows ^W in 'showcmd' area.
The following situation may still need improvement:
- If the char is a special key or has modifiers that cannot be merged
into it, internal keycodes are shown in 'showcmd' area like before.
This applies to keys typed in Normal mode commands as well, and it's
hard to decide how to make it more readable due to the limited space
taken by 'showcmd', so I'll leave it for later.
closes: vim/vim#14572acdfb8a979
Problem: Cursor wrong after using setcellwidth() in terminal
(mikoto2000)
Solution: output additional spaces, so the behaviour matches the GUI
(mikoto2000)
fixes: vim/vim#14539closes: vim/vim#14540
Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.
e20fa59903
This is already fixed and tested in Nvim in #28322.
Co-authored-by: mikoto2000 <mikoto2000@gmail.com>
Problem: a few memory leaks are found
(LuMingYinDetect )
Solution: properly free the memory
Fixes the following problems:
- Memory leak in f_maplist()
fixes: vim/vim#14486
- Memory leak in option.c
fixes: vim/vim#14485
- Memory leak in f_resolve()
fixes: vim/vim#14484
- Memory leak in f_autocmd_get()
related: vim/vim#14474
- Memory leak in dict_extend_func()
fixes: vim/vim#14477fixes: vim/vim#14238closes: vim/vim#1451729269a71b5
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Error with matchaddpos() and empty list
(@rickhow)
Solution: Return early for an empty list
fixes: vim/vim#14525closes: vim/vim#14563f7d31adcc2
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
(Yegappan Lakshmanan)
related: vim/vim#14529closes: vim/vim#14556bce51d9005
Cherry-pick eval_to_string_eap() from patch 8.2.1914.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
as requirements filetype, include pip compiler, include
requirements filetype and syntax plugin
(Wu, Zhenyu, @raimon49)
closes: vim/vim#14379f9f5424d3e
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
Problem: Vim9: Not all function argument types are properly checked.
Solution: Add and improve argument type checks. (Yegappan Lakshmanan,
closesvim/vim#8839)
fc3b775055
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
and '.notmuch-config' as ini filetype
(Shane-XB-Qian)
closes: vim/vim#14533a7a9a476cf
Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
Problem: No test for highlight behavior with 'ambiwidth'.
Solution: Add a screendump test for 'ambiwidth' with 'cursorline'.
(zeertzjq)
closes: vim/vim#14554a59e031aa0
Problem: CI fails with t_?? test
Solution: use assert_match instead of assert_equal
and test only until t_xo, depending on system
there may be several more termcap codes coming
0d87e3c711
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: When used terminal with XON/XOFF flow control, vim tries to
still make CTRL-S mapping available, which results in severe
screen corruption, especially on large redraws, and even
spurious inputs (John Tsiombikas)
Solution: Disallow CTRL-S mapping if such terminal is recognized.
Don't remove IXON from the bitmask inversion.
(Anton Sharonov)
*** When started like this:
TERM=vt420 vim
:set termcap
shows "t_xon=y"
map <C-S> :echo "abc"<CR>
does nothing (after <C-S> output freezes and subsequent <C-Q>
unfreezes it)
*** When started like this:
TERM=xterm vim
:set termcap
shows "t_xon="
map <C-S> :echo "abc"<CR>
works (after <C-S> one see "abc" string echo-ed)
fixes: vim/vim#12674closes: vim/vim#1454249528da8a6
Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
Problem: String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
(without having to convert it to string() first)
(Yegappan Lakshmanan)
fixes: vim/vim#14529closes: vim/vim#14541f01493c550
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Wrong cursor position after using setcellwidths().
Solution: Invalidate cursor position in addition to redrawing.
(zeertzjq)
closes: vim/vim#1454505aacec6ab
Reorder functions in test_utf8.vim to match upstream.
Problem: Crash when using heredoc with comment in command block.
Solution: Handle a newline more like the end of the line, fix coverity
warning (zeertzjq).
closes: vim/vim#145351f5175d9af
Problem: filetype: some history files are not recognized
Solution: Add some history patterns to filetype.vim
(Wu, Zhenyu)
closes: vim/vim#14513da70feabea
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: xilinx files are not recognized
Solution: Add a few xilinx specific file patterns,
inspect lpr files for being xml/pascal
(Wu, Zhenyu)
closes: vim/vim#14454614691ceef
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: some TeX files are not recognized
Solution: Add more patterns for TeX files and inspect
a few more files for being TeX files
(Wu, Zhenyu)
closes: vim/vim#1445661ee833a50
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: Patch 9.1.0296 causes too many issues
(Tony Mechelynck, chdiza, CI)
Solution: Back out the change for now
Revert "patch 9.1.0296: regexp: engines do not handle case-folding well"
This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes
issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It
needs more work.
fixes: vim/vim#14487c97f4d61cd
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: heredoc start may be recognized in string.
Solution: Don't skip to closing bracket for invalid list assignment.
(zeertzjq)
closes: vim/vim#144721817ccdb10
Problem: Missing test for what patch v9.1.0285 fixes
Solution: Add a test for cursor movement at buffer boundaries.
(Luuk van Baal)
aa8e22b035
vim-patch:9.1.0225: test_matchparen not run in CI
Problem: test_matchparen not run in CI
Solution: add test_matchparen.res to NEW_TESTS_RES in Makefile,
update changed highlighting dump from v9.1.61
059aeac2be
Changes N/A and test result was restored in patch 9.1.0258 (included in #28160).
Problem: Regex engines do not handle case-folding well
Solution: Correctly calculate byte length of characters to skip
When the regexp engine compares two utf-8 codepoints case insensitively
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' so 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
The same 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.
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.
fixes: vim/vim#14294closes: vim/vim#144337a27c108e0
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Vim9: comment may be treated as heredoc start.
(Ernie Rael)
Solution: Use skip_var_list() instead of find_name_end().
(zeertzjq)
fixes: vim/vim#14444closes: vim/vim#144469a91d2b72c
Problem: plines_m_win() does not take into account it's "limit_winheight"
argument for filler lines below the last line of the buffer.
(after v9.1.0280)
Solution: Check window height when "limit_winheight" is TRUE.
(Luuk van Baal)
08b0f632c1
Problem: Wrong doc style for pandoc syntax description,
Test_diff_eob_halfpage() may fail depending on
screen size, using braces in highlight.c when
not necessary
Solution: Fix pandoc documentation, make sure the window
for the test has 7 lines, remove the braces.
a040019be6
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: R history files are not recognized
Solution: Detect '.Rhistory' files as r filetype
(Wu, Zhenyu)
closes: vim/vim#14440fc21b6437c
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: Logic to make sure cursor is in visible part of the screen after
scrolling the text with 'smoothscroll' is scattered, asymmetric
and contains bugs.
Solution: Adjust and create helper function for 'smoothscroll' cursor logic.
(Luuk van Baal)
9148ba8a46
Problem: "zb" does not reveal filler lines at the start of a buffer.
Scrolled cursor position with 'smoothscroll' is unpredictable,
and may reset skipcol later if it is not visible (after v9.1.258)
Solution: Replace confusing for loop that reaches final control value too
early with while loop. Set "w_curswant" accordingly so cursor
will be placed in visible part of topline.
(Luuk van Baal)
bd28cae1f1
Problem: Support for 'smoothscroll' in (half-)page scrolling
broke backward compatibility and can be made to work better.
(after v9.1.215)
Solution: Restore the previous cursor and end-of-buffer behavior for
half-page scrolling and improve 'smoothscroll' support.
(Luuk van Baal)
cb204e688e
Problem: Autocommand may change currect directory after :tcd and :lcd.
Solution: Also clear tp_localdir and w_localdir when using aucmd_win.
(zeertzjq)
closes: vim/vim#144359d956ee8ea
Now that Nvim always supports nanotime, sleeping for some milliseconds
is actually enough, but for test_stat.vim keeping some longer sleeps may
increase test coverage, so just match the upstream test.
Problem: Test for TextChanged is still flaky with ASAN.
Solution: Don't index the result of readfile().
(zeertzjq)
It turns out that with ASAN the file may become empty during a write
even if it's non-empty both before and after the write, in which case
indexing the result of readfile() will error, so use join() instead.
Also don't delete the file halfway the test, just in case it may cause
errors on the next read.
closes: vim/vim#14421e9ff79a7c9
Problem: Two tests in test_filechanged.vim are slow.
Solution: Sleep for shorter if the +nanotime feature is available.
(zeertzjq)
closes: vim/vim#1441883cd2c7bf0
Problem: console dialog cannot save unnamed buffers
Solution: set bufname before save (glepnir). Define dialog_con_gui
to test for GUI+Console dialog support, use it to skip
the test when the GUI feature has been defined.
Note: The dialog_changed() function will also try to call the
browse_save_fname() function, when FEAT_BROWSE is defined (which is only
defined in a GUI build of Vim). This will eventually lead to a call of
do_browse(), which causes an error message if a GUI is not currently
running (see the TODO: in do_browse()) and will then lead to a failure
in Test_goto_buf_with_onfirm().
Therefore, we must disable the Test_goto_buf_with_onfirm(), when the
dialog_con_gui feature is enabled (which basically means dialog feature
for GUI and Console builds, in contrast to the dialog_con and dialog_gui
feature).
(Previously this wasn't a problem, because the test aborted in the YES
case for the :confirm :b XgotoConf case and did therefore not run into
the browse function call)
closes: vim/vim#14398df46115fc8
Co-authored-by: glepnir <glephunter@gmail.com>
Ref #21393
- Move default user commands to _defaults.lua as that now contains all
kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
Problem: Dialog for file changed outside of Vim not tested.
Solution: Add a test. Move FileChangedShell test. Add 'L' flag to
feedkeys().
5e66b42aae
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Normal mode TextChanged isn't tested properly.
Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2()
and also run it on Windows. Fix a typo in main.c.
(zeertzjq)
closes: vim/vim#14396c422662933
Problem: filetype: typespec files are not recognized
Solution: Detect '*.tsp' files as typespec
(Hilmar Wiegand)
Specs is at https://typespec.io/closes: vim/vim#143926c9f4f98f1
Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
Problem: [security]: Heap buffer overflow when calling complete_add()
in the first call of 'completefunc'
Solution: Call check_cursor() after calling 'completefunc' (zeertzjq)
closes: vim/vim#143910a419e07a7
Problem: Filetype test fails.
Solution: Move detection by name before detection by extension.
Improve TextChanged test and remove wrong test and fix
a typo in a comment (zeertzjq).
closes: vim/vim#143738eb7523802
The changes to filetype.vim are N/A since Nvim always prefers filename
matches to extension matches.
Problem: Filetype detection fails if file name ends in many '~'.
Solution: Strip multiple '~' at the same time. (closesvim/vim#12553)
c12e4eecbb
In Nvim this already works as Lua filetype detection isn't subject to
such a small recursion limit as autocommands, but it still makes sense
to avoid unnecessary recursion.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: filetype: rock_manifest and config.ld files are not recognized
Solution: Detect 'rock_manifest' and 'config.ld' as lua
(Wu, Zhenyu)
closes: vim/vim#14370a917bd58bd
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: fontconfig files are not recognized
Solution: detect 'fonts.conf' as xml
(Wu, Zhenyu)
closes: vim/vim#14367a2c27b01dc
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: zsh theme, history and zunit files are not
recognized.
Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh
(Wu, Zhenyu)
closes: vim/vim#14366a55a22a1a3
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: bash history files are not recognized
Solution: detect .bash-history and .bash_history files as bash
(Wu, Zhenyu)
closes: vim/vim#1436584ce55001a
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: netrw history file is not recognized
Solution: Detect .netrwhist as vim files (Wu, Zhenyu)
closes: vim/vim#14364abbb4a4f70
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: mysql history files are not recognized
Solution: Detect .mysql_history as mysql
(Wu, Zhenyu)
closes: vim/vim#143626b285c8cfd
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
so add a pattern for supertux files.
(Wu, Zhenyu)
Reference: https://github.com/SuperTux/supertux/wiki/S-Expressioncloses: vim/vim#143564ff83b904e
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: support for Intel HEX files is lacking
Solution: Add more file extensions that are typical for Intel HEX files
(Wu, Zhenyu)
Reference: https://en.wikipedia.org/wiki/Intel_HEXcloses: vim/vim#14355e523dd9803
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: Conceal test fails when rightleft feature is disabled.
Solution: Skip test if rightleft feature is missing (Julio B).
closes: vim/vim#143425df961a1bc
Co-authored-by: Julio B <julio.bacel@gmail.com>
Problem: Filetype may be undetected when a SwapExists autocommand sets
filetype in another buffer.
Solution: Make filetype detection state buffer-specific. Also fix a
similar problem for 'modified' (zeertzjq).
closes: vim/vim#143445bf6c2117f
Problem: TextChanged autocommand not triggered under some circumstances
(Sergey Vlasov)
Solution: Trigger TextChanged when TextChangedI has not been triggered
fixes: vim/vim#14332closes: vim/vim#143398603270293
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: Recording may still be wrong in Select mode (after 8.2.3993).
Solution: Make sure a character isn't split between two buffer blocks.
(zeertzjq)
closes: vim/vim#14326ea95f1a5ad
Problem: Two unrelated things are tested by a single test.
Solution: Split it into two, restoring the old Test_brace_single_line().
Add missing cleanup to some tests.
(zeertzjq)
closes: vim/vim#14323ad493ef3ea
Problem: Page-wise scrolling with Ctrl-D/Ctrl-U implements
it's own logic to change the topline and cursor.
More logic than necessary for scrolling with Ctrl-F/Ctrl-B
was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
staying backward compatible as much as possible.
Restore some of the logic that determined how many lines will
be scrolled (Luuk van Baal)
5a2e3ec9ac
Problem: Unnecessary multiplications in backspace code, as
"col / ts * ts" is the same as "col - col % ts".
Solution: Change "col / ts * ts" to "col - col % ts". Adjust the loop
and the comments ins_bs() to be easier to understand. Update
tests to reset 'smarttab' properly.
(zeertzjq)
closes: vim/vim#143088ede7a0694
Problem: regexp: verymagic cannot match before/after a mark
Solution: Correctly check for the very magic check (Julio B)
Fix regexp parser for \v%>'m and \v%<'m
Currently \v%'m works fine, but it is unable to match before or after
the position of mark m.
closes: vim/vim#1430946fa3c7e27
Co-authored-by: Julio B <julio.bacel@gmail.com>
Problem: CI: MS-Windows fails in test_winfixbuf
(after v9.1.208)
Solution: Instead of skipping the test, write the file
so it exists on disk, to verify that MS-Windows
short filename expansion is successful.
(Sean Dewar)
related: vim/vim#14286aed6554b46
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Problem: Error on exit with EXITFREE and 'winfixbuf'.
Solution: Handle DT_FREE before checking for 'winfixbuf'.
(zeertzjq)
closes: vim/vim#14314620e85265c
Problem: Page-wise scrolling with Ctrl-F/Ctrl-B implements
it's own logic to change the topline and cursor.
In doing so, skipcol is not handled properly for
'smoothscroll', and virtual lines.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying
backward compatible as much as possible.
b9f5b95b7b
Problem: filetype: support for gnuplot files is lacking
Solution: Also detect *.gnuplot files
(RobbiZ98)
closes: vim/vim#142433a6bd0c5c7
Co-authored-by: RobbiZ98 <113035863+RobbiZ98@users.noreply.github.com>