Commit Graph

8845 Commits

Author SHA1 Message Date
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
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
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
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
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
0412527a40 feat(outline): smaller indentation #34005 2025-05-22 02:21:34 -07: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
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
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
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
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
8e8f4523c6 fix(extui): translate <Tab> in cmdline text (#34055)
Problem:  <Tab> is not translated on the cmdline, and exposes a wrong
          assumption in search messages that may contain multiple chunks.
Solution: Translate unprintable characters in the cmdline content.
          Extract the 'search_count' from the last chunk and route
          'search_cmd' to cmdline to handle multiple chunks.
2025-05-17 11:24:05 +02:00
f40e140083 build(deps): bump luv to 1.51.0-1 2025-05-17 10:59:14 +02:00
99384fcd9c vim-patch:9.1.1396: 'grepformat' is a global option (#34060)
Problem:  The 'grepformat' option is global option, but it would be
          useful to have it buffer-local, similar to 'errorformat' and
          other quickfix related options (Dani Dickstein)
Solution: Add the necessary code to support global-local 'grepformat',
          allowing different buffers to parse different grep output
          formats (glepnir)

fixes: vim/vim#17316
closes: vim/vim#17315

7b9eb6389d

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-17 00:20:20 +00:00
1be2fdb910 vim-patch:6451e5f: runtime(gleam): add @Spell clusters to syntax script
closes: vim/vim#17324

6451e5f517

Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-16 10:49:40 +02:00
469541c415 vim-patch:1aa68df: runtime(pandoc): update YAML metadata block parsing in compiler runtime
Previously the incorrect regexp forced title to be a single letter
because of using '+' instead of the '\+' regexp modifier.

closes: vim/vim#17321

1aa68dffbf

Co-authored-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
2025-05-16 10:49:40 +02:00
70eb416459 fix(extui): better message highlighting after carriage return (#34034)
Problem:  Incorrect message highlighting for highlighted message
          chunks containing carriage returns.
Solution: Add a highlight for each substring ending in a newline or
          carriage return separately.
2025-05-15 17:23:01 +02:00
d25eb246ef revert: show "g<" hint when message spills 'cmdheight'
Problem:  Hint message to press "g<" for message that spills
          'cmdheight' is too intrusive.
Solution: Remove the hint message. Document the meaning of the spill
          indicator instead.
2025-05-14 15:36:42 +02:00
4d56dc43c0 fix(extui): handle carriage return in messages
Problem:  Carriage return should place the "write cursor" at the start of a line.
Solution: Construct the to be printed line by iterating over carriage returns.
2025-05-14 15:36:42 +02:00
570e62d0f9 docs(diagnostic): add on_jump example (#33933) 2025-05-13 19:39:05 -07:00
4fae013a21 feat(diagnostic): add enabled filter (#33981) 2025-05-13 19:32:00 -07:00
cc78f88201 fix(extui): adjust which messages are sent to "more" window
Problem:  Decision whether message is sent to "more" window is based on
          the number of newlines present in a message, rather than the
          actual text height.
          With the "box" target, messages that come from a cmdline
          entered command are not always routed to the more window.
Solution: Still write the message to the target buffer, and calculate
          the actual text height. Postpone updating several state
          variables until after the decision to re-route is made.
          With the "box" target, only consider the text height of the
          message if it is not a message from a cmdline entered command.
2025-05-13 08:45:08 +02:00
a62e55d407 feat(extui): show "g<" hint when message spills 'cmdheight'
Problem:  Extui shows a spill indicator to hint to the user to press "g<"
          to show the output of the last command. The user may be
          unaware of this mapping.
Solution: Route a hint message to the message "box" window.
2025-05-13 08:45:08 +02:00
cc6ee59f5a Merge pull request #33994 from brianhuster/vim-3704b5b
vim-patch:37045b5,9.1.1384 && fix(tutor): `l:lang` is undefined
2025-05-13 10:07:51 +08:00
2f24ae8de4 feat(diagnostic): add format option to setloclist/setqflist (#33977) 2025-05-12 20:50:37 -04:00
c681336e3c fix(diagnostic): accept multiple namespaces when setting loclist/qflist (#33982) 2025-05-12 20:13:26 -04:00
e5665754d1 fix(tutor): l:lang is undefined
Problem:
The scope `elseif $LC_MESSAGES =~ '\a\a' || $LC_MESSAGES ==# "C"` in
function `s:Locale` in file `runtime/autoload/tutor.vim` leaves a case
when l:lang is not defined.

Solution:
Define `l:lang` at function scope instead of `if` scope
2025-05-13 06:54:48 +07:00