Commit Graph
6084 Commits
Author SHA1 Message Date
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

https://github.com/vim/vim/commit/9994160bfe74501886bbbf5631aec8ea2ae05991
2023-08-19 19:40:26 +08:00
zeertzjqandYegappan Lakshmanan 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)

https://github.com/vim/vim/commit/f9dc278946d52235a0025fd347bd9ff571258470

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjqandYegappan Lakshmanan 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)

https://github.com/vim/vim/commit/03ff1c2dde7f15eca5c9baa6dafbda9b49bedc3b

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

https://github.com/vim/vim/commit/4dd266cb66d901cf5324f09405cfea3f004bd29f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-19 18:05:46 +08:00
zeertzjq 5a6c7c805b fix(extmarks): make empty "conceal" respect &conceallevel = 1 (#24785)
This treats extmark conceal more like matchadd() conceal.
2023-08-19 03:55:11 +08:00
zeertzjq 1d3d50e8f0 test(ui/mouse_spec): mouse click with matchadd() concealed text 2023-08-18 19:34:25 +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

https://github.com/vim/vim/commit/e500ae8e29ad921378085f5d70ee5c0c537be1ba

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

https://github.com/vim/vim/commit/b25dbb3f9b5885dd623af7a9fae890b8366b64e2

Tests only. Code superseded by patch 9.0.1725.
2023-08-18 19:34:16 +08:00
zeertzjqandBram Moolenaar 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.

https://github.com/vim/vim/commit/b90818867c089d4987f1a48ee3666674826d6f4b

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 81d5550d77 vim-patch:9.0.1731: blockwise Visual highlight not working with virtual text (#24779)
Problem: blockwise Visual highlight not working with virtual text
Solution: Reset the correct variable at the end of virtual selection and
          Check for double-width char inside virtual text.

closes: vim/vim#12606

https://github.com/vim/vim/commit/6e940d9a1d4ff122aad1b0821c784a60b507d45c

Need to remove area_active and use wlv.fromcol and wlv.tocol directly.
2023-08-18 14:00:12 +08:00
zeertzjq 71ad771ea4 fix(ui_compositor): only reset skipstart at first column (#24776)
Problem:    A double-width char in a floating window causes an extra
            space to be drawn to the left of its boundary.
Solution:   Only reset skipstart at the first column.

Fix #24775
2023-08-18 12:08:18 +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

https://github.com/vim/vim/commit/bfe377b8f2d080e5f85c8cbecf3533456e1d6312
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

https://github.com/vim/vim/commit/825cf813fa0fddf085fcbd3194781e875320ff63
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

https://github.com/vim/vim/commit/008c91537b55835aa91cd8fbe1a139256581da31
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

https://github.com/vim/vim/commit/be5cdd1d634c2dfc7e415499fb18f4d246a8721c
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()

https://github.com/vim/vim/commit/876f5fb570d8401aa4c58af4a5da91f10520aa9d

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

https://github.com/vim/vim/commit/ad0c442f1fcc6fe9c433777ee3e5b9e6addc6d69
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

https://github.com/vim/vim/commit/4f389e7c0fe7dfeccfa512a72fa36f9028d57159
2023-08-18 05:28:42 +08:00
zeertzjqandErnie Rael 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)

https://github.com/vim/vim/commit/e6d40dcdc7227594935d2db01eca29f0e575dcee

Co-authored-by: Ernie Rael <errael@raelity.com>
2023-08-17 17:03:10 +08:00
zeertzjqandBram Moolenaar 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.

https://github.com/vim/vim/commit/f1c60d4bf10794265b828afd9c5f7eddacada10b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:44:55 +08:00
zeertzjqandYegappan Lakshmanan 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)

https://github.com/vim/vim/commit/8deb2b30c77035bb682ccf80b781455ac1d6038b

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
zeertzjqandBram Moolenaar 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.

https://github.com/vim/vim/commit/2007dd49f5cb36f944cab1cfbceb0f864e625f74

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:11:17 +08:00
zeertzjqandBram Moolenaar 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().

https://github.com/vim/vim/commit/9cd4c0fb98cb4fe6164e4e1751c21a5a5229b9cc

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:06:51 +08:00
zeertzjqandBram Moolenaar cda0abdb02 vim-patch:8.2.4450: list sort test fails
Problem:    List sort test fails.
Solution:   Pass a valid "how" argument.

https://github.com/vim/vim/commit/2afeb408310f4f0185ce5eec079b51a3fe415a33

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 16:06:51 +08:00
zeertzjqandYegappan Lakshmanan b193674b4a vim-patch:partial:8.2.3849: functions implementing reduce and map are too long
Problem:    Functions implementing reduce and map are too long.
Solution:   Use a function for each type of value.  Add a few more test cases
            and add to the help. (Yegappan Lakshmanan, closes vim/vim#9370)

https://github.com/vim/vim/commit/389b72196e6aaeafe3f907c73d271f2c6b931140

Partial port as this doesn't include handling for non-materialized List.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 15:37:32 +08:00
zeertzjqandrbtnn c5576fcc80 vim-patch:8.2.3848: cannot use reduce() for a string
Problem:    Cannot use reduce() for a string.
Solution:   Make reduce() work with a string. (Naruhiko Nishino, closes vim/vim#9366)

https://github.com/vim/vim/commit/0ccb5842f5fb103763d106c7aa364d758343c35a

Omit tv_get_first_char() as it doesn't really save much code.

Co-authored-by: rbtnn <naru123456789@gmail.com>
2023-08-17 15:20:47 +08:00
zeertzjqandDominique Pelle acac1e19d3 vim-patch:8.2.3982: some lines of code not covered by tests
Problem:    Some lines of code not covered by tests.
Solution:   Add a few more test cases. (Dominique Pellé, closes vim/vim#9453)

https://github.com/vim/vim/commit/8bfa0eb863357c1013024233ebb2e95a0a848002

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-08-17 13:14:32 +08:00
zeertzjqandYegappan Lakshmanan db64280be5 vim-patch:8.2.3908: cannot use a script-local function for 'foldtext'
Problem:    Cannot use a script-local function for 'foldtext'.
Solution:   Expand "s:" and "<SID>". (Yegappan Lakshmanan, closes vim/vim#9411)

https://github.com/vim/vim/commit/27708e6c7b6f444fd599f3dc5015336b002b874d

Cherry-pick test_filter_map.vim change from patch 8.2.3871.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-17 13:14:32 +08:00
zeertzjqandBram Moolenaar faef577e90 vim-patch:8.2.3822: leaking memory in map() and filter(), no string in Vim9
Problem:    Leaking memory in map() and filter(), cannot use a string argument
            in Vim9 script.
Solution:   Fix the leak, adjust the argument check, also run the tests as
            Vim9 script. (Yegappan Lakshmanan, closes vim/vim#9354)

https://github.com/vim/vim/commit/2d877599ee1cede063ef4abe3a2272e67c116238

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 13:14:32 +08:00
zeertzjqandrbtnn d9e7dad139 vim-patch:8.2.3818: cannot filter or map characters in a string
Problem:    Cannot filter or map characters in a string.
Solution:   Make filter() and map() work on a string. (Naruhiko Nishino,
            closes vim/vim#9327)

https://github.com/vim/vim/commit/c479ce032f5d4d14bab9e479acbf42d758879893

Co-authored-by: rbtnn <naru123456789@gmail.com>
2023-08-17 13:14:32 +08:00
zeertzjqandBram Moolenaar 3117dc70f1 vim-patch:1b884a005398
Update runtime files.

https://github.com/vim/vim/commit/1b884a0053982335f644eec6c71027706bf3c522

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
zeertzjqandBram Moolenaar 90ad3c8f17 vim-patch:8.2.2075: error for const argument to mapnew()
Problem:    Error for const argument to mapnew().
Solution:   Don't give an error. (closes vim/vim#7400)

https://github.com/vim/vim/commit/57cf4973a283941c92744554474b2c52ce892fd1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
zeertzjqandBram Moolenaar 8cbb2477cf vim-patch:8.2.1969: Vim9: map() may change the list or dict item type
Problem:    Vim9: map() may change the list or dict item type.
Solution:   Add mapnew().

https://github.com/vim/vim/commit/ea696852e7abcdebaf7f17a7f23dc90df1f5e2ed

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
Sean Dewar 22d9338afc fix(api): disallow win_set_buf from changing cmdwin's old curbuf (#24745)
A command typed in the cmdwin and executed with `<CR>` is expected to be
executed in the context of the old curwin/buf, so it shouldn't be changed.
2023-08-17 00:53:10 +01:00
zeertzjqandBram Moolenaar e928161bde vim-patch:8.2.3334: Vim9: not enough tests run with Vim9
Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function. Fix
            islocked().  Fix error for locking local variable.

https://github.com/vim/vim/commit/bd77aa92744d79f3ba69aee713739ec17da474f6

Omit GLV_NO_DECL: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-16 21:50:56 +08:00
zeertzjqandBram Moolenaar 56befb6fb3 vim-patch:8.2.3333: Vim9: not enough tests run with Vim9
Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function.

https://github.com/vim/vim/commit/3e9c0b9608736e7d888f3141443f8754143364d7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-16 21:50:56 +08:00
Michael Strobel e780177506 feat(diagnostic): filter diagnostics by specific severities (#24736)
Allow users to filter diagnostics by specifying severities
2023-08-16 08:49:14 -05:00
zeertzjqandLemonBoy f92bda1dad vim-patch:9.0.1718: dict-completion does not respect region (#24733)
Problem: dict-completion does not respect region
Solution: respect selected region in dict completion

Set do_region to zero as we don't want a complete dump of the matching
words, we want the code to filter them according to the user's selected
region.

closes: vim/vim#12792
closes: vim/vim#7025

https://github.com/vim/vim/commit/e98fb643ec5f84f9088c8b1434a0bd6ff988dc2d

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-16 07:12:47 +08:00
zeertzjqandYegappan Lakshmanan a245dd79a2 vim-patch:9.0.1717: virtcol2col returns last byte of a multi-byte char (#24729)
Problem: virtcol2col returns last byte of a multi-byte char
Solution: Make it return the first byte for a multi-byte char

closes: vim/vim#12786
closes: vim/vim#12799

https://github.com/vim/vim/commit/b209b86e6636a16088ccacdac98213416c065bf2

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-16 06:28:52 +08:00
zeertzjq 10c5f35a8d vim-patch:9.0.1715: duplicate test in message_test.c (#24728)
Problem: duplicate test in message_test.c
Solution: Remove duplicate test and make functions static

closes: vim/vim#12803

https://github.com/vim/vim/commit/7772c93a3ec1ce60469e9aea9899687ae1141f34
2023-08-16 06:11:05 +08:00
zeertzjq 3cd5ef63fd vim-patch:9.0.1714: getcompletion() "cmdline" fails after :autocmd (#24727)
Problem:  getcompletion() "cmdline" fails after :autocmd
Solution: Use set_cmd_context() instead of set_one_cmd_context().

closes: vim/vim#12804

https://github.com/vim/vim/commit/e4c79d36150431ffb97cb8952ec482af2e57f228
2023-08-16 06:07:01 +08:00
Gregory Anders e72c0cd920 feat(highlight): Allow hyphens (-) in highlight group names (#24714)
Fixes: https://github.com/neovim/neovim/issues/23184
2023-08-15 09:25:51 -05:00
zeertzjq fc14928719 fix(printf): make positional %zd and %zu work (#24722) 2023-08-15 20:54:28 +08:00
zeertzjqandChrist van Willegen 842a47d6a4 vim-patch:9.0.1704: Cannot use positional arguments for printf() (#24719)
Problem: Cannot use positional arguments for printf()
Solution: Support positional arguments in string formatting

closes: vim/vim#12140

https://github.com/vim/vim/commit/0c6181fec4c362eb9682d5af583341eb20cb1af5

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-15 19:16:19 +08:00
zeertzjq 389165cac1 vim-patch:8.2.0066: some corners of vim_snprintf() are not tested (#24718)
Problem:    Some corners of vim_snprintf() are not tested.
Solution:   Add a test in C. (Dominique Pelle, closes vim/vim#5422)

https://github.com/vim/vim/commit/d2c946bacfedf4e506a4c6771758beddb87df3af
2023-08-15 14:46:05 +08:00
zeertzjqandChristian Brabandt fbc644ba31 vim-patch:9.0.1708: getcompletion() failes for user-defined commands (#24707)
Problem: getcompletion() failes for user-defined commands
Solution: set context for completion function

closes: vim/vim#12681
closes: vim/vim#12680

https://github.com/vim/vim/commit/8ef1fbc0c3ca8dca32c352f3cf30e7a4b3096a94

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-14 06:47:32 +08:00
zeertzjq 06bce8bf5c test(terminal): fix scrollback test flakiness (#24708)
Problem:    Terminal scrollback test is flaky.
Solution:   Use INTERACT flag so the job doesn't exit immediately.
2023-08-14 06:47:09 +08:00
Christian Clason fc0ee871de fix(treesitter)!: remove deprecated legacy injection format 2023-08-14 00:14:35 +02:00
Christian Clason 11590543eb Merge pull request #24681 from clason/update-c
feat(treesitter): update C parser and queries
2023-08-13 18:19:01 +02:00
zeertzjq 017ff93b02 fix(keycodes): recognize <t_xx> as a key (#24700)
Problem:    The result of keytrans() sometimes can't be translated back.
Solution:   Recognize <t_xx> as a key.
2023-08-13 22:14:48 +08:00
Justin M. Keyes 0fe921663f Merge #15440 close 'shell' :terminal automatically 2023-08-13 05:23:15 -07:00