Commit Graph

32713 Commits

Author SHA1 Message Date
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
2fda267faf vim-patch:9.1.1393: missing test for switching buffers and reusing curbuf
Problem:  The check in buf_freeall that restores curwin subtly prevents
          leaving an unloaded buffer in a window when reusing curbuf, if
          autocommands switch to a different buffer.
Solution: Add a test case that covers this. Also ensure splitting isn't
          possible, as that could do the same (Sean Dewar)

closes: vim/vim#17325

31be82e66d

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-15 21:05:07 +01: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
17e13ce3b6 fix(tui): clear primary device callback before invoking it (#34032)
A primary device callback may set a new callback (e.g. when suspending),
so clearing it after invoking it is too late.

While at it, add missing reset of did_set_grapheme_cluster_mode in
terminfo_start().
2025-05-15 20:42:49 +08:00
f87b6230f1 vim-patch:9.1.1388: Scrolling one line too far with 'nosmoothscroll' page scrolling (#34023)
Problem:  One-off error in "count" to make "w_skipcol" zero with
          'nosmoothscroll' page scrolling when last virtual line
          in a buffer line is exactly the entire window width.
          (Hirohito Higashi)
Solution: Properly compute the smallest integer value necessary
          to make "w_skipcol" zero (Luuk van Baal)

c6c72d165c
2025-05-15 10:01:34 +02:00
6b9665a507 vim-patch:9.1.1387: memory leak when buflist_new() fails to reuse curbuf
Problem:  buflist_new() leaks ffname and fails to reuse curbuf when
          autocommands from buf_freeall change curbuf. Plus, a new
          buffer is not allocated in this case, despite what the comment
          above claims.
Solution: Remove the condition so ffname is not leaked and so a new
          buffer is allocated like before v8.2.4791. It should not be
          possible for undo_ftplugin or buf_freeall autocommands to
          delete the buffer as they set b_locked, but to stay consistent
          with other uses of buf_freeall, guard against that anyway
          (Sean Dewar).

Note that buf is set to NULL if it was deleted to guard against the (rare)
possibility of messing up the "buf != curbuf" condition below if a new buffer
happens to be allocated at the same address.

closes: vim/vim#17319

0077282c82

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-15 08:47:49 +01:00
f2aec4bc05 vim-patch:9.1.1389: completion: still some issue when 'isexpand' contains a space (#34026)
Problem:  Cannot get completion startcol when space is not the first
          trigger character (after v9.1.1383)
Solution: Detect the next comma followed by a space in the option string
          and use in next compare loop (glepnir)

closes: vim/vim#17311

08db2f4f28
2025-05-15 06:15:29 +00: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
b0bb3cccf9 Merge pull request #34015 from bfredl/tui_scroll_state
refactor(tui): remove scroll_region_is_full_screen global state
2025-05-14 10:54:19 +02:00
2bfb12ef46 refactor(tui): remove scroll_region_is_full_screen global state
This is a left-over for when we ported to state-less scrolling events
(e.g. no scrolling regions as part of the ext_linegrid state).

We always reset the scrolling region after performing a non-fullscreen
scroll. Thus the extra check in tui_grid_resize() is not needed.
2025-05-14 10:32:14 +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
40b64e9100 refactor(treesitter): move functions from executor.c to treesitter.c 2025-05-13 15:44:42 +01: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
d539a952da vim-patch:9.1.1385: inefficient loop for 'nosmoothscroll' scrolling (#33992)
Problem:  Loop that ensures "w_skipcol" is zero with 'nosmoothscroll'
	  for (half)-page scrolling is inefficient.
Solution: Calculate the required "count" instead of looping until
	  "w_skipcol" is zero (Luuk van Baal).

acf0ebe8a8
2025-05-13 08:39:34 +02:00
e4c4d672b5 vim-patch:9.1.1383: completion: 'isexpand' option does not handle space char correct (#33999)
Problem:  When a space character is used as a trigger in 'isexpand' option
          it doesn't get recognized because skip_to_option_part() skips
          spaces after a comma, treating them as option separators
          rather than option value (after v9.1.1341)
Solution: manually set the part to a space character (glepnir).

closes: vim/vim#17305

8d0e42b710
2025-05-13 14:29:07 +08: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
e01f196e44 vim-patch:9.1.1384: still some problem with the new tutors filetype plugin
Problem:  still some problem with the new tutors filetype plugin
Solution: refactor code to enable/disable tutor mode into
          tutor#EnableInteractive() function, include a test
          (Phạm Bình An)

I find it annoying that Tutor's interactive mode is always on (or debug
mode is off) even when I open a tutor file with :edit command.
I think it makes more sense to make this "interactive mode":

- Always on when it is opened with :Tutor command
- Off otherwise

For more references, see `:help` feature, it is a much better than
:Tutor, since I don't have to run `:let g:help_debug = 1` just to be able
to edit and save a help file

Therefore, I remove `g:tutor_debug`

closes: vim/vim#17299

13bea589a2

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-13 06:54:32 +07:00
238e1d6ecc vim-patch:3704b5b: runtime(tutor): improve tutor.vim plugin and filetype plugin
- Set g:tutor_debug on startup if it doesn't exist so that users can get
  cmdline completion when interactively setting it.
- set b:undo_ftplugin in filetype plugin
- set default runtime file headers

closes: vim/vim#17274

3704b5b58a

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-13 04:38:55 +07:00
69d04ee99f Merge pull request #33987 from bfredl/bump2
fix(scripts): use right syntax for choosing ref in "zig fetch"
2025-05-12 19:14:26 +02:00
d04cbb65b9 fix(scripts): use right syntax for choosing ref in "zig fetch" 2025-05-12 13:24:38 +02:00
9c0afc8873 build(deps): bump tree-sitter-query to v0.6.0 2025-05-12 11:25:07 +02:00
7369f80b19 refactor(treesitter): remove empty parse callback
Now that we have bumped to tree-sitter 0.25.4, we no longer need to do
this since upstream does it for us when calling the regular parse
method.
2025-05-11 20:14:08 +02:00
ef5c5dc99b vim-patch:9.1.1380: 'eventignorewin' only checked for current buffer
Problem:  When an autocommand executes for a non-current buffer,
          'eventignorewin' is only checked from the buffer's last
          wininfo (overwrites win_ignore in the loop), not from the
          value of 'eventignorewin' in all windows showing the buffer as
          described (after v9.1.1084)

Solution: Fix the check and don't use wininfo, as that may only contain
          windows that recently showed the buffer. Consider all the
          buffer's windows in all tabpages (Sean Dewar).

closes: vim/vim#17294

d4110e0695

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-11 17:12:54 +01:00
23bf4c0531 feat(exrc): search in parent directories (#33889)
feat(exrc): search exrc in parent directories

Problem:
`.nvim.lua` is only loaded from current directory, which is not flexible
when working from a subfolder of the project.

Solution:
Also search parent directories for configuration file.
2025-05-11 11:00:51 -05:00
2c07428966 build(deps): bump tree-sitter to v0.25.4 2025-05-11 16:49:06 +02:00
d95b0a5396 vim-patch:9.1.1376: quickfix dummy buffer may remain as dummy buffer
Problem:  when failing to wipeout a quickfix dummy buffer, it will
          remain as a dummy buffer, despite being kept.
Solution: clear its dummy BF_DUMMY flag in this case (Sean Dewar).

closes: vim/vim#17283

270124f46a

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-11 15:31:37 +01:00
05dab80d8d vim-patch:9.1.1375: [security]: possible heap UAF with quickfix dummy buffer
Problem:  heap use-after-free possible when autocommands switch away from the
          quickfix dummy buffer, but leave it open in a window.
Solution: close its windows first before attempting the wipe.
          (Sean Dewar)

related: vim/vim#17283

b4074ead5c

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2025-05-11 15:31:37 +01:00
4b3a9ac413 vim-patch:9.1.1381: completion: cannot return to original text (#33966)
Problem:  Cannot return to the original text after selecting the next
          item when the currently selected item is the last one.
Solution: When continuing to move down past the last item, locate the
          original completion at the head/tail nodes of the completed
          linked list (glepnir).

closes: vim/vim#17300

5a18ccf490
2025-05-11 12:36:20 +00:00
59c45b22d9 fix(runtime): remove erroneously added syntax tests
fixup for a2c3591720
2025-05-11 11:54:58 +02:00
73e7e7631c build(deps): bump luv to 1.51.0-0 2025-05-11 11:08:33 +02:00
1889c351fd vim-patch:7344024: runtime(java): Search type and method declarations with "&inc" and "&def"
=============== LIMITATIONS AND OBSERVATIONS ===============

* Remember that external-type names can only be found when
  they match filenames resolvable in "&path" with "import"
  declarations; load the source file of an external type to
  look up its nested types and sibling top types, if any.

* Strive to narrow the search by assigning only relevant
  pathnames for directories *or* an archive to "&path", e.g.
  ":set path-=/usr/include".

* Use "{Visual}gf" on fully-qualified names.

* Accept the fact that "&define" cannot contain end-of-line
  characters (":help definition-search").  A declaration
  whose matchable header is not contained within a line can
  be found iff all of its non-optional components belong to
  the same line; for types, such components are a keyword,
  e.g. "class", followed by a run of blank characters and
  an identifier, e.g. "Test"; for methods: a return type,
  e.g. "String", or a keyword "void", followed by a run of
  blank characters and an identifier, e.g. "toString", that
  is followed by "(".

* The members of the "java.lang" package are usually not
  associated with "import" declarations; to look up their
  declarations, load a source file for a member of that
  package, and then use, on a simple name of interest for
  a member, either "[-Ctrl-d" etc. for local declarations
  or "gf" for external declarations, assuming that "." *or*
  the appropriate pathname for a JDK archive is assigned to
  "&path".

* Follow the above instruction made for the "java.lang"
  members for any type whose simple name is not associated
  with an "import" declaration, i.e. a member type of the
  same package that is declared in another compilation unit.

* Append the "$" character to "&iskeyword" when looking up
  declarations of generated code.

See zzzyxwvut/java-vim#4.

closes: vim/vim#17281

7344024536

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2025-05-11 10:47:39 +02:00
a2c3591720 vim-patch:dc7ed8f: runtime(html): Optionally fold tags with the "expr" method
Tag folding poses a few difficulties.  Many elements, e.g.
"blockquote", are always delimited by start and end tags;
end tags for some elements, e.g. "p", can be omitted in
certain contexts; void elements, e.g. "hr", have no end tag.
Although the rules for supporting omissible end tags are
ad-hoc and involved, they apply to elements in scope.
Assuming syntactical wellformedness, an end tag can be
associated with its nearest matching start tag discoverable
in scope and towards the beginning of a file, whereas all
unbalanced tags and inlined tags can be disregarded.

For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <p>Paragraph vim/vim#1.		<!--  = : 2 -->
    <p>				<!-- >3 : 3 -->
      Paragraph vim/vim#2.		<!--  = : 3 -->
    </p>			<!-- <3 : 3 -->
    <p>Paragraph vim/vim#3.</p>	<!--  = : 2 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

(HTML comments here, "<!-- ... -->", record two values for
each folded line that are separated by ":", a value obtained
from "&foldexpr" and a value obtained from "foldlevel()".)

Innermost foldedable tags will be flattened.  For example:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre><code>		<!-- >4 : 4 -->
[CODE SNIPPET]			<!--  = : 4 -->
      </code></pre>		<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

No folding will be requested for the "<code>"-"</code>" tag
pair and reflected by "&foldexpr" because such a fold would
have claimed the same lines that the immediate fold of the
"<pre>"-"</pre>" tag already claims.

Run-on folded tags may confuse Vim.  When a file such as:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
				<!--  = : 3 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#2]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div>			<!-- <3 : 3 -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

is reformatted as follows:
------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">		<!-- >1 : 1 -->
  <body>			<!-- >2 : 2 -->
    <div class="block">		<!-- >3 : 3 -->
      <pre>			<!-- >4 : 4 -->
	<code>			<!-- >5 : 5 -->
[CODE SNIPPET vim/vim#1]		<!--  = : 5 -->
	</code>			<!-- <5 : 5 -->
      </pre>			<!-- <4 : 4 -->
    </div><div class="block"><pre><code> <!-- <3 : 3 -->
[CODE SNIPPET vim/vim#2]		<!--  = : 2 ? -->
	</code>			<!-- <5 : 2 ? -->
      </pre>			<!-- <4 : 2 ? -->
    </div>			<!-- <3 : 2 ? -->
  </body>			<!-- <2 : 2 -->
</html>				<!-- <1 : 1 -->
------------------------------------------------------------

"&foldexpr" values will not be used as is for the lines
between (and including) "[CODE SNIPPET vim/vim#2]" and "</div>".
(Cf. v9.1.0002.)

Having syntax highlighting in effect, tag folding using the
"fold-expr" method can be enabled with:
------------------------------------------------------------
	let g:html_expr_folding = 1
------------------------------------------------------------

By default, tag folding will be redone from scratch after
each occurrence of a TextChanged or an InsertLeave event.
Such frequency may not be desired, especially for large
files, and this recomputation can be disabled with:
------------------------------------------------------------
	let g:html_expr_folding_without_recomputation = 1
        doautocmd FileType
------------------------------------------------------------

To force another recomputation, do:
------------------------------------------------------------
	unlet! b:foldsmap
	normal zx
------------------------------------------------------------

References:
https://web.archive.org/web/20250328105626/https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
https://en.wikipedia.org/wiki/Dangling_else

closes: vim/vim#17141

dc7ed8f946

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-05-11 10:47:39 +02:00
1826ad16af vim-patch:839b79e: runtime(sh): Update syntax, improve wildcard character class matching
- Default to POSIX supported classes.
- Add a KornShell specific class list.
- Remove "or" from the Bash class list, presumably a typo.

closes: vim/vim#17293

839b79eeb3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-11 10:47:39 +02:00
de45b8e275 fix(treesitter): proper tree contains() logic with combined injections
**Problem:** `LanguageTree:contains()` considers any range within the
start of the first tree and end of the last tree as "within" the
language tree. In the case of combined injections, this is problematic
because we only want to consider ranges within any of the combined trees
as "contained" (as opposed to any range within the entire range spanned
by all combined trees).

**Solution:** Use a more discriminative check in
`LanguageTree:contains()`.
2025-05-11 08:04:57 +01:00
bee45fc0e7 refactor(docs): remove unnecessary @private/@nodoc annotations (#33951)
* refactor(docs): remove `@private` annotations from local functions

* refactor(docs): remove unnecessary `@nodoc` annotations
2025-05-10 14:42:48 -07:00
8605f5655b vim-patch:9.1.1378: sign without text overwrites number option (#33942)
Problem:  When 'signcolumn' is set to `number` but a line has a sign
          without text, the line number disappears (finite-state-machine)
Solution: Verify that a sign actually contains text before rendering the
          line number (glepnir)

fixes: vim/vim#17169
closes: vim/vim#17282

1b186833c1

Co-authored-by: glepnir <glephunter@gmail.com>
2025-05-10 22:12:07 +08:00
f38f92931a vim-patch:0553f2f: runtime(doc): clarify single/multibyte support for 'fillchars' (#33941)
closes: vim/vim#17287

0553f2ff0d

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-05-10 22:11:55 +08:00
44a6e5ea99 vim-patch:6b7637e: runtime(lf): use syn iskeyword in syntax script
Sets 'syn iskeyword' in syntax/lf.vim to fix the missing lf keyword
highlighting in lines like 'map e :open; open' (first 'open' not
highlighted).

applies PR andis-sprinkis/lf-vim#21 by @joelim-work
closes: andis-sprinkis/lf-vim#14

6b7637e6bb

Co-authored-by: Andis Spriņķis <andis@sprinkis.com>
Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>
2025-05-10 15:16:19 +02:00
1c96b72dfa fix(deps): make script/bump_deps.lua update build.zig.zon versions in sync
Also bring luv version in build.zig.zon up to date

This skips some deps not currently managed/used by build.zig
2025-05-10 10:34:40 +02:00
1d9990daac fix(folds): avoid unnecessary loop with horizontal scrolling (#33932)
Fix #33931
2025-05-10 10:36:33 +08:00
9b11746d80 Merge pull request #33930 from zeertzjq/vim-17ad852
vim-patch: doc updates
2025-05-10 08:40:14 +08:00
cb12c8fa47 vim-patch:9973b39: runtime(doc): remove duplicate sentence in builtin.txt
9973b39a17

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-10 07:29:41 +08:00
1bfb8dd338 vim-patch:17ad852: runtime(doc): update return types for builtin functions
fixes: vim/vim#17273

credit: Github user @msoyka2024

17ad852a62

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-05-10 07:29:37 +08:00
db702782e0 fix(extui): close cmdwin to enter "more" window (#33860)
Problem:  Cannot enter "more" window while cmdwin is open since it is a
          regular window and changing windows is disallowed.
Solution: Close cmdwin to enter the "more" window. Minor regression
          w.r.t. the current message grid. Resolving that will require
          somehow bypassing textlock for the "more" window.
2025-05-09 23:54:39 +02:00