Commit Graph

32794 Commits

Author SHA1 Message Date
092e49d020 build: unset $TMUX when running tests (#34178)
This prevents Nvim TUI running in tests from thinking it's inside tmux.

Another solution is make :terminal unset $TMUX instead, but I'm not sure
if that'll break some other use cases.
2025-05-27 07:47:28 +08:00
a2daa3c0c0 Merge pull request #34193 from zeertzjq/vim-a6172f8
vim-patch: Correct allowed characters at :help 'filetype'
2025-05-27 07:46:13 +08:00
fbf5fbacc2 vim-patch:f0c7090: runtime(doc): trailing whitespace in options.txt, delete it.
f0c7090a38

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-27 07:24:56 +08:00
e35a7d4782 vim-patch:a6172f8: runtime(doc): Correct allowed characters at :help 'filetype'
closes: vim/vim#17366

a6172f8c5c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-27 07:24:18 +08:00
5e64d92411 perf(runtime): vim.trim for long only whitespace strings 2025-05-26 22:41:12 +01:00
ba1cc9e10c vim-patch:69c3493: runtime(doc): clarify license conditions for distributed runtime files
related: vim/vim#17372

69c3493adc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-26 17:51:24 +02:00
aa9fd08034 vim-patch:c8b7e61: runtime: Add license information for HCL and Terraform runtime files
fixes: vim/vim#17372
closes: vim/vim#17377

c8b7e6129a

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-05-26 17:51:24 +02:00
c973c7ae6f fix(extui): write each message chunk pattern separately (#34188)
Problem:  Bulking message lines to write in a single API call is
          complicated and still not correct w.r.t. overwriting
          highlights.
Solution: Write each chunk pattern separately with it's highlight
          such that it will be spliced correctly for message chunks
          that contain a carriage return. Go with correctness over
          performance until this proves to be too inefficient.
          Also add an identifying name to the various extui buffers.
2025-05-26 16:25:45 +02:00
a6e2c22347 test: format decoration_spec.lua (#34181)
Problem: Currently when I run `make format` this is the one file outside
of my changes that isn't currently formatted.

Solution: Format this file.
2025-05-26 09:24:45 +08:00
bd01bd6564 vim-patch:9.1.1407: Can't use getpos('v') in OptionSet when using setbufvar() (#34177)
Problem:  Can't use getpos('v') in OptionSet when using setbufvar().
Solution: Don't reset Visual selection when switching to the same
          buffer (zeertzjq).

closes: vim/vim#17373

5717ee33db
2025-05-25 22:51:15 +00:00
4db58f78b4 fix(lsp): announce normalizesLineEndings capability (#34175) 2025-05-25 15:04:38 -07:00
52868977ae refactor(lsp): use vim.validate in vim.lsp.log (#34165) 2025-05-25 15:04:23 -07:00
8b9500c886 fix(system): don't treat NUL at start as no input (#34167) 2025-05-25 09:28:11 +08:00
06043af27d Merge pull request #34054 from bfredl/looking_glass
build.zig: LuaJIT / unittests
2025-05-24 22:05:32 +02:00
af947f0107 ci: bump zig to 0.14.1 2025-05-24 21:05:24 +02:00
e25b99c5b6 feat(build): make build.zig run unittests 2025-05-24 21:05:24 +02:00
c4501e98f2 feat(build): make build.zig use luajit on main plattforms 2025-05-24 21:05:24 +02:00
a96665cf48 fix(extui): using tracked message column in cleared buffer (#34154)
Problem:  Using tracked message column as column in cleared buffer.
Solution: Ensure column does not exceed current line length.
          Further work to ensure carriage return and cmdline block mode
          work properly.
2025-05-24 20:31:20 +02:00
8a207b3e19 build(deps): bump tree-sitter-c to v0.24.1 2025-05-24 20:02:29 +02:00
baabc35987 fix(treesitter): properly clip nested injections 2025-05-24 11:51:11 +01:00
a59b052857 fix(extui): map wincmd instead of remapped key (#34151)
Problem: "q" cannot close window when `<c-w>` is mapped.
Solution: Map q to `<Cmd>wincmd c<CR>`.
2025-05-24 12:02:11 +02:00
c9d8468020 feat(search): increase MAX_COUNT to 999
Problem: "99 searchcount ought to be enough for anyone."

Solution: Increase `SEARCH_STAT_DEF_MAX_COUNT` to 999, which I'm sure
will suffice for the next twenty years.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-24 10:55:43 +02:00
9784bc1346 fix(extui): append consecutive :echon messages
Problem:  Consecutive `:echon` messages are printed on separate lines.
Solution: Implement the new msg_show->append parameter.
2025-05-24 01:02:22 +02:00
abb40ecedd feat(ui): "append" parameter for "msg_show" UI events
Problem:  Consecutive "msg_show" events stemming from an `:echon`
          command are supposed to be appended without a newline, this
          information is not encoded in the "msg_show" event.
Solution: Add an "append" parameter to the "msg_show" event that is set
          to true to indicate the message should not start on a new line.
Considered alternative: Emit a newline for the common case instead at the
start of a new message. That way UIs can more closely follow the logic
as it is implemented for the message grid currently. This would be a
breaking change. The "append" parameter seems OK.
2025-05-24 01:02:22 +02:00
7c2b4a0eaf Merge pull request #34137 from brianhuster/vim-2323f22
vim-patch: add chapter 2 of beginner tutor
2025-05-24 06:48:34 +08:00
6ce2877327 fix(move): consume skipcol before revealing filler lines (#34143)
Problem:  When scrolling (the text) down with 'smoothscroll', filler
          lines are revealed before the text skipped with `w_skipcol`.
Solution: Check `w_skipcol` before filler lines.
2025-05-24 00:45:00 +02:00
071dcab68f vim-patch:9.1.1405: tests: no test for mapping with special keys in session file (#34146)
Problem:  tests: no test for mapping with special keys in session file.
Solution: Add a special keys to an existing test.  Also test with UTF-8
          characters containing 0x80 or 0x9b bytes (zeertzjq).

closes: vim/vim#17360

9ff1e598e8
2025-05-23 22:38:12 +00:00
f791ae82e5 vim-patch:9.1.1404: wrong link to Chapter 2 in new-tutor
Problem:  wrong link to Chapter 2 in vim-01-beginner.tutor
Solution: Fix the link to Chapter 2, add test for links in tutor files
          (Phạm Bình An)

In order to write the test, I exposed the function `s:GlobTutorials` as
`tutor#GlobTutorials` and make it also accept a `locale` argument.

closes: vim/vim#17356

e8302da74a

Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
2025-05-23 09:59:43 +07:00
41c850e2c8 vim-patch:2323f22: runtime(new-tutor): add chapter two to the interactive tutorial
closes: vim/vim#16803

2323f225ca

Co-authored-by: RestorerZ <restorer@mail2k.ru>
2025-05-23 09:34:39 +07:00
079e7d2b11 vim-patch:df68419: runtime(doc): clarify the use of change marks when writing a buffer (#34132)
related: vim/vim#17008

df68419ba0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-22 23:52:12 +00:00
153a910897 vim-patch:9.1.1402: multi-byte mappings not properly stored in session file (#34131)
Problem:  multi-byte mappings not properly stored in session file
Solution: unescape the mapping before writing out the mapping, prefer
          single-byte mapping name if possible (Miguel Barro)

closes: vim/vim#17355

5b07aff2f6

Co-authored-by: GuyBrush <miguel.barro@live.com>
2025-05-23 07:42:30 +08:00
f0fb6d448a vim-patch:f4b2fce: runtime(vim): Update base-syntax, fix missing luaParenError error (#34130)
We shouldn't assume that the luaParenError syntax group is present in
the, possibly custom, included file or that it hasn't already been
removed.  However, issue vim/vim#11277 has been fixed so it no longer needs to
be cleared.

Fixes comment https://github.com/vim/vim/pull/15375#issuecomment-2899791944

related: vim/vim#15375
closes: vim/vim#17357

f4b2fce71c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-22 23:12:17 +00:00
927927e143 fix(lsp): fix error with InsertReplaceEdit events #33973
Problem:
Some LSPs cause the following completion error (reformatted slightly):

    Error executing vim.schedule lua callback:
    .../runtime/lua/vim/lsp/completion.lua:373
    attempt to index field 'range' (a nil value)

This is because an internal function assumes edits are either missing
or of type `TextEdit`, but there's a third [possibility][0] that's not
handled: the `InsertReplaceEdit`.

This was previously reported in at least two issues:

- https://github.com/neovim/neovim/issues/33142
- https://github.com/neovim/neovim/issues/33224

Solution:
Don't assume the edit is a `TextEdit`. This implicitly handles
`InsertReplaceEdit`s.

Also, add a test case for this, which previously caused an error.

[0]: 2c07428966/runtime/lua/vim/lsp/_meta/protocol.lua (L1099)
2025-05-22 06:22:47 -07:00
27bb814cb1 Merge pull request #34100 from bfredl/billions
fix(tests): fix unittests so they don't have hidden errors
2025-05-22 13:15:40 +02:00
62ba6e8a76 fix: use nvim namespace convention #34010 2025-05-22 03:40:08 -07:00
fed9069b8d fix(lsp): avoid foldclose() after current window-buffer changed #33901
Problem:
Because the buffer in the window may change before the request is completed, foldclose() might be executed on the wrong buffer.

Solution:
Avoid that.
2025-05-22 03:16:28 -07:00
2d4b028d02 fix(tests): use correct include path for unittest
Copy whatever was made to work for generated headers:

(1) we need to consider all cmake targets not just main_lib
(2) we need to add the sysroot for macOS
2025-05-22 11:56:46 +02:00
c81af9428c fix(tests): use uv.spawn instead of io.popen for unittest helpers
The old implementation of repeated_read_cmd would attempt to run the
command multiple times to handle racyness of async output. Code
like this should not be written. Instead, use the libuv event
loop to read until the process has exited and the pipe has been closed.

This causes some previous discarded errors to be propagated. Fix these
as well.
2025-05-22 11:56:46 +02:00
0412527a40 feat(outline): smaller indentation #34005 2025-05-22 02:21:34 -07:00
272e041780 fix(tests): don't surpress stderr output
This is a diabolical anti-pattern and is hiding errors which exist
currently in unittests. Also we want to see _where_ in the process
stderr was emitted, stashing it away at the end erases important
context.
2025-05-22 11:20:35 +02:00
322a6d305d feat(glob): new Glob implementation based on Peglob #33605
|vim.glob.to_lpeg()| uses a new LPeg-based implementation (Peglob) that
provides ~50% speedup for complex patterns. The implementation restores
support for nested braces and follows LSP 3.17 specification with
additional constraints for improved correctness and resistance to
backtracking edge cases.
2025-05-22 00:24:49 -07:00
172a90c245 vim-patch:b0691b4: runtime(sh): Fix various syntax highlighting problems in ksh93 scripts
- Fixed syntax highlighting for ksh93 namespace variables starting
  with '${.'
- Added support for the alarm, eloop, fds, mkservice, pids, poll and
  sha2sum builtins (which are indeed ksh93 builtins, albeit whether or
  not they are available depends on the ksh release and the compiled
  SHOPT options).
- Added support for the many Unix commands provided by ksh93's libcmd
  as builtin commands (since these are general commands, scripts for
  other shells like bash will also highlight these).
  - The dumps for the sh_0{2,5,6,8,9}.sh were recreated due to this
    change affecting commands those scripts call (e.g. 'wc').
- Enabled ${parameter/pattern/string} and friends for ksh syntax.
- Enabled case modification for ksh. See also:
  https://github.com/ksh93/ksh/commit/c1762e03
- Enabled ;;& support for ksh. See also:
  https://github.com/ksh93/ksh/commit/fc89d20a
- Added many special ksh variables using 93u+m's data/variables.c
  as a reference.

If vim can't figure out which ksh release is in play using e.g.
the hashbang path, in such a case a generic default that enables
everything and the kitchen sink will be used. Otherwise, features will
be disabled if it's absolutely known a certain feature will not be
present. Examples:
   - ERRNO is ksh88 specific, so that is locked to ksh88.
   - Only 93u+m (assumed for generic) has SRANDOM, and only 93u+m
     and 93v- have case modification support.
   - 93u+ and 93v- have VPATH and CSWIDTH variables (the latter
     is vestigal, but still present in the hardcoded variable table).
   - 93v- and ksh2020 have (buggy and near unusable) implementations
     of compgen and complete.
   - Only mksh provides function substitutions, i.e. ${|command;}.

This took the better part of my day to implement. It seems to work well
enough though. (Also had to regenerate the dumps again while testing
it, as now there are dup scripts with mere hashbang differences, used
solely for testing syntax highlighting differences.)

closes: vim/vim#17348

b0691b46bd

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2025-05-22 08:56:01 +02:00
7077c59295 fix(extui): reset message state after "search_cmd" message (#34119)
Problem:  A "search_cmd" message alters the message state (since 8e8f4523),
          unnecessarily affecting logic for messages that follow.
Solution: Reset the appropriate variables after a "search_cmd" message.
          Don't show "search_cmd" message with zero 'cmdheight'.
2025-05-21 23:34:09 +02:00
2e0158650a fix(diagnostic): accept multiple namespace in open_float() (#34073) 2025-05-21 10:54:43 -07:00
19efabafc5 fix(diagnostics): fixed virtual_text cursormoved autocmd error (#34017) 2025-05-21 10:20:37 -05:00
dd43eb445a docs(tutor): move lesson 7.2 below lesson 7.3 #33662
Problem:

- Lesson 7.3 (Cmdline Completion) teaches an important way to discover
  Nvim features. I think users should learn it before they start
  configuring Nvim
- Nvim can be configured in Lua as well, but lesson 7.2 (Configuring
  Nvim) only mentions init.vim. And I think Nvim is promoting Lua more

Solution:

- Move lesson 7.2 to be after lesson 7.3
- Lesson 7.2 should teach about init.lua

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-05-21 02:26:57 -07:00
cd9d8469b2 Merge pull request #34090 from yochem/exrc-search-parent
feat(exrc): unset 'exrc' to stop searching parent directories
2025-05-20 12:06:08 -05:00
5ad01184f3 fix(lsp/health): ensure valid table before concatenating (#34092)
The root_markers field can now contain a table of tables (as of
https://github.com/neovim/neovim/pull/33485) and :checkhealth will show
an error in that case since Lua cannot concatenate a table of tables.

Ensure that tables contain strings before concatenating and if not, fall
back to using vim.inspect().
2025-05-20 12:05:20 -05:00
849e24f3cd vim-patch:719ec0f: runtime(tar): preserve pwd when reading and writing tar files
While at it, use `:lcd` to temporarily set the window local directory
instead of `:cd` for the global working directory.

fixes: vim/vim#17334
closes: vim/vim#17339

719ec0fe15

Co-authored-by: Michele Sorcinelli <michelesr@autistici.org>
2025-05-20 08:15:27 +02:00
14631e2264 vim-patch:5ad53ca: runtime(muttrc): fix mangled keywords in syntax script
Regression introduced in commit 10f23e10a9 ("Update syntax/muttrc.vim to
latest mutt (vim/vim#12797)", 2023-08-15)

Affected keywords:
  invresume_draft_files
  invresume_edited_draft_files
  mailcap_path
  mark_macro_prefix

closes: vim/vim#17344

5ad53ca99f

Co-authored-by: Markus Heidelberg <markus.heidelberg@web.de>
2025-05-20 08:15:27 +02:00