Commit Graph

25711 Commits

Author SHA1 Message Date
luukvbaal
84a4319545
fix(mouse): cmdline click registered as statuscolumn (#23163) 2023-04-18 08:00:49 +08:00
Gregory Anders
ab1edecfb7
feat(lua): add vim.iter (#23029)
vim.iter wraps a table or iterator function into an `Iter` object with
methods such as `filter`, `map`, and `fold` which can be chained to
produce iterator pipelines that do not create new tables at each step.
2023-04-17 12:54:19 -06:00
Sean Dewar
65dd3c1180
fix(ruler): show ruler of curwin with no statusline in cmdline
Problem: After neovim/neovim@846a056, only the ruler for current floating or
last window without a statusline is drawn in the cmdline. This means that if the
current window is not one of these, but has no statusline, its ruler will not be
drawn anymore.

Solution: Make `showmode()` draw the ruler of the current window or the last
window in the cmdline if it has no statusline. This also maintains the
previously restored floating window case (`float->w_status_height` should be 0).

This behaviour should again match Vim, but without the overdraw it seems to do
to achieve the same effect; it calls `showmode()` to draw the ruler for the last
window without a statusline, then may draw over it in `showruler()` (which is
now `show_cursor_info_later()` in Nvim) to show the ruler for the current
window..? It's very confusing.

Also update the logic in `win_redr_ruler()` to mirror the check done in
`showmode()`, so that the ruler doesn't potentially draw over the long
ins-completion mode message in some cases.
2023-04-17 18:40:12 +01:00
Sean Dewar
7095f8ff9d
vim-patch:9.0.1461: ruler not drawn correctly when using 'rulerformat'
Problem:    Ruler not drawn correctly when using 'rulerformat'.
Solution:   Adjust formatting depending on whether the ruler is drawn in the
            statusline or the command line. (Sean Dewar, closes vim/vim#12246)

fc8a601c32

This issue was made apparent after neovim/neovim@0f1e2b6, as `showmode()` calls
`win_redr_ruler()` with `curwin` now if it's floating, rather than the last
window if there's no statusline (which usually already shares its right side
with that of the editor).

Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
2023-04-17 18:38:31 +01:00
Jon Huhn
6cc76011ca
fix(watchfiles): skip Created events when poll starts (#23139) 2023-04-17 18:50:05 +02:00
zeertzjq
9e5f9c25d9
vim-patch:9.0.1460: insufficient testing for getcmdcompltype() (#23159)
Problem:    Insufficient testing for getcmdcompltype().
Solution:   Add a few more test cases. (closes vim/vim#12268)

961b2e54bd
2023-04-17 23:27:04 +08:00
Isak Samsten
07b60efd80
feat(diagnostic): specify diagnostic virtual text prefix as a function
- vim.diagnostic.config() now accepts a function for the virtual_text.prefix
  option, which allows for rendering e.g., diagnostic severities differently.
2023-04-17 12:53:34 +01:00
zeertzjq
e83682e652
refactor: suppress clang false positives (#23154) 2023-04-17 19:22:55 +08:00
zeertzjq
b98d195c55
ci(labeler): add back GitHub token for type-scope
It is required by `gh pr edit`.
2023-04-17 19:11:29 +08:00
zeertzjq
75d9c413d4
fix(excmd): make :def unknown rather than unimplemented (#23150) 2023-04-17 17:44:08 +08:00
Christian Clason
a30e61eb4d
build(deps): bump tree-sitter to HEAD - af92bfc02 (#23151) 2023-04-17 11:39:57 +02:00
zeertzjq
53985a6d31
Merge pull request #23148 from zeertzjq/vim-8.2.4179
vim-patch:8.2.{4179,4180,4181,4182,4183,4184,4185,4186,4193,4197}
2023-04-17 16:10:21 +08:00
zeertzjq
79a6933768 vim-patch:partial:6f4754b9f725
Update runtime files

6f4754b9f7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
481c6e6cac vim-patch:8.2.4197: cannot use an import in the "expr" part of 'spellsuggest'
Problem:    Cannot use an import in the "expr" part of 'spellsuggest'.
Solution:   Set the script context when evaluating "expr" of 'spellsuggest'.

2a7aa83458

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
zeertzjq
f560c97059 vim-patch:8.2.4193: cannot use an import in 'charconvert'
Problem:    Cannot use an import in 'charconvert'.
Solution:   Set the script context when evaluating 'charconvert'.  Also expand
            script-local functions in 'charconvert'.

f4e88f2152

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

36c2add7f8

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-17 15:46:24 +08:00
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