Commit Graph

376 Commits

Author SHA1 Message Date
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
zeertzjq
cda0abdb02 vim-patch:8.2.4450: list sort test fails
Problem:    List sort test fails.
Solution:   Pass a valid "how" argument.

2afeb40831

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

389b72196e

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
zeertzjq
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)

0ccb5842f5

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
zeertzjq
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)

8bfa0eb863

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-08-17 13:14:32 +08:00
zeertzjq
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)

27708e6c7b

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
zeertzjq
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)

2d877599ee

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 13:14:32 +08:00
zeertzjq
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)

c479ce032f

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

1b884a0053

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

57cf4973a2

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

ea696852e7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-17 11:21:10 +08:00
zeertzjq
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.

bd77aa9274

Omit GLV_NO_DECL: Vim9 script only.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-16 21:50:56 +08:00
zeertzjq
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.

3e9c0b9608

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-16 21:50:56 +08:00
zeertzjq
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

e98fb643ec

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-16 07:12:47 +08:00
zeertzjq
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

b209b86e66

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-08-16 06:28:52 +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

e4c79d3615
2023-08-16 06:07:01 +08:00
zeertzjq
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

0c6181fec4

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-15 19:16:19 +08:00
zeertzjq
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

8ef1fbc0c3

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-14 06:47:32 +08:00
zeertzjq
d39361f5e0
vim-patch:9.0.1698: Test_map_restore_sid fails in GUI (#24682)
Problem: Test_map_restore_sid fails in GUI
Solution: Feed an unsimplified Ctrl-B

closes: vim/vim#12770

7fe1089904
2023-08-13 07:10:43 +08:00
zeertzjq
7542286d6a
vim-patch:9.0.1697: incsearch test not sufficient (#24683)
Problem: incsearch test not sufficient (after 9.0.1691)
Solution: add an additional test

73b8209266

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2023-08-13 07:10:24 +08:00
zeertzjq
6c07a189f2
vim-patch:9.0.1688: cannot store custom data in quickfix list (#24673)
Problem: cannot store custom data in quickfix list
Solution: add `user_data` field for the quickfix list

closes: vim/vim#11818

ca6ac99077

Co-authored-by: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
2023-08-12 08:19:06 +08:00
zeertzjq
72cf94fc0e
vim-patch:9.0.1694: wrong mapping applied when replaying a char search (#24670)
Problem: wrong mapping applied when replaying a char search
Solution: Store a NOP after the ESC

closes: vim/vim#12708
closes: vim/vim#6350

bacc83009b
2023-08-12 06:50:52 +08:00
zeertzjq
8c5d81997e
vim-patch:9.0.1693: Ctrl-Q not handled like Ctrl-V in replace mode (#24669)
Problem: Ctrl-Q not handled like Ctrl-V in replace mode
Solution: Handle Ctrl-Q like Ctrl-V

closes: vim/vim#12686
closes: vim/vim#12684

2d63e4b3cc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-12 06:41:23 +08:00
zeertzjq
8f9c5ee5ef
vim-patch:9.0.1691: wrong viewport restored for incsearch and smoothscroll (#24667)
Problem: wrong viewport restored for incsearch and smoothscroll
Solution: Save and restore skipcol as well

closes: vim/vim#12713

7b7b4cb6f2
2023-08-12 06:32:13 +08:00
zeertzjq
713311be62
vim-patch:9.0.1687: mapset() not properly handling script ID (#24666)
Problem: mapset() not properly handling script ID
Solution: replace_termcodes() may accept a script ID

closes: vim/vim#12699
closes: vim/vim#12697

7e0bae024d
2023-08-12 06:08:07 +08:00
zeertzjq
6e0c36ba0e
vim-patch:9.0.1686: undotree() only works for the current buffer (#24665)
Problem:    undotree() only works for the current buffer
Solution:   Add an optional "buffer number" parameter to undotree().  If
            omitted, use the current buffer for backwards compatibility.

closes: vim/vim#4001
closes: vim/vim#12292

5fee111149

Co-authored-by: Devin J. Pohly <djpohly@gmail.com>
2023-08-12 05:51:49 +08:00
zeertzjq
3d948a4dc4
vim-patch:9.0.1683: Updated runtime files (#24638)
This is a collection of various PRs from github that all require a minor
patch number:

1) https://github.com/vim/vim/pull/12612

    Do not conflate dictionary key with end of block

2) https://github.com/vim/vim/pull/12729:

    When saving and restoring 'undolevels', the constructs `&undolevels` and
    `:set undolevels` are problematic.

    The construct `&undolevels` reads an unpredictable value; it will be the
    local option value (if one has been set), or the global option value
    (otherwise), making it unsuitable for saving a value for later
    restoration.

    Similarly, if a local option value has been set for 'undolevels',
    temporarily modifying the option via `:set undolevels` changes the local
    value as well as the global value, requiring extra work to restore both
    values.

    Saving and restoring the option value in one step via the construct
    `:let &undolevels = &undolevels` appears to make no changes to the
    'undolevels' option, but if a local option has been set to a different
    value than the global option, it has the unintended effect of changing
    the global 'undolevels' value to the local value.

    Update the documentation to explain these issues and recommend explicit
    use of global and local option values when saving and restoring.  Update
    some unit tests to use `g:undolevels`.

3) https://github.com/vim/vim/pull/12702:

    Problem:    Pip requirements files are not recognized.
    Solution:   Add a pattern to match pip requirements files.

4) https://github.com/vim/vim/pull/12688:

    Add indent file and tests for ABB Rapid

5) https://github.com/vim/vim/pull/12668:

    Use Lua 5.1 numeric escapes in tests and add to CI

    Only Lua 5.2+ and LuaJIT understand hexadecimal escapes in strings.  Lua
    5.1 only supports decimal escapes:

    > A character in a string can also be specified by its numerical value
    > using the escape sequence \ddd, where ddd is a sequence of up to three
    > decimal digits. (Note that if a numerical escape is to be followed by a
    > digit, it must be expressed using exactly three digits.) Strings in Lua
    > can contain any 8-bit value, including embedded zeros, which can be
    > specified as '\0'.

    To make sure this works with Lua 5.4 and Lua 5.1 change the Vim CI to
    run with Lua 5.1 as well as Lua 5.4

6) https://github.com/vim/vim/pull/12631:

    Add hurl filetype detection

7) https://github.com/vim/vim/pull/12573:

    Problem:   Files for haskell persistent library are not recognized
    Solution:  Add pattern persistentmodels for haskell persistent library

closes: vim/vim#12612
closes: vim/vim#12729
closes: vim/vim#12702
closes: vim/vim#12688
closes: vim/vim#12668
closes: vim/vim#12631
closes: vim/vim#12573

Already ported but wasn't marked: vim-patch:ad34abee2583

6efb198033

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: lacygoill <lacygoill@lacygoill.me>
Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: Jacob Pfeifer <jacob@pfeifer.dev>
Co-authored-by: Borys Lykah <lykahb@fastmail.com>
2023-08-10 17:45:36 +08:00
Christian Clason
f060f03304
vim-patch:2eb413f89b97 (#24627)
* vim-patch:2eb413f89b97

detect filetype for `*.vsh` and `*.vv` files (vim/vim#12692)

Co-authored-by: Turiiya <34311583+tobealive@users.noreply.github.com>

2eb413f89b

Co-authored-by: Turiiya <34311583+ttytm@users.noreply.github.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-09 23:35:10 +02:00
Christian Clason
3c929fd1c2
vim-patch:077ade4f6703 (#24629)
feat: recognize geojson extension as json filetype (vim/vim#12636)

077ade4f67

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
2023-08-09 22:35:57 +02:00
Christian Clason
2e8f38690f
vim-patch:b69b9d5e1753 (#24628)
Add filetype detection for eyaml files (vim/vim#12659)

https://github.com/voxpupuli/hiera-eyaml/ uses and produces the eyaml
format, which is simply yaml with some encrypted values.

It's convenient to edit the file without decrypting when not touching
encrypted values (or when you don't have access to the decryption key),
which is why vim should treat those files as yaml files.

b69b9d5e17

Co-authored-by: Max Gautier <mg@max.gautier.name>
2023-08-09 22:35:43 +02:00
Christian Clason
90ed7ee112
vim-patch:44ff25d5243b (#24625)
* vim-patch:44ff25d5243b

PyPA manifest files are not recognized (vim/vim#12707)

Problem:    PyPA manifest files are not recognized.
Solution:   Add a pattern to match PyPA manifest files.

44ff25d524

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-08-09 22:34:39 +02:00
Christian Clason
aaeb1a8cd1
vim-patch:7159ac7fec28 (#24624)
Unison support (vim/vim#12715)

7159ac7fec

Co-authored-by: Anton Parkhomenko <chuwy@users.noreply.github.com>
2023-08-09 22:34:02 +02:00
Christian Clason
ceb501c1c6
vim-patch:a13eb2b14791 (#24622)
Add WebGPU Shading Language (WGSL) filetype (vim/vim#12723)

The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies
'text/wgsl' media type for WGSL modules with the '.wgsl' file extension:
https://www.w3.org/TR/WGSL/#text-wgsl-media-type

It has also been registered at the Internet Assigned Numbers Authority (IANA):
https://www.iana.org/assignments/media-types/text/wgsl

Neovim's nvim-lspconfig already associates wgsl language servers
with 'filetype wgsl':
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer

However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim
is blocked by adding this filetype to the vim project first:
https://github.com/neovim/neovim/pull/23331

This commit adds this missing wgsl filetype.

a13eb2b147

Co-authored-by: Gergő Sályi <87373293+gergo-salyi@users.noreply.github.com>
2023-08-09 22:33:41 +02:00
zeertzjq
fdb11888f5
vim-patch:9.0.1679: Cleanup Tests from leftover files (#24617)
Problem:    Tests may leave leftover files around
Solution:   Clean up tests and remove files

There were a few failures in 'linux (huge, gcc, testgui, true, true)'
e.g. here: https://github.com/vim/vim/actions/runs/5497376153/jobs/10018060156

,----
| Error detected while processing command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[585]..function RunTheTest[54]..Test_lvimgrep_crash[16]..TestTimeout[12]..VimLeavePre Autocommands for "*"..function EarlyExit[7]..FinishTesting:
| line   70:
| E445: Other window contains changes
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txt
| E937: Attempt to delete a buffer that is in use: Xtest_stable_xxd.txtmalloc(): unsorted double linked list corrupted
`----

Which is puzzling, because the Xtest_stable_xxd file should have been
long gone after test_crypt.vim is run (and definitely no longer be
staying around in test_quickfix.vim).

So try to clean up properly after a test script is run, just in case any
X<file> is still around. During testing, a found a few leftover files,
which I also fixed in the relevant test-file.

Unfortunately, the test workflow 'linux (huge, gcc, testgui, true,
true)' now seems to fail with 'E1230: Encryption: sodium_mlock()' in
test_crypt.vim. Hopefully this is only temporary.

84bc00e9b5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-08-09 06:07:23 +08:00
ObserverOfTime
ce792db5b8
vim-patch:9.0.1678: blade files are not recognized (#24601)
Problem:    Blade files are not recognized.
Solution:   Add a pattern for Blade files. (closes vim/vim#12650)

ad34abee25

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-08-07 18:44:52 +02:00
zeertzjq
aba3ceccb7
vim-patch:9.0.1335: no test for bad use of spaces in help files (#24483)
Problem:    No test for bad use of spaces in help files.
Solution:   Add checks for use of spaces in help files.  Ignore intentional
            spaces. (Hirohito Higashi, closes vim/vim#11952)

d950984489

Cherry-pick changes from patch 9.0.1604.

Co-authored-by: h-east <h.east.727@gmail.com>
Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-07-25 20:58:09 +08:00
Lewis Russell
881d17a113
feat(options)!: remove compatible behaviours for vim 5.0 and earlier 2023-07-17 14:27:21 +01:00
Gregory Anders
3750e5ed9c
vim-patch:9.0.1673: cannot produce a status 418 or 503 message (#24287)
Problem:    Cannot produce a status 418 or 503 message.
Solution:   Add err_teapot().

80adaa8ae8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-07-10 11:55:12 -05:00
zeertzjq
54807231c0
test: check for ASAN properly (#24224)
Follow-up to #24195.
2023-07-02 08:05:02 +08:00
zeertzjq
bbaee29add
vim-patch:9.0.1672: tabline highlight wrong after truncated double width label (#24223)
Problem:    Tabline highlight wrong after truncated double width label.
Solution:   Fill up half a double width character later. (closes vim/vim#12614)

d392a74c5a
2023-07-02 07:42:49 +08:00
zeertzjq
42f9573e5d
vim-patch:9.0.1670: resetting local option to global value is inconsistent (#24185)
Problem:    Resetting local option to global value is inconsistent.
Solution:   Handle "<" specifically for 'scrolloff' and 'sidescrolloff'.
            (closes vim/vim#12594)

bf5f189e44

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-28 08:13:14 +08:00
ObserverOfTime
8ea9a70d05
vim-patch:9.0.1668: PEM files are not recognized (#24169)
Problem:    PEM files are not recognized.
Solution:   Add patterns to match PEM files. (closes vim/vim#12582)

0256d76a33
2023-06-27 09:14:34 +02:00
zeertzjq
116b09ac04 vim-patch:9.0.1667: regression test doesn't fail when fix is reverted
Problem:    Regression test doesn't fail when fix is reverted.
Solution:   Add "n" to 'cpoptions' instead of using :winsize. (closes vim/vim#12587,
            issue vim/vim#12528)

e429893741
2023-06-27 08:26:11 +08:00