Commit grafiek

29391 Commits

Auteur SHA1 Bericht Datum
zeertzjq 562719033e
vim-patch:9.1.0343: 'showcmd' wrong for partial mapping with multibyte (#28392)
Problem:  'showcmd' is wrong for partial mapping with multibyte char,
          and isn't very readable with modifyOtherKeys.
Solution: Decode multibyte char and merge modifiers into the char.
          (zeertzjq)

This improves the following situations:
- Multibyte chars whose individual bytes are considered unprintable are
  now shown properly in 'showcmd' area.
- Ctrl-W with modifyOtherKeys now shows ^W in 'showcmd' area.

The following situation may still need improvement:
- If the char is a special key or has modifiers that cannot be merged
  into it, internal keycodes are shown in 'showcmd' area like before.
  This applies to keys typed in Normal mode commands as well, and it's
  hard to decide how to make it more readable due to the limited space
  taken by 'showcmd', so I'll leave it for later.

closes: vim/vim#14572

acdfb8a979
2024-04-18 06:23:11 +08:00
zeertzjq de6eb96fc9
vim-patch:9.1.0344: Cursor wrong after using setcellwidth() in terminal (#28391)
Problem:  Cursor wrong after using setcellwidth() in terminal
          (mikoto2000)
Solution: output additional spaces, so the behaviour matches the GUI
          (mikoto2000)

fixes: vim/vim#14539
closes: vim/vim#14540

Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.

e20fa59903

This is already fixed and tested in Nvim in #28322.

Co-authored-by: mikoto2000 <mikoto2000@gmail.com>
2024-04-18 05:41:19 +08:00
bfredl 6488a9268a
Merge pull request #28355 from theofabilous/msgpack-crash-fix
fix(msgpack): retain grid line event memory
2024-04-17 19:12:52 +02:00
dundargoc b0f9228179 docs: remove mentions of scan-build
These same checks are already checked by the clang-analyzer job, so this
duplication is not necessary.
2024-04-17 13:12:37 +02:00
Michael 96d0c709b6
fix(healthcheck): expand vimrc variable (#28379) 2024-04-17 14:31:13 +08:00
zeertzjq 2f371ad7d0
vim-patch:9.1.0341: Problem: a few memory leaks are found (#28382)
Problem:  a few memory leaks are found
          (LuMingYinDetect )
Solution: properly free the memory

Fixes the following problems:
- Memory leak in f_maplist()
  fixes: vim/vim#14486

- Memory leak in option.c
  fixes: vim/vim#14485

- Memory leak in f_resolve()
  fixes: vim/vim#14484

- Memory leak in f_autocmd_get()
  related: vim/vim#14474

- Memory leak in dict_extend_func()
  fixes: vim/vim#14477
  fixes: vim/vim#14238

closes: vim/vim#14517

29269a71b5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:52:29 +08:00
zeertzjq 0b2b1b0185
vim-patch:9.1.0340: Problem: Error with matchaddpos() and empty list (#28381)
Problem:  Error with matchaddpos() and empty list
          (@rickhow)
Solution: Return early for an empty list

fixes: vim/vim#14525
closes: vim/vim#14563

f7d31adcc2

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-17 06:49:23 +08:00
zeertzjq 329fc0e5b7
test: API can return Lua function to Lua code (#28380) 2024-04-17 06:34:10 +08:00
zeertzjq f150b62423
fix(lua): only free luarefs when returning from API (#28373) 2024-04-17 05:44:06 +08:00
Theo Fabi 60d1e3e471 fix(msgpack): store grid line event as a value 2024-04-16 16:41:13 -04:00
Famiu Haque 8e5c48b08d
feat(lua): vim.fs.normalize() resolves ".", ".." #28203
Problem:
`vim.fs.normalize` does not resolve `.` and `..` components. This makes
no sense as the entire point of normalization is to remove redundancy
from the path. The path normalization functions in several other
languages (Java, Python, C++, etc.) also resolve `.` and `..`
components.

Reference:
- Python: https://docs.python.org/3/library/os.path.html#os.path.normpath
- Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize--
- C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal

Solution:
Resolve "." and ".." in `vim.fs.normalize`.

    Before:
    "~/foo/bar/../baz/./" => "~/foo/bar/../baz/."
    After:
    "~/foo/bar/../baz/./" => "~/foo/baz"
2024-04-16 12:13:44 -07:00
Luna Saphie Mittelbach 20b38677c2 feat(defaults): use ripgrep (rg) for 'grepprg' if available 2024-04-16 19:21:02 +02:00
Justin M. Keyes fe4583127f
fix: vim.validate() order is not deterministic #28377
Problem:
The order of the validation performed by vim.validate() is
unpredictable.
- harder to write reliable tests.
- confusing UX because validation result might return different errors randomly.

Solution:
Iterate the input using `vim.spairs()`.

Future:
Ideally, the caller could provide an "ordered dict".
2024-04-16 07:31:43 -07:00
zeertzjq 5cfdaaaeac
fix(api): ignore 'autochdir' when renaming other buf (#28376)
Problem:  Renaming non-current buffer changes working directory when
          'autochdir' is set.
Solution: Temporarily disable 'autochdir'.  Add more tests for the
          win_set_buf change.
2024-04-16 20:57:01 +08:00
Raphael 2fc2343728
fix(api): ignore 'autochdir' when setting buf in other win (#28371)
Problem:  Wrong working directory when setting buffer in another window with
          'autochdir' enabled.
Solution: Temporarily disable 'autochdir'.
2024-04-16 19:49:56 +08:00
Justin M. Keyes 3065e2fa5d
Merge #28227 feat(diagnostic): is_enabled, enable(…, enable:boolean) 2024-04-16 04:37:54 -07:00
zeertzjq 7fa24948a9
test: make mapping tests more consistent (#28368)
- Test maparg() and maplist() in the same test.
- Use matches() instead of string.match().
- Avoid overlong lines and strange spacing in exec_lua().
- Revert code change from last PR as the variable may be needed.
2024-04-16 14:05:09 +08:00
zeertzjq 47ba96a6b3
test: getting autocmd Lua callback in Vimscript (#28367)
Also remove unnecessary variable in API converter.
2024-04-16 11:59:55 +08:00
zeertzjq 60fb8a6a8b
fix(messages): avoid crash with :intro and ch=0 (#28343)
This just copies code from msg_start() to wait_return().  Not sure if
there is a better place to put such a block.
2024-04-16 10:38:17 +08:00
zeertzjq e3c083832c
vim-patch:9.1.0335: String interpolation fails for List type (#28364)
Problem:  String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
          (Yegappan Lakshmanan)

related: vim/vim#14529
closes: vim/vim#14556

bce51d9005

Cherry-pick eval_to_string_eap() from patch 8.2.1914.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 10:18:24 +08:00
zeertzjq b1e8b799a5
vim-patch:9.1.0332: tests: some assert_equal() calls have wrong order of args (#28363)
Problem:  tests: some assert_equal() calls have wrong order of args
Solution: Correct the order (zeertzjq).

closes: vim/vim#14555

757f32141b
2024-04-16 10:00:48 +08:00
zeertzjq 9b485e3f42
vim-patch:8a31de6dd275 (#28361)
compiler(rime_deployer): include new compiler, use it for '*.custom.yaml' files (vim/vim#14460)

8a31de6dd2

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-16 09:33:51 +08:00
zeertzjq fb7ffac69f
vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360)
Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

f9f5424d3e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
2024-04-16 09:33:33 +08:00
zeertzjq 07661009c5
vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)
vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized

Problem:  filetype: CMakeCache.txt files not recognized
Solution: Detect 'CMakeCache.txt' files as cmakecache filetype,
          include basic syntax script for cmakecache
          (Wu, Zhenyu, @bfrg)

closes: vim/vim#14384

62c09e032c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: bfrg <bfrg@users.noreply.github.com>
2024-04-16 09:33:16 +08:00
zeertzjq 537ba34953
vim-patch:4052474a1bd2 (#28358)
runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)

* runtime(java): Recognise non-ASCII identifiers

Also:

- Remove the already commented out and less general in its
  definition javaFuncDef alternative.

- Stop recognising some bespoke {p,trace} debugging API.

Non-ASCII identifiers have been supported from the outset
of the Java language.

> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter.  An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true.  A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .

(Separate syntax tests will be written when particular parts
now touched will have been further improved.)

Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]

* Take on the maintenance of Java filetype and syntax files

4052474a1b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-04-16 09:32:55 +08:00
zeertzjq 14fb2ef4fb
vim-patch:8.2.3415: Vim9: not all function argument types are properly checked (#28362)
Problem:    Vim9: Not all function argument types are properly checked.
Solution:   Add and improve argument type checks. (Yegappan Lakshmanan,
            closes vim/vim#8839)

fc3b775055

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-16 09:32:36 +08:00
zeertzjq 3ce85b7c8a
Merge pull request #28357 from zeertzjq/vim-9.1.0322
vim-patch:9.1.{0322,0323,0324}: filetype not recognized
2024-04-16 08:50:02 +08:00
zeertzjq ca2f24cbbd vim-patch:9.1.0324: filetype: some json files are not recognized
Problem:  filetype: some json files are not recognized
Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype
          (Wu, Zhenyu)

See:
- https://github.com/microsoft/PowerToys/blob/main/.vsconfig
- https://jscs-dev.github.io/

closes: vim/vim#14452

c59a8648b2

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:32:08 +08:00
zeertzjq fcf17c8859 vim-patch:9.1.0323: filetype: cabal config files may not be recognized
Problem:  filetype: cabal config files may not be recognized
Solution: Change filetype pattern to '*/{,.}cabal/config'
          (Wu Zhenyu)

closes: vim/vim#14498

799dedec0e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:22:37 +08:00
zeertzjq 6717cc5b41 vim-patch:9.1.0322: filetype: some mail tools not recognized
Problem:  filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
          and '.notmuch-config' as ini filetype
          (Shane-XB-Qian)

closes: vim/vim#14533

a7a9a476cf

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-04-16 08:19:17 +08:00
zeertzjq b4ddee1116
vim-patch:fb8f31ea7d7f (#28356)
runtime(doc): document pandoc compiler and enable configuring arguments

closes: vim/vim#14550

fb8f31ea7d

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-16 08:13:21 +08:00
Josef Litoš 8c970d3403
vim-patch:dd83b63eb5b7 (#28351)
runtime(i3config/swayconfig): update syntax scripts

modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only

closes: vim/vim#14544

dd83b63eb5
2024-04-16 07:48:15 +08:00
zeertzjq b35f08ddb1
vim-patch:9.1.0334: No test for highlight behavior with 'ambiwidth' (#28354)
Problem:  No test for highlight behavior with 'ambiwidth'.
Solution: Add a screendump test for 'ambiwidth' with 'cursorline'.
          (zeertzjq)

closes: vim/vim#14554

a59e031aa0
2024-04-16 06:50:23 +08:00
Justin M. Keyes 5ed9916a28 feat(diagnostic): enable(…, opts)
Problem:
vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable()

Solution:
- Change the signature so that the first 2 args are (bufnr, enable).
- Introduce a 3rd `opts` arg.
    - Currently it only supports `opts.ns_id`.
2024-04-15 21:32:31 +02:00
Ivan Georgiev 603f3b36a4
fix(checkhealth): error in node.js check #28348
Problem:
:checkhealth node.js check fails:

    ERROR Failed to run healthcheck for "provider.node" plugin ...
    node/health.lua:98: attempt to call local 'message' (a string value)

`message` is called as a function, when it is actually a string.

Solution:
Pass `message` to `warn()` as an argument.

Fix #28346
2024-04-15 09:23:22 -07:00
Gregory Anders 533e01a75b
fix(base64): properly handle embedded NULLs when decoding (#28349) 2024-04-15 11:06:54 -05:00
Justin M. Keyes 26765e8461 feat(diagnostic): is_enabled, enable(…, enable:boolean)
Problem:
`vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary
and inconsistent with the "toggle" pattern (established starting with
`vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276

As a reminder, the rationale is:
- we always need `enable()`
- we always end up needing `is_enabled()`
- "toggle" can be achieved via `enable(not is_enabled())`
- therefore,
    - `toggle()` and `disable()` are redundant
    - `is_disabled()` is a needless inconsistency

Solution:
- Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)`
    - Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`.
- Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
2024-04-15 13:54:33 +02:00
Justin M. Keyes 57adf8c6e0
fix(vim.ui): open() may wait indefinitely #28325
Problem:
vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986

Solution:
- Change `vim.ui.open()`:
    - Do not call `wait()`.
    - Return a `SystemObj`. The caller can decide if it wants to `wait()`.
- Change `gx` to `wait()` only a short time.
    - Allows `gx` to show a message if the command fails, without the
      risk of waiting forever.
2024-04-15 04:33:09 -07:00
zeertzjq 4ec8fd43bf
fix(api): make width/height for split by nvim_open_win work (#28341) 2024-04-15 17:55:57 +08:00
zeertzjq 5371ed36b7
Merge pull request #28339 from zeertzjq/vim-9.1.0321
vim-patch:9.1.{0321,0328}
2024-04-15 08:30:27 +08:00
zeertzjq ba24dab8d6 vim-patch:9.1.0328: CI fails with t_?? test
Problem:  CI fails with t_?? test
Solution: use assert_match instead of assert_equal
          and test only until t_xo, depending on system
          there may be several more termcap codes coming

0d87e3c711

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-15 08:00:29 +08:00
zeertzjq dea0d50f7f vim-patch:9.1.0321: Garbled output on serial terminals with XON/XOFF flow control
Problem:  When used terminal with XON/XOFF flow control, vim tries to
          still make CTRL-S mapping available, which results in severe
          screen corruption, especially on large redraws, and even
          spurious inputs (John Tsiombikas)
Solution: Disallow CTRL-S mapping if such terminal is recognized.
          Don't remove IXON from the bitmask inversion.
          (Anton Sharonov)

*** When started like this:

    TERM=vt420 vim

:set termcap

    shows "t_xon=y"

map <C-S> :echo "abc"<CR>

    does nothing (after <C-S> output freezes and subsequent <C-Q>
    unfreezes it)

*** When started like this:

    TERM=xterm vim

:set termcap

    shows "t_xon="

map <C-S> :echo "abc"<CR>

    works (after <C-S> one see "abc" string echo-ed)

fixes: vim/vim#12674
closes: vim/vim#14542

49528da8a6

Co-authored-by: Anton Sharonov <anton.sharonov@gmail.com>
2024-04-15 07:59:45 +08:00
zeertzjq 0f5c94c04b
vim-patch:4ba70cab37d2 (#28338)
runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)

Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.

Fixes vim/vim#14393

4ba70cab37

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-15 07:46:14 +08:00
zeertzjq bcfad7fe62
vim-patch:e92ed1b45c54 (#28337)
runtime(vim): don't set compiler, update a comment for vimdoc compiler (vim/vim#14532)

e92ed1b45c

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2024-04-15 07:39:32 +08:00
zeertzjq 43f8d7e3ef
vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
Problem:  String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
          (without having to convert it to string() first)
          (Yegappan Lakshmanan)

fixes: vim/vim#14529
closes: vim/vim#14541

f01493c550

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-15 07:11:39 +08:00
Sean Dewar 7180ef6901
feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192
Problem: noautocmd is confusing; despite its name, it doesn't block all
autocommands (instead it blocks only those related to setting the buffer), and
is commonly used by plugins to open windows while producing minimal
side-effects.

Solution: be consistent and block all autocommands when noautocmd is set.
This includes WinNew (again), plus autocommands from entering the window (if
enter is set) like WinEnter, WinLeave, TabEnter, .etc.

See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517
for more information.

Remove win_set_buf's noautocmd argument, as it's no longer needed.

NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its
callers already use block_autocmds.

Despite that, pum_create_float_preview doesn't actually properly handle
autocommands (it has no checks for whether those from win_enter or
nvim_create_buf free the window).

For now, ensure autocommands are blocked within it for correctness (in case it's
ever called outside of a block_autocmds context; the function seems to have been
refactored in #26739 anyway).
2024-04-14 16:10:16 -07:00
Christian Clason e3fb937545 build(deps): bump tree-sitter to v0.22.5 2024-04-15 01:02:28 +02:00
zeertzjq 6685481dfa
vim-patch:9.1.0320: Wrong cursor position after using setcellwidths() (#28334)
Problem:  Wrong cursor position after using setcellwidths().
Solution: Invalidate cursor position in addition to redrawing.
          (zeertzjq)

closes: vim/vim#14545

05aacec6ab

Reorder functions in test_utf8.vim to match upstream.
2024-04-15 06:11:30 +08:00
zeertzjq 1d73ecda7f
vim-patch:9.1.0319: Using heredoc in string not tested with :execute (#28333)
Problem:  Using heredoc in string not tested with :execute.
Solution: Test with both :execute and execute() (zeertzjq).

closes: vim/vim#14546

3d93630605
2024-04-15 04:15:43 +08:00
zeertzjq aa1d0ac095
fix(defaults): only repeat macro for each selected line if linewise (#28289)
As mentioned in #28287, repeating a macro for each selected line doesn't
really make sense in non-linewise Visual mode.

Fix #28287
2024-04-15 03:43:33 +08:00