Commit Graph

32779 Commits

Author SHA1 Message Date
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
dbe17da120 fix(diagnostic): deprecate float in vim.diagnostic.Opts.Jump (#34037) 2025-05-19 19:44:26 -07:00
1524868711 vim-patch:5a8f995: runtime(doc): remove outdated Contribution section in pi_tutor (#34094)
Problem:  The Github repo link in the Contribution section has been
          archived for 5 years. So people who want to contribute to the
          tutor plugin should just send PR to Vim repo, similar to most
          other Vim features, so there is no need for a Contribution
          section in the plugin doc.

Solution: Replace it with an Original Author note at the beginning of
          the help document.

closes: vim/vim#17341

5a8f9958e2
2025-05-20 00:21:30 +00:00
8d397fa458 feat(exrc): stop searching in parent directories by unsetting 'exrc'
Problem:
No way for a user to limit 'exrc' search in parent directories (compare
editorconfig.root).

Solution:
A configuration file can unset 'exrc', disabling the search for its
parent directories.
2025-05-20 00:03:14 +02:00
2045e9700c Don't set manwidth wider than the window (#34078)
fix: set manwidth to not exceed the window width

If we set the MANWIDTH variable to a value wider than the window, the
contents wrap and formatting breaks. A more sensible way to handle this
is to interpret MANWIDTH as a maximum width, but to set the width to the
window size if smaller.

See also: #9023, #10748.
2025-05-19 12:37:03 -05:00
dfad613813 Merge pull request #33884 from neovim/dependabot/github_actions/mlugg/setup-zig-2
ci: bump mlugg/setup-zig from 1 to 2
2025-05-19 16:07:58 +02:00
dc6fc11b87 fix(defaults): start exrc search from parent directory
Problem:
The exrc file in the current directory is executed twice, here and in
`do_exrc_initalization()`.

Solution:
Start search from parent directory. Let core handle exrc in current
directory.
2025-05-19 15:16:36 +02:00
dc6885dc24 vim-patch:9.1.1398: completion: trunc does not follow Pmenu highlighting attributes (#34084)
Problem:  When items are combined with user-defined highlight attributes
          (e.g., strikethrough), trunc inherits these attributes, making
          the text difficult to read.
Solution: trunc now uses the original Pmenu and PmenuSel highlight
          attributes (glepnir)

closes: vim/vim#17340

0816f17e9a

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-19 08:11:54 +08:00
3a35fdc347 feat(clipboard): wayclip primary clipboard and correct mimetype (#33990)
* Don't specify wayclip mimetype

Problem:  Since wayclip 0.2, wayclip assumes UTF-8
          (text/plain;charset=utf-8) in absence of an explicit mimetype.
	  Since Neovim sets the mimetype to "text/plain" without
	  specifying UTF-8, you will also have to use `-t text/plain`
	  when using waypaste or wayclip outside of Neovim.

Solution: Don't specify mimetype when using wayclip, thereby using the
          default "text/plain:charset=utf-8".

* Add primary clipboard support to wayclip

wayclip have had support for primary clipboard for some time now.

---------

Co-authored-by: Fredrik Foss-Indrehus <fred@ffoss.net>
2025-05-19 07:44:13 +08:00
a87aa68ed0 Merge pull request #34071 from bfredl/tagutf
refactor(helptags): remove useless homegrown encoding check
2025-05-18 11:36:12 +02:00
23c214ed4a build(deps): bump uncrustify to 0.81.0 2025-05-18 09:59:21 +02:00
5661f74ab2 Merge pull request #34075 from zeertzjq/vim-a577e42
vim-patch: Vim syntax updates
2025-05-18 07:06:55 +08:00
ba237ce96c vim-patch:a577e42: runtime(vim): Update base-syntax, improve script-interface command highlighting
- Normalise interface heredoc highlighting with that used for
  :let-heredocs.
- Remove interface feature testing.  The Lua and Python interface
  command scripts are now highlighted by default.  Loading all syntax
  files incurs an undesirable load-time burden so highlighting of the
  less popular MzScheme, Perl, Ruby and Tcl interfaces is disabled by
  default.  g:vimsyn_embed can still be used to customise the supported
  interfaces.
- Always highlight interface ex-commands as valid commands, even when
  the corresponding command-script highlighting is disabled.
- Highlight simple command-script statements as well as heredocs.
- Remove error highlighting of heredoc and statement command-script
  regions when an interface is disabled.  These are now highlighted as
  plain text.
- Allow indented heredoc end tokens when "trim" is specified.
- Match interface heredocs in :def functions.
- Fix runaway vimEmbedError regions.  These regions have been removed.
- Use python2 syntax for :python, and :pythonx when 'pyxversion' is
  appropriately set.

closes: vim/vim#15522

a577e4289c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-18 06:44:49 +08:00
913e4c6010 vim-patch:e957cba: runtime(vim): Update base-syntax, match quote separated numbers
closes: vim/vim#17250

e957cba081

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-18 06:14:16 +08:00
4a6f017bc1 build(deps): bump tree-sitter-markdown to v0.5.0 2025-05-17 19:26:34 +02:00
4eed85f9bd feat(logs): show full paths in lsp logs (#33886)
feat(logs): show full path of short_src in lsp logs

Problem:
- Cannot gf to info.short_src printed in the logs since only the last 16
  characters are printed

Solution:
- Print full info.short_src and remove ...
2025-05-17 09:57:22 -07:00