- 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: #15522
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17316closes: #17315
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: search_stat not reset when pattern differs in case
(tahzibijafar)
Solution: use STRNCMP instead of MB_STRNICMP macro
There was a long standing todo comment, that using MB_STRNICMP is wrong.
So let's change it to STRNCMP() instead. Even if it not handle
multi-byte characters correctly, then Vim will rather recompute the
search stat, instead of re-using the old (and possibly wrong) value.
fixes: #17312closes: #17314
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tabpanel not correctly redrawn on tabonly
(Maxim Kim, after v9.1.1391)
Solution: force redraw of the tabpanel, tweak style
(Hirohito Higashi)
fixes: #17322closes: #17330
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Previously the incorrect regexp forced title to be a single letter
because of using '+' instead of the '\+' regexp modifier.
closes: #17321
Signed-off-by: Alexander Abrosimov <alexander.n.abrosimov@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17325
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Vim does not have a tabpanel
Solution: include the tabpanel feature
(Naruhiko Nishino, thinca)
closes: #17263
Co-authored-by: thinca <thinca@gmail.com>
Signed-off-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: style: more wrong indentation
Solution: reformat a few more places
(Yegappan Lakshmanan)
closes: #17309
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17311
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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)
fixes: #17317closes: #17318
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17319
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: some minor problems building on AARCH64
Solution: Update Make_cyg_ming with aarch64 specific changes,
document how to build on aarch64 using msys2 packages
closes: #17048
Signed-off-by: Christian Brabandt <cb@256bit.org>
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).
fixes: #17301closes: #17306
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17299
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17305
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The CheckVimScriptURL() function does not work properly on
pwershell. Most likely this is because curl is aliased to
Invoke-WebRequest on Powershell and redirection seems to work
slightly different
Solution: Disable CheckVimScriptURL() on Powershell and then simplify
the curl download logic
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17300
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17294
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
=============== 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: #17281
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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 #1. <!-- = : 2 -->
<p> <!-- >3 : 3 -->
Paragraph #2. <!-- = : 3 -->
</p> <!-- <3 : 3 -->
<p>Paragraph #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 #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 #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 #1] <!-- = : 5 -->
</code> <!-- <5 : 5 -->
</pre> <!-- <4 : 4 -->
</div><div class="block"><pre><code> <!-- <3 : 3 -->
[CODE SNIPPET #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 #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-tagshttps://en.wikipedia.org/wiki/Dangling_elsecloses: #17141
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- 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: #17274
Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Default to POSIX supported classes.
- Add a KornShell specific class list.
- Remove "or" from the Bash class list, presumably a typo.
closes: #17293
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Problem: MS-Windows: error when running evim when space in path of Vim
Solution: properly parse quoted strings (Miguel Barro)
When vim is installed in a path with whitespaces (like
`C:\Program Files (x86)\Vim\vim91\vim.exe`). Launching `evim` or
`vim -d` will try to open the file ` (x86)\Vim\vim91\vim.exe`.
Modern versions of vim simplify shell operation by parsing its own
command line. For example on Linux all vim flavours like `evim`, `rvim`,
etc are symlinks to vim. Then vim uses the `parse_command_name()`
function to identify which version of vim it should launch.
For `evim` if a GUI is available `gvim` is launched for better user
experience. In order to launch `gvim` the original command line is
parsed to be passed *verbatim* to the new instance.
This parsing did not properly handle quoted command lines with
whitespaces such as
```
"C:\Program Files (x86)\Vim\vim91\vim.exe" -y myfile.txt
```
closes: #17295
Signed-off-by: Miguel Barro <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17169closes: #17282
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17283
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17283
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Currently, 'smartcase' is respected when completing keywords
using <C-N>, <C-P>, <C-X><C-N>, and <C-X><C-P>. However, when
a user continues typing and the completion menu is filtered
using cached matches, 'smartcase' is not applied. This leads
to poor-quality or irrelevant completion suggestions, as shown
in the example below.
Solution: When filtering cached completion items after typing additional
characters, apply case-sensitive comparison if 'smartcase' is
enabled and the typed pattern includes uppercase characters.
This ensures consistent and expected completion behavior.
(Girish Palya)
closes: #17271
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Flag checking logic uses a temporary variable and multiple
bitwise operations in insexpand.c
Solution: Consolidate into a single equality check using bitwise OR and
comparison (glepnir)
closes: #17276
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: CI Tests favor GTK2 over GTK3
Solution: Install GTK3 dependencies and debug packages for CI workflows,
update ASAN suppression list, update required dependency
checks for the tests (Drew Vogel)
closes: #17253
Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: GTK3 and GTK4 will drop numeric cursor support.
Solution: Adopt GTK3 code and use CSS cursor convention (Drew Vogel).
closes: #14610
Signed-off-by: Drew Vogel <dvogel@github>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: too many strlen() calls in gui.c
Solution: refactor gui.c slightly (John Marriott)
This does the following changes:
- use macro STRCMP() instead of strcmp().
- refactor gui_outstr_nowrap() to remove call to STRLEN().
- refactor get_tabline_label() in attempt to simply it. At the same time
use standard looping construct for iterating over windows in a tab.
Move variables closer to where they are used. Add check that we don't
exceed size of NameBuff.
- small optimisation in get_find_dialog_text() to measure the string
length once.
closes: #17269
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>