Commit Graph

31477 Commits

Author SHA1 Message Date
Gregory Anders
4eaf9371ca
docs: cleanup news.txt (#31854)
Move non-breaking changes out of the breaking changes section
2025-01-04 12:39:57 -06:00
Justin M. Keyes
975c2124a6
test: use spawn_wait() instead of system() #31852
Problem:
Tests that need to check `nvim` CLI behavior (no RPC session) create
their own ad-hoc `system()` wrappers.

Solution:
- Use `n.spawn_wait` instead of `system()`.
- Bonus: this also improves the tests by explicitly checking for
  `stdout` or `stderr`. And if a signal is raised, `ProcStream.status`
  will reflect it.
2025-01-04 06:29:13 -08:00
Christian Clason
7ddadd0fee vim-patch:cd96075: runtime(java): Quietly opt out for unsupported markdown.vim versions
fixes vim/vim#16349
closes: vim/vim#16369

cd96075cde

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2025-01-04 10:35:00 +01:00
Justin M. Keyes
a09c7a5d57
Merge #30384 test: spawn_wait() 2025-01-03 10:46:20 -08:00
Justin M. Keyes
700a25e621 test: include stderr in EOF failure message 2025-01-03 19:24:04 +01:00
Justin M. Keyes
a1ba655dee test: spawn_wait() starts a non-RPC Nvim process
Problem:
Can't use `n.clear()` to test non-RPC `nvim` invocations. So tests end
up creating ad-hoc wrappers around `system()` or `jobstart()`.

Solution:
- Introduce `n.spawn_wait()`
- TODO (followup PR): Rename `n.spawn()` and `n.spawn_wait()`.
  It's misleading that `n.spawn()` returns a RPC session...
2025-01-03 19:24:04 +01:00
Justin M. Keyes
fe87656f29 fix(grid): grid_line_start NULL access with 'redrawdebug'
Problem:
This test causes a null pointer dereference:

    local proc = n.spawn_wait('-l', 'test/functional/fixtures/startup-fail.lua')

    RUN      T1565 startup -l Lua Lua-error sets Nvim exitcode: 241.00 ms OK
    ==================== File …/build/log/asan.13763 ====================
    = …/src/nvim/grid.c:389:12: runtime error: null pointer passed as argument 1, which is declared to never be null
    = /usr/include/string.h:61:62: note: nonnull attribute specified here
    =     0 0x55cc2d869762 in grid_line_start …/src/nvim/grid.c:389:5
    =     1 0x55cc2d8717ca in grid_clear …/src/nvim/grid.c:618:5
    =     2 0x55cc2dbe0f6f in msg_clr_eos_force …/src/nvim/message.c:3085:3
    =     3 0x55cc2dbbbdec in msg_clr_eos …/src/nvim/message.c:3061:5
    =     4 0x55cc2dbbae2c in msg_multiline …/src/nvim/message.c:281:9
    =     5 0x55cc2dbba2b4 in msg_keep …/src/nvim/message.c:364:5
    =     6 0x55cc2dbc4992 in emsg_multiline …/src/nvim/message.c:773:10
    =     7 0x55cc2dbc5d43 in semsg_multiline …/src/nvim/message.c:824:9
    =     8 0x55cc2d9c5945 in nlua_error …/src/nvim/lua/executor.c:158:5
    =     9 0x55cc2d9c89fd in nlua_exec_file …/src/nvim/lua/executor.c:1862:5
    =     10 0x55cc2d9f4d69 in main …/src/nvim/main.c:637:19
    =     11 0x7f319b62a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    =     12 0x7f319b62a28a in __libc_start_main csu/../csu/libc-start.c:360:3
    =     13 0x55cc2ced0f64 in _start (…/build/bin/nvim+0xc48f64) (BuildId: 309c83f8d74297c89719dae9c271dd8ec23e64c3)

Cause:
The tests use `redrawdebug=invalid` by default, but `default_grid_alloc`
skips calling `grid_alloc` when not `full_screen`.

Solution:
Check for `full_screen`.
2025-01-03 18:02:33 +01:00
Justin M. Keyes
b52531a9cb
docs: misc #31822
* docs: drop "lua-" prefix from most treesitter tags
* docs: move mouse section from tui.txt to gui.txt
* docs: misc
2025-01-03 08:29:36 -08:00
luukvbaal
21718c67dd
fix(messages): better formatting for ext_messages #31839
Problem:  Message grid newline formatting based on `msg_col` is not
          utilized with ext_messages.
Solution: Increment `msg_col` with the cell width of the chunk. Allowing
          message code that uses `msg_col` to determine when to place a
          newline to do so. E.g. when the message goes beyond `Columns`;
          this is not necessarily where the ext_messages implementation
          would want to place a newline, but it is a best guess. Message
          parsing and manipulation is still possible.
2025-01-03 08:25:06 -08:00
zeertzjq
c26951b1d6
vim-patch:fc61cfd: runtime(vim): Update matchit pattern, no Vim9 short names (#31843)
Abbreviated :enum and :interface commands are no longer supported.

fc61cfd60e

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-03 19:20:21 +08:00
Christian Clason
fa298fd2f4 vim-patch:9.1.0987: filetype: cake files are not recognized
Problem:  filetype: cake files are not recognized
Solution: detect '*.cake' files as cs filetype
          (Zoe Roux)

References:
https://cakebuild.net/

closes: vim/vim#16367

a407573f30

Co-authored-by: Zoe Roux <zoe.roux@zoriya.dev>
2025-01-03 11:45:21 +01:00
Christian Clason
b365036ab3 vim-patch:9.1.0986: filetype: 'jj' filetype is a bit imprecise
Problem:  filetype: 'jj' filetype is a bit imprecise
Solution: rename 'jj' filetype to 'jjdescription'
          (Gregory Anders)

closes: vim/vim#16364

58c44e8833

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-01-03 11:45:10 +01:00
Christian Clason
f1f42ec063 vim-patch:bde76da: runtime(jj): Support diffs in jj syntax
related: vim/vim#16364

bde76da4d0

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-01-03 11:45:10 +01:00
bfredl
6aceab7c20
Merge pull request #31635 from bfredl/vtermpirates
feat(terminal): support grapheme clusters, including emoji
2025-01-03 10:43:22 +01:00
luukvbaal
43d552c566
feat(ui): more intuitive :substitute confirm prompt #31787
Problem:  Unknown key mappings listed in substitute confirm message.
Solution: Include hints as to what the key mappings do.
2025-01-02 06:40:39 -08:00
luukvbaal
48e2a73610
feat(ui)!: emit prompt "messages" as cmdline events #31525
Problem:  Prompts are emitted as messages events, where cmdline events
          are more appropriate. The user input is also emitted as
          message events in fast context, so cannot be displayed with
          vim.ui_attach().
Solution: Prompt for user input through cmdline prompts.
2025-01-02 05:51:03 -08:00
bfredl
e3bfcf2fd4 feat(terminal): support grapheme clusters, including emoji 2025-01-02 12:55:11 +01:00
Jaehwang Jung
9d9ee3476e fix(lsp): ensure watcher cancel
* Cancel watcher in the "force" case.
* Cancel watcher outside the async callback. It seems nvim doesn't wait
  async jobs on quitting, leaving detached inotifywait processes.
* Clean up cancelling callbacks.
2025-01-02 10:23:06 +00:00
Gregory Anders
efe1732c6f
fix(jobs): do not block UI when jobwait() doesn't block (#31803) 2025-01-01 18:43:16 -06:00
dundargoc
6dc0eb9f41 fix(vim.fs.abspath): correctly handle UNC paths 2025-01-01 23:42:42 +01:00
Justin M. Keyes
dc692f553a
docs: misc #31479 2025-01-01 12:29:51 -08:00
Famiu Haque
9d114b7205
refactor(options): use const in more places (#31791) 2025-01-01 07:45:14 -06:00
Christian Clason
59cbe64023 build(deps): bump utf8proc to v2.10.0 2025-01-01 00:04:27 +01:00
Gregory Anders
b5cb69f8a4
fix(tui): handle key events for arrow and function keys (#31804)
Arrow and function keys do not use CSI u with the kitty keyboard
protocol. For example, the Up arrow key uses CSI A, and the function
keys use a variety of different CSI sequences.

Until now, termkey only parsed subparams used by key events for CSI u
sequences. The result being that any key which did not use CSI u (e.g.
arrow and function keys) was being emitted twice by termkey since it was
not recognizing the separate press and release events.

This commit makes termkey also parse subparams for other key sequences
so that the release key events do not send duplicate keys.
2024-12-31 12:16:25 -06:00
Gregory Anders
a389dc2f95
feat(clipboard)!: use OSC 52 as fallback clipboard provider (#31730)
We currently enable the OSC 52 clipboard provider by setting g:clipboard
when a list of conditions are met, one of which is that $SSH_TTY must be
set. We include this condition because often OSC 52 is not the best
clipboard provider, so if there are "local" providers available Nvim
should prefer those over OSC 52.

However, if no other providers are available, Nvim should use OSC 52
even when $SSH_TTY is not set. When a user is in an SSH session then the
checks for the other clipboard providers will still (typically) fail, so
OSC 52 continues to be enabled by default in SSH sessions.

This is marked as a breaking change because there are some cases where
OSC 52 wasn't enabled before and is now (or vice versa).
2024-12-31 09:59:03 -06:00
Gustav Eikaas
0bef3b911c
fix(vim.fs): joinpath() does not normalize slashes on Windows #31782 2024-12-31 07:40:05 -08:00
dundargoc
b3bdba5cb1 ci(news): trigger job for perf commit type
There is a "performance" section in news.txt so it makes sense we should
also give a reminder to update news for performance improvements.
2024-12-31 16:36:33 +01:00
dundargoc
1925000245 test: skip flaky watchdirs() test on macos 2024-12-31 15:54:06 +01:00
Gregory Anders
4fb3b57a19
feat(tui): handle kitty key events in libtermkey (#31727)
Enable key event reporting in the kitty keyboard protocol. This causes
supporting terminals to send key events for presses, repeats, and key
releases. For now we ignore release events, but eventually we will
support users mapping those.
2024-12-31 08:29:14 -06:00
Mathias Fussenegger
e00cd1ab40 feat(lsp): return resolved config for vim.lsp.config[name]
Allows to retrieve the configuration as it will be used by `lsp.enable`
- including the parts merged from `*` and rtp.

This is useful for explicit startup control
(`vim.lsp.start(vim.lsp.config[name])`)

Closes https://github.com/neovim/neovim/issues/31640
2024-12-31 13:18:05 +01:00
Christian Clason
1877cd5fcd vim-patch:9.1.0982: TI linker files are not recognized
Problem:  TI linker files are not recognized
Solution: inspect '*.cmd' files and detect TI linker files
          as 'lnk' filetype, include a lnk ftplugin and syntax
          script (Wu, Zhenyu)

closes: vim/vim#16320

39a4eb0b2c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-31 12:29:35 +01:00
Christian Clason
7ecd348b3d vim-patch:8dc98bf: runtime(chordpro): update syntax script
References:
https://chordpro.org/beta/directives-define/#defining-chords-for-keyboard-instruments

8dc98bf427

Co-authored-by: nibo <nibo@relim.de>
2024-12-31 12:17:54 +01:00
glepnir
bdc0b5f505
vim-patch:9.1.0983: not able to get the displayed items in complete_i… (#31796)
vim-patch:9.1.0983: not able to get the displayed items in complete_info()

Problem:  not able to get the displayed items in complete_info()
          (Evgeni Chasnovski)
Solution: return the visible items via the "matches" key for
          complete_info() (glepnir)

fixes: vim/vim#10007
closes: vim/vim#16307

d4088edae2
2024-12-31 19:12:50 +08:00
zeertzjq
57f10abbc2
vim-patch:9.1.0981: tests: typo in test_filetype.vim (#31794)
Problem:  tests: typo in test_filetype.vim
Solution: fix comment, update lnkmap syntax file and add
          DESCT keyword
          (Wu, Zhenyu)

closes: vim/vim#16348

2bee7e43e1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-31 08:41:54 +08:00
Gregory Anders
e9c077d197
fix(termkey): fix null pointer dereference (#31792) 2024-12-30 16:36:47 -06:00
Christian Clason
259573db83 vim-patch:48fa319: syntax(sh): Improve the recognition of bracket expressions
- Define a general non-"contained" "shBracketExpr" group,
  and replace with it the "contained" bracket variant of
  "shOperator", adjusting the patterns for the competing
  conditional commands "[" and "[[".
- Accommodate some unbalanced brackets (e.g. "[!][!]").
- Make the leading "!" (or "^") stand out in NON-matching
  bracket expressions.
- Support literal newlines in parametric patterns (along
  with pathname globbings and "case" patterns).
- Also match bracket expressions in:
  * parametric patterns (e.g. "${1#[ab]_}");
  * pathname globbings (e.g. "[ab]*.txt");
  * arguments for the "[[", "echo", and "print" commands.
- Recognise collating symbols (e.g. "[.a.]") and equivalence
  classes (e.g. "[=a=]").
- Recognise end patterns for a pattern substitution form of
  parameter expansion and match bracket expressions in such
  patterns (e.g. "${1/%[.!]/;}").

fixes vim/vim#15799
closes: vim/vim#15941

References:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_03_05
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_14
https://git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=37b7e91d64ad10b1a1815d12128c9475636df670
http://www.mirbsd.org/htman/i386/man1/mksh.htm

48fa3198b7

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-12-30 12:11:11 +01:00
zeertzjq
d077e31cc9
vim-patch:9.1.0978: GUI tests sometimes fail when setting 'scroll' options (#31785)
Problem:  GUI tests sometimes fail when setting 'scroll' options
Solution: decrease the 'scroll' and 'scrolljump' option value from 20 to
          15, in case the Gui window is not large enough to handle 20.

tests: decrease the scroll and scrolljump values

the gui tests sometimes fail with:

```
From test_options_all.vim:
Found errors in Test_opt_set_scroll():
Caught exception in Test_opt_set_scroll(): Vim(set):E49: Invalid scroll size: scroll=20 @ command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[617]..function RunTheTest[57]..Test_opt_set_scroll, line 7
Found errors in Test_opt_set_scrolljump():
Caught exception in Test_opt_set_scrolljump(): Vim(set):E49: Invalid scroll size: scrolljump=20 @ command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[617]..function RunTheTest[57]..Test_opt_set_scrolljump, line 9
```

closes: vim/vim#16337

2e1f757f7b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-12-30 19:06:31 +08:00
Christian Clason
7b739248a1 vim-patch:9.1.0977: filetype: msbuild filetypes are not recognized
Problem:  filetype: msbuild filetypes are not recognized
Solution: detect msbuild files as xml filetype
          (Gustav Eikaas)

closes: vim/vim#16339

32b7e3a8c9

Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
2024-12-30 12:01:26 +01:00
Igor
e4bc8b5967 fix(treesitter.foldexpr): only refresh valid buffers
Problem: autocmd to refresh folds always uses the current buffer if the
option type is local. However, the current buffer may not have a parser,
and thus the assert that checks for a parser could fail.

Solution: check if the foldinfo contains the buffer, and only refresh if
so.
2024-12-29 16:24:19 +00:00
Maria José Solano
02097e43c8 fix(lsp): check if sig_help window is focusable when configuring cycle keymap 2024-12-29 16:23:23 +00:00
Christian Clason
0e880b5612 vim-patch:9.1.0972: filetype: TI linker map files are not recognized
Problem:  filetype: TI linker map files are not recognized
Solution: detect TI linker map files as lnkmap filetype
          (Wu, Zhenyu)

References:
https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html

closes: vim/vim#16324

5113831d16

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-29 16:15:00 +01:00
Christian Clason
493b6899ee vim-patch:9.1.0971: filetype: SLNX files are not recognized
Problem:  filetype: SLNX files are not recognized
Solution: detect '*.slnx' files as xml filetype
          (Gustav Eikaas)

References:
https://blog.ndepend.com/slnx-the-new-net-solution-xml-file-format/
https://blog.jetbrains.com/dotnet/2024/10/04/support-for-slnx-solution-files/

closes: vim/vim#16334

3b3318b640

Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
2024-12-29 16:15:00 +01:00
Christian Clason
76abe6bab5 vim-patch:df67fc0: runtime(sh): set shellcheck as the compiler for supported shells
closes: vim/vim#16311

df67fc0e69

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-12-29 16:06:59 +01:00
zeertzjq
d7784225bc
vim-patch:f2e08a1: runtime(doc): Fix documentation typos (#31768)
closes: vim/vim#16333

f2e08a1e54

Numbers with quotes are N/A.

Co-authored-by: h-east <h.east.727@gmail.com>
2024-12-29 20:50:38 +08:00
Jaehwang Jung
48acbc4d64 fix(treesitter.foldexpr): refresh in the buffers affected by OptionSet 2024-12-29 07:35:39 +00:00
zeertzjq
d3951be4a0
vim-patch:9.1.0968: tests: GetFileNameChecks() isn't fully sorted by filetype name (#31763)
Problem:  tests: GetFileNameChecks() isn't fully sorted by filetype name
Solution: re-sort the list

closes: vim/vim#16322

e51043ad9f
2024-12-29 08:56:32 +08:00
Luca Saccarola
2b07b14eac
vim-patch:9.1.0965: filetype: sh filetype set when detecting the use of bash (#31749)
Problem:  filetype: sh filetype set when detecting the use of bash
Solution: when bash is detected, use 'bash' filetype instead
          (Luca Saccarola)

closes: vim/vim#16309

b9b762c21f
2024-12-28 19:20:50 +08:00
zeertzjq
bc624ccffd
vim-patch:e6ccb64: runtime(doc): fix doc error in :r behaviour (#31755)
closes: vim/vim#16316

e6ccb643a6

Co-authored-by: Martino Ischia <ischiamartino@gmail.com>
2024-12-28 11:06:18 +00:00
Famiu Haque
5180707310 feat(lua): add vim.fs.abspath
Problem: There is currently no way to check if a given path is absolute or convert a relative path to an absolute path through the Lua stdlib. `vim.fs.joinpath` does not work when the path is absolute. There is also currently no way to resolve `C:foo\bar` style paths in Windows.

Solution: Add `vim.fs.abspath`, which allows converting any path to an absolute path. This also allows checking if current path is absolute by doing `vim.fs.abspath(path) == path`. It also has support for `C:foo\bar` style paths in Windows.
2024-12-28 11:40:39 +01:00
Christian Clason
48c09ed4d9 vim-patch:6c57c30: runtime(compiler): include a basic bash syntax checker compiler
See @saccarosium 's suggestion at
https://github.com/vim/vim/pull/16311#issuecomment-2563447885

closes: vim/vim#16314

6c57c30ad4

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-28 00:35:32 +01:00