Commit Graph

32626 Commits

Author SHA1 Message Date
3268f51d20 fix(build): musl libc build.zig 2025-05-04 22:55:19 +02:00
d4ecfc4234 fix(extui): message may overwrite active cmdline #33846
Problem:  Active cmdline may be overwritten by a message.

Solution: Check if cmdline is active before writing message.
2025-05-04 20:02:02 +00:00
ba2a5a7787 Merge pull request #33837 from bfredl/cmakeversion
fix(build): use correct cmake expression for $<CONFIG>

fixes #33835
2025-05-04 19:35:07 +02:00
72ec410134 Merge #33789 cleanup error messages 2025-05-04 08:53:29 -07:00
fc2dee1736 feat(messages): cleanup Lua error messages
"Error" in error messages is redundant. Just provide the context, don't
say "Error ...".
2025-05-04 11:22:57 -04:00
af4f7f1618 test: multiline assert_log()
Problem:
assert_log() only matches single lines. This was never an intentional
decision, it was merely a result of using read_file_list().

Note: any tests that indiscriminately match `.*` should be rewritten to
avoid (unlikely) "false positives". I checked all existing tests.

Solution:
Change assert_log() to match the concatenated lines instead of matching
per-line.
2025-05-04 10:35:07 -04:00
8f5bd569c5 feat(lsp): support documentColor dynamic registration #33800 2025-05-04 07:00:21 -07:00
5c15df449a fix(lsp): improve error completion message #33812
problem: Error notifications from LSP responses were difficult to read due to
inconsistent formatting and missing critical information like client name and error codes.

solution: Implemented a more structured error notification format using pipe separators to
clearly display client name, error code (when available), and error message.
2025-05-04 06:40:35 -07:00
91e116f3a6 fix(lsp): only auto-detach lsp.config clients #33834
Problem:
enable() routine detaches clients even if they were manually started
and not managed by vim.lsp.config.

Solution:
Skip clients that aren't managed by vim.lsp.config.
2025-05-04 06:07:11 -07:00
cb2ca54331 fix(display): cursor moves when searching with "n", "*" #29446
Problem:
When searching for the next pattern via n/N/*/#, cursor
moves to cmdline, perceived as "flicker".

Solution:
Can ui_busy_start() and ui_busy_stop().
2025-05-04 05:53:25 -07:00
f1295fe76f fix(extui): hide inactive "more" window (#33831)
Problem:  More-window is left visible after leaving it. Cursor may be
          hidden behind it and it is hard to re-enter afterwards.
Solution: Close the more-window when another window is entered.
2025-05-04 13:39:07 +02:00
921f8b0df7 fix(build): use correct cmake expression for $<CONFIG>
${CONFIG} is an empty string even when configuration is known at
configuration time. $<CONFIG> has to be used at "generation time"

Currently zig's reimplementation of cmake config headers does not
support $<CONFIG> so use a branch to pick the one which works.
2025-05-04 09:49:10 +02:00
627c648252 vim-patch:9.1.1361: [security]: possible use-after-free when closing a buffer (#33820)
Problem:  [security]: Possible to open more windows into a closing
          buffer without splitting, bypassing existing "b_locked_split"
          checks and triggering use-after-free
Solution: Disallow switching to a closing buffer. Editing a closing
          buffer (via ":edit", etc.) was fixed in v9.1.0764, but add an
          error message and check just "b_locked_split", as "b_locked"
          is necessary only when the buffer shouldn't be wiped, and may
          be set for buffers that are in-use but not actually closing.
          (Sean Dewar)

closes: vim/vim#17246

6cb1c82840
2025-05-04 03:15:51 +01:00
2c1f5a6aa5 docs: default mappings #33706
Problem:
Docs don't mention that `gc` is just a mapping, not
a builtin normal-mode command.

Solution:
Update docs for all "default mappings".
2025-05-03 15:47:59 -07:00
9274532615 fix(treesitter): invalidate conceal_lines marks #33828
Problem:  Spliced conceal_lines marks after changing the buffer text are
          left valid, concealing lines that shouldn't be.

Solution: Set the `invalidate` extmark property.
2025-05-03 22:37:02 +00:00
b877aa34cf feat(lsp): detach LSP clients when 'filetype' changes #33707
Problem:
When the buffer 'filetype' changes, invalid or non-applicable LSP
clients are not detached.

https://github.com/neovim/neovim/issues/33443
https://github.com/neovim/nvim-lspconfig/issues/3326

Solution:
In the enable() routine, check can_start() on _existing_ clients.
2025-05-03 14:57:59 -07:00
047a10bfde feat(lua): function behavior for tbl_extend, tbl_deep_extend #33819 2025-05-03 14:53:44 -07:00
8305af9bd2 fix(statusline): clear ruler when it is no longer drawn #33765
Problem:  Ruler is not cleared from the screen/ext_messages state when
          it is no longer drawn after e.g. `set noruler` or when moving
          from a floating to a regular window.
Solution: Remember if ruler was drawn and clear it.
2025-05-03 14:24:11 -07:00
6256adde2f fix(quickfix): always split from current window #33807
Problem:  `:copen` opens at the bottom by switching to `lastwin`,
           needlessly changing the window it inherits context from.

Solution:  Use the `WSP_BOT` flag to `win_split()` to open at the bottom.
2025-05-03 13:38:20 -07:00
b2a5105c66 fix(extui): search highlighting in extui "more" pager #33792
Problem:  No search highlighting in extui "more" pager window.
Solution: Only use custom highlight namespace in cmdline window.
2025-05-03 12:30:08 -07:00
joe
d0867574bd refactor(tui): redundant input->in_fd assignment #33756
Problem:
`input->in_fd = STDIN_FILENO;` was set twice during TUI initialization.

Solution:
Remove the duplicate assignment for clarity and better performance
2025-05-03 11:37:14 -07:00
902b689c4d docs(lua): typing for vim.fn.winlayout #33817
Problem:
`any[]` means nothing, and the return value is not the same as what's
documented in the comment (eg, Lua returns `{ "row", { { "leaf", 1000 },
{ "leaf", 1001 } } }`, not `{ "row", { "leaf", 1000, "leaf", 1001 } }`)

Solution:
Create two classes (vim.fn.winlayout.leaf and vim.fn.winlayout.branch)
and one alias that links the two together.

Also: Due to LuaLS limitations, there is an empty class,
vim.fn.winlayout.empty

Signed-Off-By: VoxelPrismatic <voxelprismatic@pm.me>
2025-05-03 11:34:25 -07:00
403fcacfc1 fix(window): skip unfocusable and hidden floats with "{count}<C-W>w" #33810
Problem: Using `<C-W>w`, `<C-W>W` or the ":wincmd" variants with a count can
enter unfocusable or hidden floating windows. This is especially problematic
when using the new in-development extui, which creates many unfocusable floats
for various UI elements.

Solution: Skip unfocusable and hidden floating windows. Instead, skip to the
next focusable, non-hidden window in the current tabpage's window list. Reword
the documentation a bit (hopefully an improvement?)
2025-05-03 11:30:24 -07:00
03d378fda6 feat(lsp): vim.lsp.is_enabled() #33703
Problem:
No way to check if a LSP config is enabled without causing it to
resolve. E.g. `vim.lsp.config['…'] ~= nil` will resolve the config,
which could be an unwanted and somewhat expensive side-effect.

Solution:
Introduce `vim.lsp.is_enabled()`.
2025-05-03 10:25:58 -07:00
2e35161fa1 docs: treesitter parse errors #33811 2025-05-03 10:08:53 -07:00
94bc7f47bf docs: fixups (#33815)
- Add missing diagnostics virtual lines hl groups.
- Fix LSP dynamic registration example; curbuf may not actually be attached to
  the client, and it may be attached to many such buffers.
2025-05-03 16:45:32 +01:00
f048298e9a fix(runtime): conceal paths in help, man ToC loclist #33764
Problem:
The check for concealing paths in TOCs in the qf syntax file fails
because the TOC tile has changed.

Solution:
Force the qf syntax file to be reloaded after the qf_toc variable
has been set, so that the it can apply the correct settings.

Using the explicit qf_toc key, already used in the syntax file, instead
of the title is less prone to breaking.

It was also already being set for man pages but it had no effect because
the syntax file had already been loaded when the variable was set.

Fixes #33733
2025-05-03 07:06:22 -07:00
6b233cd1a1 build(deps): bump tree-sitter-vim to v0.6.0 2025-05-03 11:29:34 +02:00
5d1fd4aca5 fix(lsp): improper diagnostic end_col computation
**Problem:** For multiline diagnostics, the end column was improperly
calculated by checking the byte index of the character position on the
*start* line.

**Solution:** Calculate the byte index for end_col using the *end* line.
2025-05-03 10:01:20 +02:00
adbd33027f fix(tui): don't try to add unsupported modifiers (#33799)
Problem:  The TUI doesn't forward a key properly when it has unsupported
          modifiers like NumLock.
Solution: Don't try to add modifiers when only unsupported modifiers are
          present.

Related #33791
2025-05-03 12:09:28 +08:00
862e676efc docs: add missing change to getcharstr() signature (#33797) 2025-05-03 08:10:13 +08:00
5a2edc483d fix(treesitter): close :InspectTree with q
Problem: `:InspectTree` window does not follow precedent for focused
"info windows" (like `checkhealth`, `Man`, etc.).

Solution: Map `q` to `<C-w>c`.
2025-05-02 21:39:11 +02:00
34c769dd89 fix(lsp): use bufnr when getting clients in symbols_to_items (#33760) 2025-05-02 14:30:02 -05:00
39a5b7f239 fix(extui): cmdline visibility, cmdheight cursor position (#33774)
Problem:  The cmdline popupmenu is hidden behind extui windows.
          'showmode' message is drawn over the cmdline.
          Changing the 'cmdheight' to accommodate space for the text in
          the cmdline may change the current cursor position.
Solution: Ensure kZIndexMessages < zindex < kZIndexCmdlinePopupMenu.
          Clear the 'showmode' message when the cmdline level is negative.
          Temporarily set 'splitkeep' = "screen" when changing the 'cmdheight'.
2025-05-02 19:46:30 +02:00
c916bdf329 fix(extui): close message window with q
Problem: Using `<c-c>` does not follow precedent (from `checkhealth`
etc.) for closing "information windows".

Solution: Use `q` for close mapping.
2025-05-02 19:09:56 +02:00
8d6f016345 vim-patch:c3f48e3: runtime(abnf): include ABNF filetype plugin
closes: vim/vim#17239

c3f48e3a76

Co-authored-by: A4-Tacks <wdsjxhno1001@163.com>
2025-05-02 17:12:18 +02:00
53b41ec7c2 Merge pull request #33776 from zeertzjq/vim-9.1.1359
vim-patch:9.1.{1359,1360}
2025-05-02 22:17:01 +08:00
da3eeb4b32 vim-patch:9.1.1360: filetype: GNU Radio companion files are not recognized
Problem:  filetype: GNU Radio companion files are not recognized
Solution: detect *.grc files as xml or yaml filetype depending on the
          first line (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/XML_GRC
- https://wiki.gnuradio.org/index.php/YAML_GRC

closes: vim/vim#17241

af4a5d6e2a
2025-05-02 21:53:18 +08:00
074a6abd55 vim-patch:9.1.1359: filetype: GNU Radio config files are not recognized
Problem:  filetype: GNU Radio config files are not recognized.
Solution: detect GNU Radio config files as confini filetype.  Only
          allow '#' as start of comment in confini syntax (zeertzjq).

Ref:
- https://wiki.gnuradio.org/index.php/Configuration_Files

closes: vim/vim#17242

9c9200d1ea
2025-05-02 21:53:15 +08:00
0741d2520d feat(messages): hl-StderrMsg, hl-StdoutMsg #33429
Problem:
stderr messages from executing ":!cmd" show up with
highlight hl-ErrorMsg. But some shell utilites use stderr for debug
logging, progress updates, etc.

Solution:
Highlight shell command outputs hl-StderrMsg and hl-StdoutMsg.
2025-05-02 06:06:55 -07:00
3c7c824bdc fix(extui): check option values after VimEnter (#33768)
Problem:  Not picking up configured option values when enabling _extui after startup.
Solution:  Check option values when enabing _extui.

Fix https://github.com/neovim/neovim/issues/33767
2025-05-02 13:13:12 +02:00
4b5364b423 fix(tui): forward C0 control codes literally (#33759)
This fixes the problem that sending a raw C0 control code to trigger a
mapping for it does not work in Terminal mode.

Note: this isn't done for 00 or 7F, as that'll be backward-incompatible.
2025-05-02 17:40:24 +08:00
1fb0126a08 fix(vim.lsp.enable): don't eagerly enable LSP configs during startup #33762
closes #33761
2025-05-02 02:05:18 -07:00
2c1c0b7af5 feat(ui): ext_cmdline/messages for the TUI #27855
Problem:  We have an unmaintained Vimscript parser and cmdline
highlighting mechanism, with which it is hard to leverage the
treesitter highlighter. Long messages result in a hit-enter-prompt.

Solution: Implement a vim.ui_attach() UI, that replaces the message
grid (orphaning some 3000+ LOC core C code). Introduce an experimental
vim._extui module, because removing the message grid at the same time is
too risky. The new UI leverages the bundled treesitter highlighter and
parser for Vimscript, as well as the matchparen plugin, to highlight the
cmdline. Messages are truncated in the cmdline area, or placed in a
floating message box in the bottom right corner. Special ("list_cmd")
messages and the message history are shown in a, "more prompt" (now a
fully interactive regular window). Various default UI elements ('showcmd',
'ruler') are also placed in the cmdline area, as virtual text.

`require('vim._extui').enable({})` enables the experimental UI.
`{ msg.pos = 'box' }` or `:set cmdheight=0` enables the message
box variant.

Followup:
  - Come to a consensus for how best to represent messages (by default).
  - Start removing message grid when this is deemed a successful replacement.
    When that is finished, make this new UI the default and update a lot of tests.
2025-05-02 02:02:02 -07:00
da401ca25b Merge pull request #28344 from bfredl/wonderland
feat(build): build.zig MVP: build and run functionaltests on linux
2025-05-02 10:34:25 +02:00
1f004970f0 feat(build): build.zig MVP: build and run functionaltests on linux
NEW BUILD SYSTEM!

This is a MVP implementation which supports building the "nvim" binary,
including cross-compilation for some targets.
As an example, you can build a aarch64-macos binary from
an x86-64-linux-gnu host, or vice versa

Add CI target for build.zig currently for functionaltests on linux
x86_64 only

Follow up items:

-  praxis for version and dependency bumping
-  windows 💀
-  full integration of libintl and gettext (or a desicion not to)
-  update help and API metadata files
-  installation into a $PREFIX
-  more tests and linters
2025-05-02 09:28:50 +02:00
ce8b755a86 vim-patch:1c58019: runtime(vim): Update base-syntax, improve enum highlighting (#33758)
Match enum values and missing class keywords.

fixes: vim/vim#15970

1c58019a82

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-02 07:26:38 +08:00
dd71a21463 vim-patch:f57c065: runtime(sh): Update syntax, highlight escaped chars in test expressions (#33757)
Highlight escape characters in unquoted test expression operands.

E.g., [[ foo == \[bar\] ]]

fixes vim/vim#17221

f57c065e75

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-02 07:25:58 +08:00
0b3c76502c vim-patch:83cb817: runtime(doc): update example ctags program and links
- :helptags is also a tags generating program, it deserves mentioning
- JTags seems too dead: its website has been sold, the source, binary
  can't be found anywhere.
- update link of ptags

closes: vim/vim#17233

83cb8174c8

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-02 07:05:22 +08:00
65a4c8f3ca vim-patch:9.1.1357: Vim incorrectly escapes tags with "[" in a help buffer
Problem:  Vim incorrectly escapes tags containing "[" in a help buffer
Solution: check if the buffer has the "help" filetype set, instead of
          already being a help buffer (Phạm Bình An)

fixes: vim/vim#17224
closes: vim/vim#17232

6af20a9be3

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-05-02 07:05:22 +08:00