When a terminal application running inside the terminal emulator sets
the cursor shape or blink status of the cursor, update the cursor in the
parent terminal to match.
This removes the "virtual cursor" that has been in use by the terminal
emulator since the beginning. The original rationale for using the
virtual cursor was to avoid having to support additional UI methods to
change the cursor color for other (non-TUI) UIs, instead relying on the
TermCursor and TermCursorNC highlight groups.
The TermCursor highlight group is now used in the default 'guicursor'
value, which has a new entry for Terminal mode. However, the
TermCursorNC highlight group is no longer supported: since terminal
windows now use the real cursor, when the window is not focused there is
no cursor displayed in the window at all, so there is nothing to
highlight. Users can still use the StatusLineTermNC highlight group to
differentiate non-focused terminal windows.
BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
Fix command name termination, match bang, and allow a line-continued
argument.
closes: vim/vim#15358bbe5252c2c
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Enable folding of class, enum and interface declarations.
- Highlight constructor names with the Function highlight group, like
other special methods.
- Mark function definitions using special method names as errors.
- Highlight :type arguments.
fixes: vim/vim#14393#issuecomment-2042796198.
closes: vim/vim#13810818c641b6f
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Currently, the overriding object method definitions are
matched as vimFunctionError (:help builtin-object-methods,
v9.1.0148).
For example:
------------------------------------------------------------
vim9script
class Test
def string(): string
return "Test"
enddef
endclass
echo string(Test.new()) == Test.new().string()
------------------------------------------------------------
Instead, let's introduce a new syntax group vimMethodName
and make these methods its members. In order to emphasise
the link between the overriding methods and the overridden
functions for highlighting, vimMethodName is linked by
default to vimFuncName.
80aabaab66
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
With the arrival of Vim9 classes, the syntax must allow for
_new_ constructors; multiple constructor definitions are
supported for a class, provided distinct suffix-names are
used. Currently, the defined constructors match either
vimCommand or vimFunctionError (for any newBar).
For example:
------------------------------------------------------------
vim9script
class Foo
def new()
enddef
def newBar()
enddef
endclass
------------------------------------------------------------
Since every constructor is required to bear a lower-cased
_new_ prefix name, it should suffice to distinguish them
from functions, and so there are no new highlight or syntax
groups introduced.
dfcef890cb
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Problem: current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
function (Ruslan Russkikh).
closes: vim/vim#158230407d621bb
Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
- Allow function command modifiers.
- Match function bodies starting with empty lines.
Command modifiers reported by @Konfekt.
fixesvim/vim#15671closes: vim/vim#1567435699f1749
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match Vim9 boolean and null literals in expression arguments of :if,
:elseif, :while and :return.
closes: vim/vim#156844d427d4cab
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Match -addr and -keepscript attributes and generate -addr values.
- Match attribute errors where = is specified.
- Highlight attributes with Special like other Ex command options.
- Don't highlight user-specified completion function args.
- Match :delcommand -buffer attribute.
closes: vim/vim#155863c07eb0c67
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match '(,'),'[,'],'{, and '} marks in Ex command ranges.
Thanks to Maxim Kim.
Fixesvim/vim#15332.
Closesvim/vim#15337.
d817609b87
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match :loadkeymap after Ex colons and bars.
Don't generate :loadkeymap as it is matched with a custom syntax group.
closes: vim/vim#155547866d54ecc
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
The end marker is not required to match the indent of :let when "trim"
is specified, it may also appear without leading whitespace as normal.
closes: vim/vim#155647884cc7418
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* Improve heredoc handling
- Support "trim" for all the embedded scripts.
- Check the indent of "trim" for "let" and all the embedded scripts.
* Update missing part of vim.vim.base in the commit
d164f2a521f8e52e587727657fb1c19e9a25f32a.
* Update gen_syntax_vim.vim to catch up with 9.1.0685's source code.
closes: vim/vim#1554295e90781a4
Co-authored-by: Ken Takata <kentkt@csc.jp>
The end marker must appear on line of its own without any trailing
whitespace.
Whitespace is incorrectly allowed before all end markers. Limiting this
only to heredocs where "trim" was specified, and with the correct
indent, is currently an intractable problem given that contained syntax
groups (in this case :let) cannot be limited to start patterns.
Highlight interpolated expressions when "eval" is specified.
cloess: vim/vim#15511d164f2a521
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match :map ( RHS properly.
Only match ! after :map, :noremap, :unmap and :mapclear.
closes: vim/vim#1529799984fc58a
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match types in Vim9 variable declarations.
Match Vim9 boolean and null literals. These are not matched in all
contexts yet.
related: vim/vim#15277d65e58f6f9
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match Vim9-script comments after :def and :enddef and legacy-script
comments after :func and :endfunc, in any definition context.
Highlight incorrect comment types after these commands as errors.
fixes: vim/vim#15062closes: vim/vim#15072fc64ac0be2
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match shebang lines in Vim9 and legacy script.
Mark these as an error if they appear anywhere other than the first line
of a legacy-script file. In Vim9 script these match as normal line
comments rather than an error.
ae321b51f7
Co-authored-by: dkearns <dougkearns@gmail.com>
Match :sleep arg properly including a lone "m" with a leading count.
closes: vim/vim#15003262e25e5a1
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.
959c3c887b
Co-authored-by: dkearns <dougkearns@gmail.com>
Allow whitespace between the :substitute command and its pattern
argument. Although unusual, it is supported and there are examples in
the wild.
Match Vi compatible :substitute commands like :s\/{string}/. See :help
E1270.
fixes: vim/vim#14920closes: vim/vim#1492392f4e91590
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)
Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.
Fixesvim/vim#143934ba70cab37
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, add legacy header folding
Allow for syntax-based folding of Vim9 script legacy header regions.
This is enabled with the "H" flag of the g:vimsyn_folding config variable.
closes: vim/vim#14530ce06493aeb
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
runtime(vim): Improve Vim9 and legacy-script comment highlighting (vim/vim#13104)
This is a first-pass attempt to limit matching of Vim9 and legacy-script
comments to the appropriate syntactic contexts.
Vim9-script comments are highlighted at top level in a Vim9-script file,
in all :def functions, and in all :autocmd and :commmand command blocks.
Legacy-script comments are highlighted at top level in a legacy script
file, in all :func functions and in the Vim9-script preamble before the
:vim9script marker command.
Fixesvim/vim#13047, vim/vim#11307 and vim/vim#9587.
04e5363b82
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, no curly-brace names in Vim9 script (vim/vim#14466)
Remove curly-brace name matching for :def functions. This is not
supported in Vim9 script.
e43ace558a
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, remove old unused syntax groups. (vim/vim#14146)
Remove old unused syntax groups.
- vimRegion, vimPattern and vimKeyword removed in Vim 5.3.
- vimAuSyntax, vimAutoCmdOpt, vimAutoSet and vimStatement removed in 5.6.
The following were linked in :hi commands but never defined with :syn
and, most likely, never used:
- vimHLMod introduced in 5.0.
- vimKeycode and vimKeycodeError introduced in 5.4.
- vimElseif introduced in 5.6.
- vimFold introduced in 6.4.
- vimOperStar (and vimoperStar) introduced in 9.0.
76d62985c1
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve function definition highlighting (vim/vim#14203)
Improve function definition highlighting.
- Match bang and function modifiers - abort etc.
- Only match valid scope modifiers.
- Match listing commands.
- Don't match ex commands in function names.
- Split function syntax groups into :func and :def subgroups.
- Match Vim9-script parameter and return types.
- Limit legacy-script and Vim9-script comments to :func and :def
definitions, respectively.
35e6f4ca27
Omit the vimFunctionError change as it's a whitespace-only change and
will likely be superseded by later patches.
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (vim/vim#14232)
Disallow '.' at the start of a menu item name.
This is the menu path separator character and should be escaped with a
'\' in this case.
Partially fixesvim/vim#14230. "popup" is still incorrectly matched as the Ex
command.
ec21bafc13
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :highlight command (vim/vim#14228)
Improve :highlight command highlighting
- Use the same highlight groups for "default link" with and without
bang.
- Match some common line-continuation use.
- Match :hi clear variants.
- Highlight color-name values.
Resync vim.vim and generator/vim.vim.base.
9530fe4f3a
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, revert last change to vimUserFunc (vim/vim#14202)
Fix highlighting of ":echo (expr)" (broken in commit 61887b3) by
re-enabling the original fix for vim/vim#9987.
Addresses https://github.com/vim/vim/pull/14199#issuecomment-1999732062.
This will be fixed more generally when there is context-sensitive
matching for commands and functions.
b4b3d7de24
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :echo and :execute highlighting (vim/vim#14199)
Improve :echo and :execute highlighting.
- Add better line-continuation support for both commands.
- Improve the :execute command's expression argument matching.
- Remove the fix for issue vim/vim#9987 as this is now handled by correctly
matching the parens in :echo (...) as operator parens.
61887b3d6f
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve number matching (vim/vim#14175)
- Limit blob literals to an even number of hexadecimal digits and
correctly located dots.
- Match octal numbers.
The current version unsuccessfully attempts to match a leading '-' as
part of the float literal. It's actually parsed as part of the literal
for all numbers but the syntax file hasn't matched it like that for a
long time and highlights negative numbers as UNARY-MINUS NUMBER. This
will be fixed when better expression matching is implemented.
5cd86c6cff
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (vim/vim#14162)
Improve :menu and :menutranslate highlighting.
- Match args to :menutranslation and :popup.
- Only highlight special notation in {rhs} of :menu, like :map.
- Allow line continuations in {rhs} of :menu and between {english} and
{mylang} of :menutranslation, matching common usage.
- Bug fixes.
62b26040eb
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (vim/vim#14137)
* runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups
- Remove contained :syntax and :highlight sub-groups from the function
body cluster. These should only match in the respective commands.
- Remove vimSynLine syntax group from several clusters. The definition
of vimSynLine was removed in Vim 5.3.
* runtime(vim): Update syntax generator, use standard Last Change date format
The de facto standard date format is YYYY MMM DD.
e5c9ba6015
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, fix issue vim/vim#14135 (vim/vim#14136)
Fix incorrect error highlighting for function calls in :command
definitions. vimFunctionError should be restricted to :function header
lines.
fixes: vim/vim#14135691aee8b07
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :augroup highlighting (vim/vim#14125)
- Explicitly match the bang and group name in :aug! {name}.
- Allow any characters in a group name.
- Match default group switch marker, END.
- Match :aug without arguments (list command).
c4aef9a97b
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, remove unused vimString region
These were included with the initial release of the syntax file for Vim
5 and were probably intended to allow for syn-region start/skip/end
patterns with a '!' or '+' delimiter. However, these cases are
currently handled by the vimSynRegPat group.
The removed patterns never match anywhere in the distributed runtime
files and it is believed that this is generally true.
closes: vim/vim#140351633de8c35
Co-authored-by: Doug Kearns <dougkearns@gmail.com>