Commit Graph

22174 Commits

Author SHA1 Message Date
zeertzjq
53392f48b1 vim-patch:8.2.0203: :helptags and some other functionality not tested
Problem:    :helptags and some other functionality not tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5567)
e20b9ececa
2022-07-12 11:52:47 +08:00
zeertzjq
189db2b759 fix(cmdline): fix passing -1 as char 2022-07-12 11:49:32 +08:00
Nicolas Hillegeer
034d28c705
fix(lsp): don't attach a client in lsp.start() if there is none (#19328)
vim.lsp.start_client() may fail (for example if the `cmd` is not
executable). It produces a nice error notification in this case. Passing
the `nil` value returned from an erroneous `vim.lsp.start_client()` call
into `vim.lsp.buf_attach_client()` causes a meaty param validate
exception message. Avoid this.
2022-07-11 19:37:01 -06:00
zeertzjq
195d8496a0
Merge pull request #19277 from zeertzjq/vim-8.1.1855
vim-patch:8.1.{1855,1859,1864,1867}: flaky timer tests
2022-07-12 07:21:04 +08:00
zeertzjq
cea96ca39d test(old): test_timers.vim call timer_stopall() in SetUp() instead 2022-07-12 06:58:13 +08:00
zeertzjq
d8f6426714 vim-patch:8.1.1867: still a timer test that is flaky on Mac
Problem:    Still a timer test that is flaky on Mac.
Solution:   Loop with a sleep instead of one fixed sleep.
315244d85b
2022-07-12 06:45:19 +08:00
zeertzjq
5119d10d41 vim-patch:8.1.1864: still a timer test that is flaky on Mac
Problem:    Still a timer test that is flaky on Mac.
Solution:   Adjust the sleep times.
413c04e8d5
2022-07-12 06:45:19 +08:00
zeertzjq
061e573e7e vim-patch:8.1.1859: timer test sometimes fails on Mac
Problem:    Timer test sometimes fails on Mac.
Solution:   Show more info when it fails.
427dddf014
2022-07-12 06:45:19 +08:00
zeertzjq
9bea841925 vim-patch:8.1.1855: another failing timer test
Problem:    Another failing timer test.
Solution:   Assert that timers are finished by the end of the test.  Rename
            test functions to make them easier to find.
9a2fddcf04

Use test_garbagecollect_now() in Test_timer_retain_partial() like Vim.
2022-07-12 06:45:19 +08:00
zeertzjq
daa49b525e
Merge pull request #19320 from zeertzjq/vim-8.2.0212
vim-patch:8.2.{0212,0243,0250}: insufficient tests
2022-07-12 06:24:29 +08:00
zeertzjq
27fd17a79c vim-patch:8.2.0243: insufficient code coverage for ex_docmd.c functions
Problem:    Insufficient code coverage for ex_docmd.c functions.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5618)
9f6277bdde

Cherry-pick Test_window_only() from patch 8.2.0203.
Cherry-pick a memory leak fix from patch 8.2.0399.
2022-07-12 05:36:33 +08:00
zeertzjq
eea6a4f2a0 vim-patch:8.2.{0212,0250}
vim-patch:8.2.0212: missing search/substitute pattern hardly tested

Problem:    Missing search/substitute pattern hardly tested.
Solution:   Add test_clear_search_pat() and tests. (Yegappan Lakshmanan,
            closes vim/vim#5579)
07ada5ff2f

vim-patch:8.2.0250: test_clear_search_pat() is unused

Problem:    test_clear_search_pat() is unused.
Solution:   Remove the function. (Yegappan Lakshmanan, closes vim/vim#5624)
4f5776c17c
2022-07-12 05:36:33 +08:00
zeertzjq
e71cc4a8dc test(old): align defaults to Vim before each test instead 2022-07-12 05:36:33 +08:00
zeertzjq
5c3bbb67e7
vim-patch:8.2.3363: when :edit reuses the current buffer the alternate file is set (#19306)
Problem:    When :edit reuses the current buffer the alternate file is set to
            the same buffer.
Solution:   Only set the alternate file when not reusing the buffer.
            (closes vim/vim#8783)
b8bd2e6eba

Cherry-pick Test_cmdline_expand_special() from patches 8.2.{0243,2873}.
Move Test_cmd_backtick() to the right place.
2022-07-11 20:55:26 +08:00
Rishikesh Vaishnav
ac10c0f418
fix(lsp): abort pending changes after flush when debouncing (#19314)
Issuing a server request triggers `changetracking.flush` so as to
make sure we're not operating on a stale state. This immediately
triggers notification of any pending changes (as a result of debouncing)
to the server. However, this happens in addition to the notification
that is waiting on the debounce delay. Because we `nil`
`buf_state.pending_change` when it is called, the fix is to
also check that this is non-`nil` when it is called and exit if it is,
as this being `nil` would mean that it originates from a pending change
that has already been flushed out.
2022-07-11 12:48:02 +02:00
Mathias Fußenegger
95c65a6b22
feat(lsp): defaults: tagfunc, omnifunc (#19003)
set `tagfunc` to `vim.lsp.tagfunc` and `omnifunc` to `vim.lsp.omnifunc` if empty when attaching a server
2022-07-10 17:26:43 +02:00
zeertzjq
67b26a39f0
Merge pull request #19305 from zeertzjq/vim-8.2.3530
vim-patch:8.2.{3530,3531}: ":buf \{a}" fails while ":edit \{a}" works
2022-07-10 20:20:06 +08:00
zeertzjq
5e53740350
Merge pull request #18774 from zeertzjq/float-height-width-fix
Fix some floating window height and width bugs
2022-07-10 17:59:32 +08:00
zeertzjq
5105f713bd test(float_spec): make indent more consistent 2022-07-10 17:24:29 +08:00
zeertzjq
63f6ecd419 fix(float): fix mouse drag position if float window turned to a split 2022-07-10 17:24:29 +08:00
zeertzjq
63f63dd2b7 fix(float): fix glitch when making float window with border a split 2022-07-10 17:24:29 +08:00
zeertzjq
99e8298711 fix(float): fix float window with winbar cannot have screen height 2022-07-10 17:24:29 +08:00
zeertzjq
f7d6f472f7 fix(float): fix float window border drawing with winbar 2022-07-10 17:24:29 +08:00
Christian Clason
2966cfe21f
fix(lsp): pcall nvim_del_augroup_by_name (#19302)
fixup for #19283
2022-07-10 11:19:26 +02:00
zeertzjq
3d77ea2762
Merge pull request #19307 from zeertzjq/vim-8.2.1053
vim-patch:7.4.1724,8.2.1053: insufficient testing for 'statusline' and 'tabline'
2022-07-10 17:13:17 +08:00
zeertzjq
fe2b281292 vim-patch:8.2.1053: insufficient testing for 'statusline' and 'tabline'
Problem:    Insufficient testing for 'statusline' and 'tabline'.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#6333)
832adf9bb8
2022-07-10 16:15:17 +08:00
zeertzjq
59355653f6 vim-patch:7.4.1724
Problem:    Tabline test fails in GUI.
Solution:   Remove 'e' from 'guioptions'.
73cd8fb3e8

Add missing file header.
2022-07-10 16:12:58 +08:00
tomial
8f36e538cc
fix(l10n): add folded line indicator translations from vim (#19286) 2022-07-10 12:36:43 +08:00
zeertzjq
b3b85186ed vim-patch:8.2.3531: command line completion test fails on MS-Windows
Problem:    Command line completion test fails on MS-Windows.
Solution:   Do not test with "\{" on MS-Windows.
39c47c3104
2022-07-10 10:58:12 +08:00
zeertzjq
45d2644205 vim-patch:8.2.3530: ":buf \{a}" fails while ":edit \{a}" works
Problem:    ":buf \{a}" fails while ":edit \{a}" works.
Solution:   Unescape "\{". (closes vim/vim#8917)
21c1a0c2f1
2022-07-10 10:56:37 +08:00
Christian Clason
d606c39a9c
vim-patch:9.0.0049: csv and tsv files are not recognized (#19300)
Problem:    Csv and tsv files are not recognized.
Solution:   Add patterns fo csv and tsv files. (Leandro Lourenci,
            closes vim/vim#10680)
99af91e582
2022-07-10 01:14:07 +02:00
Justin M. Keyes
eb9155e557
Merge #19267 require() in --startuptime 2022-07-10 01:04:11 +02:00
zeertzjq
880de9a489
test(old): align defaults to Vim after every test (#19301)
This can avoid divergences from Vim in some small places.
2022-07-10 06:59:58 +08:00
Justin M. Keyes
797007997c test: --startuptime 2022-07-09 15:45:02 -07:00
zeertzjq
d6a1e71881
vim-patch:8.1.1038: Arabic support excludes Farsi (#19285)
Problem:    Arabic support excludes Farsi.
Solution:   Add Farsi support to the Arabic support. (Ali Gholami Rudi,
            Ameretat Reith)
dc4fa190e7

Omit Test_shape_final_to_medial(): removed in later patches.
2022-07-10 06:01:49 +08:00
ii14
2c739431e8 feat(lua): measure require in --startuptime 2022-07-09 22:12:06 +02:00
Gregory Anders
782f726136
refactor: remove functions marked for deprecation in 0.8 (#19299) 2022-07-09 18:42:49 +02:00
Raphael
6b1a8f23d7
refactor(lua): replace vim.cmd use with API calls (#19283)
Signed-off-by: Raphael <glephunter@gmail.com>
2022-07-09 18:40:32 +02:00
zeertzjq
7dbe6b1a46
Merge pull request #19296 from zeertzjq/vim-8.2.2902
vim-patch:8.2.{2902,2917}: spellfile functionality not fully tested
2022-07-09 20:59:49 +08:00
zeertzjq
7b72e61cf8 vim-patch:8.2.2917: spellfile functionality not fully tested
Problem:    Spellfile functionality not fully tested.
Solution:   Add tests for SFX with removal of characters, spelling
            suggestions with NOBREAK and others. (Dominique Pellé,
            closes vim/vim#8293)
bb162367ac
2022-07-09 20:33:00 +08:00
zeertzjq
eb60a9be97 vim-patch:8.2.2902: spellfile functionality not fully tested
Problem:    Spellfile functionality not fully tested.
Solution:   Add tests for CIRCUMFIX, NOBREAK and others. (Dominique Pellé,
            closes vim/vim#8283)
5a6cfb3ff2

Reorder test_spellfile.vim to match upstream.
2022-07-09 20:33:00 +08:00
zeertzjq
022e994ab8
Merge pull request #19294 from zeertzjq/vim-8.2.0332
vim-patch:8.2.{0332,0396}: insufficient tests for cmdline
2022-07-09 18:34:48 +08:00
zeertzjq
65359e5657 vim-patch:8.2.0396: cmdexpand.c insufficiently tested
Problem:    Cmdexpand.c insufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes vim/vim#5789)
24ebd83e03

Map Q to gQ before every test since a test uses :mapclear.
2022-07-09 17:33:49 +08:00
zeertzjq
12f0ef669d vim-patch:8.2.0332: some code in ex_getln.c not covered by tests
Problem:    Some code in ex_getln.c not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#5710)
d30ae2fc4a
2022-07-09 16:31:19 +08:00
zeertzjq
798acbca1b
Merge pull request #19284 from zeertzjq/vim-8.2.0274
vim-patch:8.2.{0274,0325}
2022-07-09 16:25:16 +08:00
zeertzjq
cf4aa6095f vim-patch:8.2.0325: ex_getln.c code not covered by tests
Problem:    Ex_getln.c code not covered by tests.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes vim/vim#5702)
578fe947e3

Cherry-pick Test_Ex_global() from patch 8.2.0293.
Test_rightleftcmd() fails if incsearch is enabled, so disable it.
2022-07-08 23:11:12 +08:00
zeertzjq
0d0a6aff6b vim-patch:8.2.0274: hang with combination of feedkeys(), Ex mode and :global
Problem:    Hang with combination of feedkeys(), Ex mode and :global.
            (Yegappan Lakshmanan)
Solution:   Add the pending_exmode_active flag.
9e2bcb5d23
2022-07-08 23:11:12 +08:00
Nicolas Hillegeer
45ba2e147f
fix(tui): add fixups for hterm family #19078
Problem
-------

In #19040, I reported two things that started happening somewhen in the
last three months when using neovim in hterm (the Chrome Secure Shell
terminal):

 1. Under certain circumstances, the window title (set by nvim
    [i0]) would appear over the line I was typing, corrupting the screen.
 2. If I changed my $TERM from xterm-256color to the new hterm-256color
    (available since ncurses >=20210320), the window title corruption
    was gone, but pane scrolling was broken.

Both problems are due to changes in the termcap files, their source of
truth being the ncurses project. See "Timeline of ncurses changes" below
for details.

Cause: title corruption
-----------------------

The title corruption when using hterm + TERM=xterm-256color can be
explained by event #4 (ncurses 2022-03-12) in the ncurses timeline:

The xterm-256color termcap file gained status line termcodes in ncurses
2022-03-12. These termcodes are used by Neovim to set the title when.
hterm does not have a status line. Due to ncurses versions earlier than
2022-03-12 missing the xterm status line capability, Neovim manually
fixed up [t0] the terminfo file if $TERM was xterm-256color. So if
before Neovim manually added fsl/tsl capabilties, and after they were
in the termcap file, why did hterm suddenly start getting corruption?
The answer is that the termcodes for these capabilties are different
when Neovim fixes them up, versus the one in the new termcap database:

   fsl=\E[0$}                  // from xterm-256color
   tsl=\E[2$~\E[1$}\E[%i%p1%d` // from xterm-256color

   fsl=\x07                    // patched by Neovim
   tsl=\x1b]0;                 // patched by Neovim

hterm ignores the latter, but corrupts the screen with the former.

Solution: Make hterm users set hterm-256color, which lacks the new
fsl/tsl codes. Also, to reduce superfluous work, stop patching in this
capability when hterm is detected (even if hterm would ignore the
patched version).

Cause: pane corruption
----------------------

The pane corruption when using hterm + TERM=hterm-256color, but NOT when
using hterm + TERM=xterm-256color can be explained by:

 - Neovim uses DECSLRM when available [p1] for performant scrolling.
 - Both the hterm-256color and xterm-256color termcap databases
   advertise support for DECSLRM (ncurses timeline #1, #2 and #3).
 - hterm does not support DESCLRM [p2] (note: it does support DESCTBM for
   top/bottom scrolling, but it's broken [p3] and not used by Neovim)
 - xterm-alikes that are not real xterm generally don't support DECSLRM
   either, so Neovim patches it out [p4].

When using hterm-256color, hterm is no longer considered an xterm-alike
by Neovim. As a result, DECSLRM is not cleared. hterm does not support
it, so corruption ensues.

This is a problem with the hterm-256color termcap file, but we're stuck
with it so the best we can do is patch over it.

Timeline of ncurses changes
---------------------------

 1. 2019-05-19: Part of the DECSLRM capability (smglr AKA set_lr_margin)
    added to vt420+lrmm, which xterm-256color inherits [n1]
 2. 2021-03-20: hterm-256color added, inheriting xterm-256colors. [n2]
 3. 2021-09-25: The *parm versions of smglr (AKA set_lr_margin) were
    added to vt420+lrmm [n3]. Namely:
     1. smglp AKA set_left_margin_parm, and
     2. smgrp AKA set_right_margin_parm
 4. 2022-03-12: (new) codes for fsl, bsl and tsl added to xterm (add
    dec+sl to xterm-new, per patch #371 -TD) [n4]

Fixes #19040.

[i0]: 3a4fa22bad/src/nvim/tui/tui.c (L1377)
[t0]: 3a4fa22bad/src/nvim/tui/tui.c (L1728),L1729
[p1]: 3a4fa22bad/src/nvim/tui/tui.c (L1196)
[p2]: https://bugs.chromium.org/p/chromium/issues/detail?id=1175065&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p3]: https://bugs.chromium.org/p/chromium/issues/detail?id=1298796&q=component%3APlatform%3EApps%3EDefault%3EHterm
[p4]: 3a4fa22bad/src/nvim/tui/tui.c (L1740-L1752)
[n1]: https://github.com/mirror/ncurses/commit/8f6d94b8d6211a2323caef53fa4c96c475ec9a6#diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2742
[n2]: c2650100f8 (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R5907)
[n3]: f6b436c4fb (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R2842)
[n4]: 8bf8c836fe (diff-01544c577762d3308a1d232aa7afc79acf64b9a5057f88a004df82fda89549b7R4828)

Signed-off-by: Nicolas Hillegeer <nicolas@hillegeer.com>
2022-07-08 06:06:27 -07:00
zeertzjq
b999de2eb0
Merge pull request #19278 from zeertzjq/vim-8.2.0132
vim-patch:8.2.{0132,0136,0151}: detecting a script was already sourced is unreliable
2022-07-08 20:12:58 +08:00
zeertzjq
a6803f3adf test: add a test for what Vim patch 8.2.0151 fixes 2022-07-08 14:18:16 +08:00