Commit Graph

418 Commits

Author SHA1 Message Date
zeertzjq
50b069a8b9 vim-patch:9.0.0380: deleting files in tests is a hassle
Problem:    Deleting files in tests is a hassle.
Solution:   Use the new 'D' flag of writefile().

e1f3ab73bc

vim-patch:e1f3ab73bc7c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-22 18:56:43 +08:00
Gregory Anders
d0717a7c4e
vim-patch:9.0.0423: "for" and "while" not recognized after :vim9cmd and :legacy (#24825)
Problem:    "for" and "while" not recognized after :vim9cmd and :legacy.
            (Emanuele Torre)
Solution:   Recognize all the command modifiers. (closes vim/vim#11087)
            Add a test to check the list of modifiers.

9132426334

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 09:06:21 -05:00
zeertzjq
28c2e83fb4 vim-patch:9.0.0313: using common name in tests leads to flaky tests
Problem:    Using common name in tests leads to flaky tests.
Solution:   Rename files and directories to be more specific.

e7cda97b6b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:31:31 +08:00
zeertzjq
00ad0c81b6 vim-patch:9.0.0077: wrong restored cursor position when switching window in autocmd
Problem:    When switching window in autocmd the restored cursor position may
            be wrong.
Solution:   Do not restore the cursor if it was not set. (closes vim/vim#10775)

b03950fafa

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:25:48 +08:00
zeertzjq
bd9a9e63bc vim-patch:8.2.4212: window title test still fails in some configurations
Problem:    Window title test still fails in some configurations.
Solution:   Explicitly set the 'title' option.

1450112eef

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:17:01 +08:00
zeertzjq
67edc0a772 vim-patch:8.2.4211: window title test still fails in some configurations
Problem:    Window title test still fails in some configurations.
Solution:   Use WaitForAssert().

3a8ad5918b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:53 +08:00
zeertzjq
7fab06cb0c vim-patch:8.2.4210: window title test fails in some configurations
Problem:    Window title test fails in some configurations.
Solution:   Only run the test if the title can be obtained.

a6c09a7c20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:43 +08:00
zeertzjq
893437512c vim-patch:8.2.4208: using setbufvar() may change the window title
Problem:    Using setbufvar() may change the window title.
Solution:   Do not redraw when creating the autocommand window. (closes vim/vim#9613)

dff97e65eb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 16:16:22 +08:00
zeertzjq
02ca31979b vim-patch:8.2.4339: CTRL-A does not work properly with the cmdline popup menu
Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-21 15:43:39 +08:00
zeertzjq
00f92f086e vim-patch:8.2.3518: Test_xrestore sometimes fails
Problem:    Test_xrestore sometimes fails.
Solution:   Mark the test as flayky.  Move marking test as flaky to the test
            instead of listing them in runtest.

f08b0eb869

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:35:08 +08:00
zeertzjq
7aa3f825cd vim-patch:8.2.2910: test for cmdline window and terminal fails on MS-Windows
Problem:    Test for cmdline window and terminal fails on MS-Windows.
Solution:   Skip the test on MS-Windows.

0b49648486

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
d4b6a25e67 vim-patch:8.2.2908: crash when using a terminal popup window from cmdline window
Problem:    Crash when using a terminal popup window from the cmdline window.
Solution:   Instead of checking cmdwin_type call cmdwin_is_active().
            (closes vim/vim#8286)

e5b4486c42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
ff801ce7f7 vim-patch:8.2.0533: tests using term_wait() can still be flaky
Problem:    Tests using term_wait() can still be flaky.
Solution:   Increase the wait time when rerunning a test. (James McCoy,
            closes vim/vim#5899)  Halve the initial times to make tests run faster
            when there is no rerun.

6a2c5a7dd5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
ff37916b47 vim-patch:8.2.0454: some tests fail when the system is slow
Problem:    Some tests fail when the system is slow.
Solution:   Make the run number global, use in the test to increase the
            waiting time. (closes vim/vim#5841)

3ed9efc2b1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
045cc185d5 vim-patch:8.2.0310: autocmd test fails on a slow system
Problem:    Autocmd test fails on a slow system.
Solution:   Adjust the expectations. (James McCoy, closes vim/vim#5685)

8fb1b47a5e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
702a5f0cbb vim-patch:8.2.0195: some tests fail when run in the GUI
Problem:    Some tests fail when run in the GUI.
Solution:   Make sure the window width is enough.  In the GUI run terminal Vim
            in the terminal, if possible.

3180fe6c6d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
e8df2a012b vim-patch:8.2.0186: a couple of tests may fail when features are missing
Problem:    A couple of tests may fail when features are missing.
Solution:   Check for features. (Dominique Pelle, closes vim/vim#5561)

705724e430

Just copy the two 'wincolor' test functions from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
6f5ff5818a vim-patch:8.1.2403: autocmd test fails under valgrind
Problem:    Autocmd test fails under valgrind.
Solution:   Wait a bit longer.

3c47e8384d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 15:31:21 +08:00
zeertzjq
71acb71043 vim-patch:8.1.2099: state() test fails on some Mac systems
Problem:    state() test fails on some Mac systems.
Solution:   Increase the wait time. (closes vim/vim#4983)

b7a97ef340

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
e05031097c vim-patch:8.1.2069: test for SafeStateAgain may still fail
Problem:    Test for SafeStateAgain may still fail.
Solution:   Send another message to trigger SafeStateAgain.

0f6629a08a

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
0defbd38e4 vim-patch:8.1.2068: test for SafeState and SafeStateAgain may fail
Problem:    Test for SafeState and SafeStateAgain may fail.
Solution:   Accept more possible responses

513537bfff

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
3e79afec54 vim-patch:8.1.2067: no tests for SafeState and SafeStateAgain
Problem:    No tests for SafeState and SafeStateAgain.
Solution:   Add tests.

cadbe1b1fb

This test is quite useless. Don't port to Lua.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
zeertzjq
6bf5b2428b vim-patch:8.1.2066: no tests for state()
Problem:    No tests for state().
Solution:   Add tests.  Clean up some feature checks.  Make "a" flag work.

c258549032

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-21 14:16:16 +08:00
Christian Clason
eaad2f7806 vim-patch:9.0.1768: Runtime: no support for bicep files
Problem:  Runtime: no support for bicep files
Solution: Add filetype support for bicepparam

closes: vim/vim#12784

2d0988ef93

Co-authored-by: Scott McKendry <scott.c.mckendry@gmail.com>
2023-08-21 10:13:44 +09:00
Christian Clason
a5b6468e9b vim-patch:9.0.1766: Runtime: Missing QML support
Problem:  Runtime: Missing QML support
Solution: Add QML support to Vim

closes: vim/vim#12810

bedc69f9d6

Co-authored-by: ChaseKnowlden <haroldknowlden@gmail.com>
2023-08-21 10:13:44 +09:00
zeertzjq
a2a226170d
vim-patch:9.0.1772: Cursor may be adjusted in 'splitkeep'ed windows (#24811)
Problem:    Cursor is adjusted in window that did not change in size by
            'splitkeep'.
Solution:   Only check that cursor position is valid in a window that
            has changed in size.

closes: vim/vim#12509

16af913eee

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2023-08-21 08:58:18 +08:00
zeertzjq
694814cdd5
vim-patch:9.0.1774: no support for custom cmdline completion (#24808)
Problem:  no support for custom cmdline completion
Solution: Add new vimscript functions

Add the following two functions:
- getcmdcompltype() returns custom and customlist functions

- getcompletion() supports both custom and customlist

closes: vim/vim#12228

92997dda78

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2023-08-21 07:29:49 +08:00
zeertzjq
ac99e63d73
vim-patch:9.0.1763: crash when passing invalid buffer to undotree() (#24807)
Problem:  crash when passing invalid buffer to undotree()
Solution: Use get_buf_arg() instead of tv_get_buf_from_arg().

closes: vim/vim#12862
closes: vim/vim#12830

ab9f2ecfd4
2023-08-21 07:20:26 +08:00
zeertzjq
d21e6285e9
vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line (#24806)
Problem:  Visual highlight not working with cursor at end of screen line
          and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.

closes: vim/vim#12865

8fc6a1dae0
2023-08-21 07:18:39 +08:00
zeertzjq
0c91cb4f03 vim-patch:9.0.1761: g<kEnd> behaves different from g<end>
Problem:  g<kEnd> behaves different from g<end>
Solution: Make g<kEnd> behave like g<End>

closes: vim/vim#12861

654bdbbd32
2023-08-21 06:12:03 +08:00
zeertzjq
7485fd0518 vim-patch:9.0.1753: can't move to last non-blank char
Problem: can't move to last non-blank char
Solution: Make g<end> behave like that

Make it possible to move to last non-blank char on a line

We can distinguish between g0 and g^ to move to the very first character
and the first non-blank char.

And while we can move to the last screen char, we cannot go to the last
non-blank screen char.

Since I think g$ is the more widely used and known movement command (and
g<end> is synonymous to it) change the behaviour of g<end> to move to
last non-screen char instead and don't have this be the same command as
the g$ command anymore.

If you want to keep the old behaviour, you can use:

```
nnoremap g<end> g$
```

Add a test to verify the behaviour.

closes: vim/vim#12593

b5f6fe9ca2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-21 06:11:16 +08:00
zeertzjq
421713523e
vim-patch:9.0.1745: Missing test coverage for blockwise Visual highlight (#24790)
Problem:  Missing test coverage for blockwise Visual highlight with
          virtual that starts with a double-width char.
Solution: Add a new virtual text to the test. Some other small fixes.

closes: vim/vim#12835

fc3058495d
2023-08-19 20:34:58 +08:00
zeertzjq
c8e58bf09c
vim-patch:9.0.1742: wrong curswant when clicking on second cell of double-width char (#24789)
Problem:  Wrong curswant when clicking and the second cell of a
          double-width char.
Solution: Don't copy virtcol of the first char to the second one.

closes: vim/vim#12842

9994160bfe
2023-08-19 19:40:26 +08:00
zeertzjq
fcd729f22c vim-patch:9.0.1540: reverse() on string doesn't work in compiled function
Problem:    reverse() on string doesn't work in compiled function.
Solution:   Accept string in argument type check. (Yegappan Lakshmanan,
            closes vim/vim#12377)

f9dc278946

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjq
4c7df98e4e vim-patch:9.0.1515: reverse() does not work for a String
Problem:    reverse() does not work for a String.
Solution:   Implement reverse() for a String. (Yegappan Lakshmanan,
            closes vim/vim#12179)

03ff1c2dde

vim-patch:9.0.1738: Duplicate code to reverse a string

Problem:  Duplicate code to reverse a string
Solution: Move reverse_text() to strings.c and remove string_reverse().

closes: vim/vim#12847

4dd266cb66

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjq
551998b7ee vim-patch:9.0.1725: cursor pos wrong after concealed text with 'virtualedit'
Problem:    Wrong cursor position when clicking after concealed text
            with 'virtualedit'.
Solution:   Store virtual columns in ScreenCols[] instead of text
            columns, and always use coladvance() when clicking.

This also fixes incorrect curswant when clicking on a TAB, so now
Test_normal_click_on_ctrl_char() asserts the same results as the ones
before patch 9.0.0048.

closes: vim/vim#12808

e500ae8e29

Remove the mouse_adjust_click() function.

There is a difference in behavior with the old mouse_adjust_click()
approach: when clicking on the character immediately after concealed
text that is completely hidden, cursor is put on the clicked character
rather than at the start of the concealed text. The new behavior is
better, but it causes unnecessary scrolling in a functional test (which
is an existing issue unrelated to these patches), so adjust the test.

Now fully merged:
vim-patch:9.0.0177: cursor position wrong with 'virtualedit' and mouse click
2023-08-18 19:34:16 +08:00
zeertzjq
b0dda500e9 vim-patch:9.0.1705: cursor position wrong when clicking on an unprintable char
Problem:  cursor position wrong when clicking on an unprintable char
Solution: Don't update prev_ptr when wlv.n_extra is not zero.

closes: vim/vim#12664

b25dbb3f9b

Tests only. Code superseded by patch 9.0.1725.
2023-08-18 19:34:16 +08:00
zeertzjq
5ff725fa94 vim-patch:9.0.0048: cursor in wrong column with mouse click after concealed text
Problem:    Cursor in wrong column with mouse click after concealed text.
Solution:   Store the text column when drawing text.

b90818867c

Tests only. Code changes moved to the port of patch 9.0.1725.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-18 19:34:07 +08:00
zeertzjq
c54682f75a
vim-patch:9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=n (#24773)
Problem:    screenpos() wrong result with w_skipcol and cpoptions+=n
Solution:   Use adjust_plines_for_skipcol() instead of subtracting
            w_skipcol.

closes: vim/vim#12625

bfe377b8f2
2023-08-18 09:01:50 +08:00
zeertzjq
f8afa8023e
vim-patch:9.0.1728: missing winid argument for virtcol() (#24770)
Problem: missing winid argument for virtcol()
Solution: Add a {winid} argument to virtcol()

Other functions col(), charcol() and virtcol2col() support a {winid}
argument, so it makes sense for virtcol() to also support than.

Also add test for virtcol2col() with 'showbreak' and {winid}.

closes: vim/vim#12633

825cf813fa
2023-08-18 08:42:45 +08:00
zeertzjq
46163ddf5d
vim-patch:9.0.1730: passing multiple patterns to runtime not working (#24771)
Problem: passing multiple patterns to runtime not working
Solution: prepend prefix to each argument separately

closes: vim/vim#12617

008c91537b
2023-08-18 08:24:49 +08:00
zeertzjq
19d7fb8efe
vim-patch:9.0.1734: :runtime completion fails for multiple args (#24767)
Problem: :runtime completion fails for multiple args
Solution: Make it work

closes: vim/vim#12616

be5cdd1d63
2023-08-18 06:20:06 +08:00
Sean Dewar
9f7e7455c0
vim-patch:9.0.1726: incorrect heights in win_size_restore() (#24765)
Problem: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()

876f5fb570

I already merged this prior, so just replace the new test with the old one,
but add a test case for the global statusline.
2023-08-17 23:16:19 +01:00
zeertzjq
bb29ef4008 vim-patch:9.0.1723: Fix regression in {func} argument of reduce()
Problem: Fix regression in {func} argument of reduce()
Solution: pass function name as string again

Before patch 9.0.0548, passing a string as {func} argument of reduce()
is treated as a function name, but after patch 9.0.0548 it is treated as
an expression instead, which is useless as reduce() doesn't set any v:
variables. This PR restores the behavior of {func} before that patch.

Also correct an emsg() call, as e_string_list_or_blob_required doesn't
contain format specifiers.

closes: vim/vim#12824

ad0c442f1f
2023-08-18 05:29:05 +08:00
zeertzjq
ffb87f4dd9 vim-patch:9.0.1722: wrong error messages when passing wrong types to count()
Problem: wrong error messages when passing wrong types to count()
Solution: fix it

This fixes two problems:
1. When passing wrong type to {ic} argument of count(), two error
   messages are given, the second of which is misleading.
2. When passing wrong type to {comp} argument of count(), the error
   message doesn't mention that {comp} may be a String.

closes: vim/vim#12825

4f389e7c0f
2023-08-18 05:28:42 +08:00
zeertzjq
8ac9abd4fa vim-patch:9.0.1416: crash when collection is modified when using filter()
Problem:    Crash when collection is modified when using filter().
Solution:   Lock the list/dict/blob. (Ernie Rael, closes vim/vim#12183)

e6d40dcdc7

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-08-17 17:03:10 +08:00
zeertzjq
1ed12a2e10 vim-patch:9.0.0548: reduce() with a compiled lambda could be faster
Problem:    reduce() with a compiled lambda could be faster.
Solution:   Call eval_expr_typval() instead of call_func() directly.

f1c60d4bf1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:44:55 +08:00
zeertzjq
1918e1ea6d vim-patch:9.0.0359: error message for wrong argument type is not specific
Problem:    Error message for wrong argument type is not specific.
Solution:   Include more information in the error. (Yegappan Lakshmanan,
            closes vim/vim#11037)

8deb2b30c7

Cherry-pick test_listdict.vim changes from patch 8.2.4809.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 16:40:51 +08:00
zeertzjq
6267996f13 vim-patch:8.2.4455: accepting one and zero for second sort() argument is strange
Problem:    Accepting one and zero for the second sort() argument is strange.
Solution:   Disallow using one and zero in Vim9 script.

2007dd49f5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:11:17 +08:00
zeertzjq
0b1353c5a4 vim-patch:8.2.4451: sort() fails when ignoring case
Problem:    sort() fails when ignoring case.
Solution:   Accept a number one argument in sort().

9cd4c0fb98

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:06:51 +08:00