1
0
forked from aniani/vim

39 Commits

Author SHA1 Message Date
Doug Kearns
0aaf6f8bbb
runtime(vim): Update base-syntax, improve :profile highlighting
Match full :profile and :profdel commands.

closes: #17420

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-01 18:26:39 +02:00
Doug Kearns
086b3b5b79
runtime(vim): Update base-syntax, improve :mark and :substitute highlighting
- Match full :mark and :k commands.
- Match 2 and 3 letter :s repeat commands.
- Match :s [count] argument.

closes: #17408

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-31 17:52:48 +02:00
Doug Kearns
7b5550fac7
runtime(vim): Update base-syntax, improve :import highlighting
- Match "autoload" as a keyword in :import commands.
- Match an expression argument for the filename.

closes: #15375

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-18 20:37:34 +02:00
Doug Kearns
a577e4289c
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: #15522

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-17 16:29:13 +02:00
Doug Kearns
c29b533cf1
runtime(vim): Update base-syntax, match continued strings and tail comments
Continued strings are currently only matched after operators, in
parenthesised expressions and in function call argument lists.

closes: #14975

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-26 20:14:15 +02:00
Doug Kearns
fa3b1043c6
runtime(vim): Update base-syntax, improve :autocmd highlighting
- Match full :autocmd, :doautocmd and :doautoall commands.
- Add filename pattern (wildcard) highlighting.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 19:48:13 +02:00
Doug Kearns
9b171bdfd6
runtime(vim): Update-base-syntax, match full :*grep, :make, :sort and :filter commands
closes: #17082

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-10 19:59:22 +02:00
Doug Kearns
520a2c7852
runtime(vim): Update base-syntax, improve :command highlighting
- Match multiline :command definitions.
- Match custom completion funcref var names.

fixes: #17001
closes: #17067

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 20:50:00 +02:00
Doug Kearns
2f5a8c0b5b
runtime(vim): Update base-syntax, match full :redir command
closes: #17057

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-05 15:55:36 +02:00
Doug Kearns
3dca512939
runtime(vim): Update base-syntax and generator, only match valid predefined variables
- Only match valid predefined and option variables.
- Match scope dictionaries.
- Highlight scope prefixed variables as a scope dictionary accessor. The
  vimVarScope syntax group can be linked to vimVar to disable this.
- Include support for Neovim-only predefined and option variables.

Temporary collateral damage - scope dictionaries match instead of keys
in dictionary literals.

closes: #16727

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-09 16:30:28 +01:00
Luuk van Baal
b7147f8236
patch 9.1.1084: Unable to persistently ignore events in a window and its buffers
Problem:  Unable to persistently ignore events in a window and its buffers.
Solution: Add 'eventignorewin' option to ignore events in a window and buffer
          (Luuk van Baal)

Add the window-local 'eventignorewin' option that is analogous to
'eventignore', but applies to a certain window and its buffers. Identify
events that should be allowed in 'eventignorewin', adapt "auto_event"
and "event_tab" to encode this information. Window context is not passed
onto apply_autocmds_group(), and when to ignore an event is a bit
ambiguous when "buf" is not "curbuf", rather than a large refactor, only
ignore an event when all windows into "buf" are ignoring the event.

closes: #16530

Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-08 18:52:39 +01:00
Doug Kearns
4a530a632b
runtime(vim): Update base-syntax, match :debuggreedy count prefix
Match :0debuggreedy as a special case until better range/count support
is implemented.

closes: #16572

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-03 18:59:09 +01:00
h-east
aa979c763d
patch 9.1.0985: Vim9: some ex commands can be shortened
Problem:  Vim9: some ex commands can be shortened
Solution: disallow shortening of :abstract, :interface and :type
          (h-east)

closes: #16356

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-03 10:19:45 +01:00
h-east
f27e80a6e1
runtime(vim): update vim generator syntax script
* include the base64* functions
* allow to shorten finally

closes: #16346

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-30 15:40:24 +01:00
h-east
f0ab3e4e41
runtime(vim): Improve syntax script generator for Vim Script
closes: #16331

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-29 15:14:37 +01:00
Doug Kearns
818c641b6f
runtime(vim): Update base-syntax file, improve class, enum and interface highlighting
- 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: #14393#issuecomment-2042796198.
closes: #13810

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-06 17:00:48 +02:00
Doug Kearns
4d427d4cab
runtime(vim): Update base-syntax, match Vim9 bool/null literal args to :if/:while/:return
Match Vim9 boolean and null literals in expression arguments of :if,
:elseif, :while and :return.

closes: #15684

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-15 19:21:18 +02:00
Doug Kearns
3c07eb0c67
runtime(vim): Update syntax, improve user-command matching
- 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: #15586

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-02 10:03:37 +02:00
Doug Kearns
7866d54ecc
runtime(vim): Update base-syntax, match :loadkeymap after colon and bar
Match :loadkeymap after Ex colons and bars.

Don't generate :loadkeymap as it is matched with a custom syntax group.

closes: #15554

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-23 18:37:55 +02:00
Ken Takata
95e90781a4
runtime(vim): Improve heredoc handling for all embedded scripts
* 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: #15542

Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-22 21:29:39 +02:00
Doug Kearns
99984fc58a
runtime(vim): Update base-syntax, improve :map highlighting
Match :map ( RHS properly.

Only match ! after :map, :noremap, :unmap and :mapclear.

closes: #15297

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-18 20:45:19 +02:00
Doug Kearns
d65e58f6f9
runtime(vim): Update base-syntax, match types in Vim9 variable declarations
Match types in Vim9 variable declarations.

Match Vim9 boolean and null literals. These are not matched in all
contexts yet.

related: #15277

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-17 19:34:14 +02:00
Doug Kearns
e85fdc730e
runtime(vim): Update base-syntax, improve :match command highlighting
Match group and pattern arguments to :match commands.

closes: #15096

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-07 20:45:37 +02:00
Doug Kearns
262e25e5a1
runtime(vim): Update base-syntax, match :sleep arg
Match :sleep arg properly including a lone "m" with a leading count.

closes: #15003

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14 20:16:35 +02:00
dkearns
a3bddb759e
runtime(vim): Update base-syntax, match :catch and :throw args (#14989)
Match :catch /{pattern}/ and :throw {expr1}.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-13 17:48:10 +02:00
h_east
c984b2fd9d
runtime(vim): fix syntax vim bug (Close #14858) (#14861)
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-27 15:40:25 +02:00
dkearns
04e5363b82
runtime(vim): Improve Vim9 and legacy-script comment highlighting (#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.

Fixes #13047, #11307 and #9587.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-10 22:18:37 +02:00
Doug Kearns
a44ced5763
runtime(vim): Update syntax generator, autocmd event list parsing
Track changes to the autocommand event list introduced in commit
78d742a (Patch 9.1.0256).

closes: #14430

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-07 17:49:57 +02:00
dkearns
982e191b38
runtime(vim): Update base-syntax, match empty blob and :abclear modifiers (#14318)
- Match empty blob literals.
- Match modifier arguments to :abclear commands.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-28 10:06:03 +01:00
dkearns
35e6f4ca27
runtime(vim): Update base-syntax, improve function definition highlighting (#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.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-21 20:41:10 +01:00
dkearns
61887b3d6f
runtime(vim): Update base-syntax, improve :echo and :execute highlighting (#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 #9987 as this is now handled by correctly
  matching the parens in :echo (...) as operator parens.


Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-15 12:45:48 +00:00
dkearns
62b26040eb
runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (#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.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-09 17:43:28 +01:00
dkearns
e5c9ba6015
runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (#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.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04 19:15:42 +01:00
dkearns
c4aef9a97b
runtime(vim): Update base-syntax, improve :augroup highlighting (#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).

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03 16:42:47 +01:00
dkearns
b1427b46f5
runtime(vim): Update base-syntax, improve :echo highlighting (#14103)
- Normalise behaviour of :echo commands and improve expression matching.
- Allow continued argument lines.
- Refine string interpolation groups.
- Remove duplicated :menu and :map generated commands that are handled
  specially later in the file.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27 19:59:30 +01:00
dkearns
1624970d32
runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)
Fixes issue #7876

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22 19:45:05 +01:00
Aliaksei Budavei
dfcef890cb
runtime(vim): Distinguish Vim9 constructor definitions from the :new ex command (#14050)
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.


Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-18 19:02:14 +01:00
h-east
5c3855bcab
runtime(vim): update Vim Syntax generator
- Add missing "Last Change:" line.
- The date on this line in vim.vim is updated by update_date.vim at
  Make time. (I made a mistake in the file path)
- Remove unnecessary "b:loaded_syntax_vim_ex".
- Remove "Base File Date:" line in vim.vim.base
- Add Doug Kearns as Maintainer

closes: #14031

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-14 21:00:01 +01:00
h-east
9b53c052d5
runtime(vim): include Vim Syntax generator
fixes: #13939
closes: #14021
related: vim-jp/syntax-vim-ex#28

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-13 21:11:22 +01:00