Commit Graph

25545 Commits

Author SHA1 Message Date
zeertzjq
5d3ad6fd90 vim-patch:8.2.4185: cannot use an import in 'indentexpr'
Problem:    Cannot use an import in 'indentexpr'.
Solution:   Set the script context when evaluating 'indentexpr'

28e60cc088

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
96451e7f60 vim-patch:8.2.4184: cannot use an import in 'includeexpr'
Problem:    Cannot use an import in 'includeexpr'.
Solution:   Set the script context when evaluating 'includeexpr'

47bcc5f4c8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
36f1e9824a vim-patch:8.2.4183: cannot use an import in 'formatexpr'
Problem:    Cannot use an import in 'formatexpr'.
Solution:   Set the script context when evaluating 'formatexpr'.

3ba685eeef

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
9cf59acfaa vim-patch:8.2.4182: memory leak when evaluating 'diffexpr'
Problem:    Memory leak when evaluating 'diffexpr'.
Solution:   Use free_tv() instead of clear_tv().

39b8944539

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
ba57566601 vim-patch:8.2.4181: Vim9: cannot use an import in 'diffexpr'
Problem:    Vim9: cannot use an import in 'diffexpr'.
Solution:   Set the script context when evaluating 'diffexpr'.  Do not require
            'diffexpr' to return a bool, it was ignored anyway.

7b29f6a394

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
0c99ae7a88 vim-patch:8.2.4180: 'balloonexpr' is evaluated in the current script context
Problem:    'balloonexpr' is evaluated in the current script context.
Solution:   Use the script context where the option was set.

5600a709f4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
d6e0f3dad2 vim-patch:8.2.4179: 'foldtext' is evaluated in the current script context
Problem:    'foldtext' is evaluated in the current script context.
Solution:   Use the script context where the option was set.

9530b580a7

Script version is N/A.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
Christian Clason
0dbb0419f4
build(deps): bump LuaJIT to HEAD - 1c2791270 (#23140) 2023-04-17 09:08:43 +02:00
zeertzjq
9722b3b9f9
vim-patch:9.0.1400: find_file_in_path() is not reentrant (#23146)
Problem:    find_file_in_path() is not reentrant.
Solution:   Instead of global variables pass pointers to the functions.
            (closes vim/vim#12093)

5145c9a829

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 14:38:53 +08:00
zeertzjq
85bc9e8970
Merge pull request #23144 from zeertzjq/vim-9.0.0419
vim-patch:9.0.{0406,0419}: the :defer command does not check the function arguments
2023-04-17 10:09:18 +08:00
zeertzjq
7a3f86481e vim-patch:9.0.0419: the :defer command does not check the function arguments
Problem:    The :defer command does not check the function argument count and
            types.
Solution:   Check the function arguments when adding a deferred function.

169003289f

Cherry-pick check_internal_func() from Vim, but use EvalFuncDef pointer
as first argument.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:38:09 +08:00
zeertzjq
6bfba3660c vim-patch:9.0.0406: deferred functions not invoked when partial func exits
Problem:    Deferred functions not invoked when partial func exits.
Solution:   Create a funccall_T when calling a :def function.

9667b2c888

The remove_funccal() function is currently unused, but it will be used
in patch 9.0.0618.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:08:08 +08:00
zeertzjq
78535664bd
vim-patch:8.2.2172: Vim9: number of arguments is not always checked (#23142)
Problem:    Vim9: number of arguments is not always checked. (Yegappan
            Lakshmanan)
Solution:   Check number of arguments when calling function by name.

5082471f91

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 09:07:30 +08:00
dundargoc
55d346fc26
ci: remove unnecessary token usage 2023-04-16 14:16:19 +02:00
zeertzjq
88c3d89001
vim-patch:9.0.1143: invalid memory access with bad 'statusline' value (#23133)
Problem:    Invalid memory access with bad 'statusline' value.
Solution:   Avoid going over the NUL at the end.

7b17eb4b06

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 19:21:06 +08:00
zeertzjq
227f06b7df
vim-patch:9.0.1145: invalid memory access with recursive substitute expression (#23132)
Problem:    Invalid memory access with recursive substitute expression.
Solution:   Check the return value of vim_regsub().

3ac1d97a1d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 18:43:15 +08:00
JingMatrix
7f94a032e1
fix(checkhealth): shell_error and cpanm module
shell_error is a function, the code missed parentheses

The actual module for perl module version is App::cpanminus::script, not
App::cpanminus::fatscript.
2023-04-16 12:39:48 +02:00
zeertzjq
fd68cd1c0a
vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131)
Problem:    Vim9: exception in ISN_INSTR caught at wrong level.
Solution:   Set the starting trylevel in exec_instructions(). (closes vim/vim#8214)

ff65288aa8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 18:27:33 +08:00
dundargoc
b0978fca6b
fix(checkhealth): fix crash due to incorrect argument type 2023-04-16 12:26:13 +02:00
Raphael
2f779b94e7
fix(lua): inspect_pos respect bufnr when get syntax info (#23098) 2023-04-16 17:50:32 +08:00
zeertzjq
6ca4fba97f
test(old): sync test_filetype.vim with upstream (#23127) 2023-04-16 17:44:30 +08:00
zeertzjq
b28683d252
vim-patch:9.0.0947: invalid memory access in substitute with function (#23126)
Problem:    Invalid memory access in substitute with function that goes to
            another file.
Solution:   Check for text locked in CTRL-W gf.

cc762a48d4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 17:44:14 +08:00
zeertzjq
c54592bfda
vim-patch:9.0.0621: filetype test leaves file behind (#23125)
Problem:    Filetype test leaves file behind.
Solution:   Add deferred delete flag to writefile(). (Dominique Pellé,
            closes vim/vim#11249)

fc06cda837

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-04-16 17:06:47 +08:00
Christian Clason
d9e9dc3a06
vim-patch:9.0.1455: C++ 20 modules are not recognized (#23124)
Problem:    C++ 20 modules are not recognized.
Solution:   Add patterns to recognize C++ 20 modules as "cpp". (Ben Jackson,
            closes vim/vim#12261)

732d69e191

Co-authored-by: Ben Jackson <puremourning@gmail.com>
2023-04-16 10:59:04 +02:00
zeertzjq
42e55ba009
vim-patch:9.0.0398: members of funccall_T are inconsistently named (#23123)
Problem:    Members of funccall_T are inconsistently named.
Solution:   Use the "fc_" prefix for all members.

ca16c60f33

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 16:57:25 +08:00
zeertzjq
0b855f7c07
Merge pull request #23116 from zeertzjq/vim-9.0.1064
vim-patch:9.0.{1064,1456}
2023-04-16 16:35:51 +08:00
zeertzjq
a81c137251 vim-patch:9.0.1456: shortmess test depends on order of test execution
Problem:    Shortmess test depends on order of test execution.
Solution:   Clear messages. (closes vim/vim#12264)

657b31fa3b
2023-04-16 16:12:52 +08:00
zeertzjq
e24a84f18e vim-patch:9.0.1064: code for making 'shortmess' temporarily empty is repeated
Problem:    Code for making 'shortmess' temporarily empty is repeated.
Solution:   Add functions for making 'shortmess' empty and restoring it.
            (Christian Brabandt, closes vim/vim#11709)

9aee8ec400

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-04-16 16:12:52 +08:00
zeertzjq
0d9b0fbe57
Merge pull request #23119 from zeertzjq/vim-9.0.0370
vim-patch:9.0.{0370,0379,0390,0397,0411,1446}: :defer and deferred delete
2023-04-16 15:59:32 +08:00
zeertzjq
8a59d04a31 test(unit): add test for os_mkdir_recurse "created" 2023-04-16 15:04:41 +08:00
zeertzjq
b1a341a48a vim-patch:9.0.1446: unnecessary checks for the "skip" flag when skipping
Problem:    Unnecessary checks for the "skip" flag when skipping.
Solution:   Remove the unnecessary checks. (closes vim/vim#12254)

5299c0933f
2023-04-16 15:04:41 +08:00
zeertzjq
f39b33ee49 vim-patch:9.0.0411: only created files can be cleaned up with one call
Problem:    Only created files can be cleaned up with one call.
Solution:   Add flags to mkdir() to delete with a deferred function.
            Expand the writefile() name to a full path to handle changing
            directory.

6f14da15ac

vim-patch:8.2.3742: dec mouse test fails without gnome terminfo entry

Problem:    Dec mouse test fails without gnome terminfo entry.
Solution:   Check if there is a gnome entry. Also fix 'acd' test on
            MS-Windows. (Dominique Pellé, closes vim/vim#9282)

f589fd3e10

Cherry-pick test_autochdir.vim changes from patch 9.0.0313.
Cherry-pick test_autocmd.vim changes from patch 9.0.0323.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
7b05ddbb72 vim-patch:9.0.0397: :defer not tested with exceptions and ":qa!"
Problem:    :defer not tested with exceptions and ":qa!".
Solution:   Test :defer works when exceptions are thrown and when ":qa!" is
            used.  Invoke the deferred calls on exit.

58779858fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
335bef0c21 vim-patch:9.0.0390: cannot use a partial with :defer
Problem:    Cannot use a partial with :defer.
Solution:   Add the partial arguments before the other arguments.  Disallow
            using a dictionary.

86d87256c4

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
0167649ce4 vim-patch:9.0.0379: cleaning up after writefile() is a hassle
Problem:    Cleaning up after writefile() is a hassle.
Solution:   Add the 'D' flag to defer deleting the written file.  Very useful
            in tests.

806a273f3c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:41 +08:00
zeertzjq
b75634e55e vim-patch:9.0.0370: cleaning up afterwards can make a function messy
Problem:    Cleaning up afterwards can make a function messy.
Solution:   Add the :defer command.

1d84f7608f

Omit EX_EXPR_ARG: Vim9 script only.
Make :def throw E319 to avoid confusing behavior.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 15:04:40 +08:00
zeertzjq
54dab9ed9e
Merge pull request #23118 from zeertzjq/vim-8.2.3783
vim-patch:8.2.{1945,2848,2977,2978,3783,3786}
2023-04-16 10:42:11 +08:00
zeertzjq
d7965293ec vim-patch:8.2.3786: test fails because of using Vim9 syntax in legacy function
Problem:    Test fails because of using Vim9 syntax in legacy function.
Solution:   Add "call".

4f16e9de98

Add test_nested_function.vim changes from patches 8.{0.0141,2.1432}.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:18:39 +08:00
zeertzjq
68ca16c376 vim-patch:8.2.3783: confusing error for using a variable as a function
Problem:    Confusing error for using a variable as a function.
Solution:   If a function is not found but there is a variable, give a more
            useful error. (issue vim/vim#9310)

2ef9156b42

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:15 +08:00
zeertzjq
2e8cec5f2b vim-patch:8.2.2978: warning for uninitialized variable
Problem:    Warning for uninitialized variable.
Solution:   Set return value to FAIL.

744aecf877

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:15 +08:00
zeertzjq
f4d3e279e8 vim-patch:8.2.2977: crash when using a null function reference
Problem:    Crash when using a null function reference. (Naohiro Ono)
Solution:   Check for an invalid function name. (closes vim/vim#8367)

22db0d549f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:15 +08:00
zeertzjq
08121ef69f vim-patch:8.2.2848: crash whn calling partial
Problem:    Crash whn calling partial.
Solution:   Check for NULL pointer. (Dominique Pellé, closes vim/vim#8202)

fe8ebdbe5c

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
2023-04-16 10:15:15 +08:00
zeertzjq
d13222649a vim-patch:8.2.1945: crash when passing NULL function to reduce()
Problem:    Crash when passing NULL function to reduce().
Solution:   Check for NULL pointer and give an error. (Dominique Pellé,
            closes vim/vim#7243)

0d90e728fe

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-16 10:15:13 +08:00
zeertzjq
6adfd24a06
vim-patch:8.2.4716: memory allocation failure not tested when defining a function (#23117)
Problem:    Memory allocation failure not tested when defining a function.
Solution:   Add a test. (Yegappan Lakshmanan, closes vim/vim#10127)

7c7e19cf50

test_alloc_fail() is N/A.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-04-16 08:26:42 +08:00
dundargoc
c08b030761
refactor: deprecate checkhealth functions
The following functions are deprecated and will be removed in
Nvim v0.11:

- health#report_start()
- health#report_info()
- health#report_ok()
- health#report_warn()
- health#report_error()
- vim.health.report_start()
- vim.health.report_info()
- vim.health.report_ok()
- vim.health.report_warn()
- vim.health.report_error()

Users should instead use these:

- vim.health.start()
- vim.health.info()
- vim.health.ok()
- vim.health.warn()
- vim.health.error()
2023-04-15 23:40:48 +02:00
dundargoc
c8667c8756
build: various cmake fixes
- Remove unused function argument from GetBinaryDeps
- Remove unused variable LUA_LOAD_PACKAGE_MODULE_SOURCE
- Add LUA_FS_MODULE_SOURCE as a dependency of VIM_MODULE_FILE
2023-04-15 22:39:30 +02:00
zeertzjq
8c6f97bef8
fix(health): properly use the value of $PYENV_VERSION (#23109) 2023-04-16 00:16:50 +08:00
zeertzjq
2e2101cf7b
Merge pull request #23107 from zeertzjq/vim-9.0.0269
vim-patch:9.0.{0269,0303,1431}: more getscriptinfo() features
2023-04-15 21:27:30 +08:00
zeertzjq
9770dcf96d refactor: remove FC_DEAD
It's for Vim9 script only.
2023-04-15 21:06:17 +08:00
zeertzjq
c5ec823a14 vim-patch:9.0.1431: getscriptinfo() loops even when specific SID is given
Problem:    getscriptinfo() loops even when specific SID is given.
Solution:   Only loop when needed.  Give a clearer error message.
            (closes vim/vim#12207)

2d68b722e3
2023-04-15 21:06:17 +08:00