0
0
mirror of https://github.com/vim/vim.git synced 2025-08-25 19:53:53 -04:00

5625 Commits

Author SHA1 Message Date
Damien Lejay
d1833d2827
runtime(doc): allow more C99 features
closes: #17965

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-11 20:51:34 +02:00
Jon Parise
dba9eb46e6
runtime(python): Also sync syntax at 'async def'
A file containing only async functions (`async def func()`) wouldn't
previously match the pythonSync pattern.

Also, this pattern only matches at the beginning of the line, so it
won't ever match method definitions (which are indented within class
scopes). Update the comment accordingly.

closes: #17963

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-11 20:33:33 +02:00
Christian Brabandt
6b9cf3139a
runtime(doc): update :call with a range and remove space
Commit fc3c204bbe48d34bded70d2b1 introduced a spurious space with the
:call command

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 14:52:03 +02:00
Christian Brabandt
8b183450ad
runtime(doc): Fix 2 minor issues after 32d6bd6df
related: #17879

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 14:49:05 +02:00
Rob B
a94a0555d9
runtime(python): Highlight f-string replacement fields in Python
Highlight f-string replacement fields, including

- Comments
- Debugging flags
- Conversion fields
- Format specifications
- Delimiters

Syntax inside fields will be addressed in a separate commit.

related: #10734
related: #14033
closes: #17784

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:35:31 +02:00
Jon Parise
48b7eb1ceb
runtime(python): Highlight classes as structures
Class and function definitions previously shared a single highlight
group (pythonFunction). This change gives classes their own highlight
group (pythonClass) that's linked to Structure.

closes: #17856

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:32:41 +02:00
Damien Lejay
32d6bd6df2
runtime(doc): remove dead links
related: #17879

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:28:16 +02:00
Yee Cheng Chin
8f9de4991e
patch 9.1.1623: Buffer menu does not handle unicode names correctly
Problem:  Buffer menu does not handle unicode names correctly
          (after v9.1.1622)
Solution: Fix the BMHash() function (Yee Cheng Chin)

The Buffers menu uses a BMHash() function to generate a sortable number
to be used for the menu index. It used a naive (and incorrect) way of
encoding multiple ASCII values into a single integer, but assumes each
character to be only in the ASCII 32-96 range. This means if we use
non-ASCII file names (e.g. Unicode values like CJK or emojis) we get
integer underflow and overflow, causing the menu index to wrap around.
Vim's GUI implementations internally use a signed 32-bit integer for the
`gui_mch_add_menu_item()` function and so we need to make sure the menu
index is in the (0, 2^31-1) range.

To do this, if the file name starts with a non-ASCII value, we just use
the first character's value and set the high bit so it sorts after the
other ASCII ones. Otherwise, we just take the first 5 characters, and
use 5 bit for each character to encode a 30-bit number that can be
sorted.

This means Unicode file names won't be sorted beyond the first
character. This is likely going to be fine as there are lots of ways to
query buffers.

related: #17403
closes: #17928

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:09:38 +02:00
Yee Cheng Chin
cda0d17f59
patch 9.1.1622: Patch v9.1.1432 causes performance regressions
Problem:  Patch v9.1.1432 causes performance regressions
Solution: Revert "patch 9.1.1432: GTK GUI: Buffer menu does not handle
          unicode correctly" (Yee Cheng Chin).

This reverts commit 08896dd330c6dc8324618fde482db968e6f71088.

The previous change to support Unicode characters properly in the
buffers menu resorted to removing all buffer menus and re-add the
buffers after doing a sort, per each buffer addition. This was quite
slow because if Vim is trying to load in multiple buffers at once (e.g.
when loading a session) this scales in O(n^2) and Vim can freeze for
dozens of seconds when adding a few hundred buffers.

related: #17405
related: #17928
fixes: #17897

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:05:29 +02:00
Dietrich Moerman
4fca92faa2
patch 9.1.1620: filetype: composer.lock and symfony.lock files not recognized
Problem:  filetype: composer.lock and symfony.lock files not recognized
Solution: Detect composer.lock and symfony.lock files as json filetype
          (Dietrich Moerman)

closes: #17945

Signed-off-by: Dietrich Moerman <dietrich.moerman@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 09:44:42 +02:00
veotos
fc3c204bbe
runtime(doc): Fix style and typos in builtin.txt and usr_41.txt
- Reformat parts to fit into 80 column window.
- Fix example with mandatory call with a range.
  https://github.com/vim/vim/discussions/17950#discussioncomment-14055687
- Remove some duplicate information

closes: #17949

Signed-off-by: veotos <veotos@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 09:38:01 +02:00
Hirohito Higashi
57eb1d496b
runtime(doc): Tweak documentation style
closes: #17959

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 09:12:46 +02:00
Christian Brabandt
887b4981e7
patch 9.1.1615: diff format erroneously detected
Problem:  diff format erroneously detected
          (Tomáš Janoušek)
Solution: Make the regex to detect normal diff format a bit stricter,
          while at it, fix wrong test content from patch v9.1.1606

fixes: #17946

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 00:01:21 +02:00
Doug Kearns
c65643cbec
runtime(vim): Update ftplugin, fix option variable 'keywordprg' matching
- Match &option, and &[lg]:option variables.
- Match Ex commands after :bar.
- Fix matching of pre and post context text.
- Style - use '..' for string concatenation.

fixes #17567
closes: #17653

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-09 23:41:21 +02:00
D. Ben Knoble
7270a5a843
runtime(racket): update Racket runtime files
This brings the upstream files to commit 9dc3bd3 (ftplugin: escape Vim
special characters when opening docs, 2025-08-09). Note that not all
upstream files are included.

closes: #17956

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-09 23:38:07 +02:00
Christian Brabandt
b89ff6c2e1
runtime(c): set omnifunc only for Vim, since it is Vim9 Script
related: #17871

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 13:45:25 +02:00
Maxim Kim
fa2bcbdebc
runtime(vim): add simple vimscript complete function
closes: #17871

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 13:42:49 +02:00
Christian Brabandt
25599902ca
runtime(script): Update Last Change Header
This was missing from Patch v9.1.1606
(Commit: eb2aebeb7982168ece3888c9c0b08fc46f9d4d15)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 13:35:55 +02:00
lacygoill
eb2aebeb79
patch 9.1.1606: filetype: a few more files are not recognized
Problem:  filetype: a few more files are not recognized
Solution: guess Mail, Info and Terminfo files by its content
          (lacygoill)

closes: #17880

Signed-off-by: lacygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 13:17:57 +02:00
kuuote
8a65a49d50
patch 9.1.1605: cannot specify scope for chdir()
Problem:  Cannot specify scope for chdir()
Solution: Add optional scope argument (kuuote)

closes: #17888

Signed-off-by: kuuote <znmxodq1@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 13:09:25 +02:00
Girish Palya
d82c918e2f
runtime(doc): Improve doc for cmdline-autocomplete
Maybe this was unnecessary, but saw this:
https://github.com/vim/vim/issues/17854

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 13:03:43 +02:00
Damien Lejay
46ec899026
runtime(doc): update develop assumptions
closes: #17892

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 12:51:23 +02:00
RestorerZ
3be4ad76df
runtime(optwin): Fix E94 when searching for the option-window
Problem:  When the parameter debug=msg is set and the command :option is
          entered, error E94 will be displayed.
Solution: Add a check for the existence of the buffer before getting the
          buffer number “option-window”.

Reproduce:

vim --clean -c "set debug=msg" -c "option"

    Error detected while processing command line..script D:\Programs\Vim\vim91\optwin.vim:
    line 9: E94: No matching buffer for option-window

closes: #17927

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 12:38:33 +02:00
Aliaksei Budavei
7132935413
runtime(java): Manage byte limits for variable-width lookbehind assertions
Raise the byte limits from 80 to 120 for "javaFuncDef" and
"java*CommentTitle"; and support selecting other arbitrary
values with
------------------------------------------------------------
	let g:java_lookbehind_byte_counts = {
		\ 'javaMarkdownCommentTitle': 240,
	\ }
------------------------------------------------------------

for related groups of syntax definitions, referring to their
names with dictionary keys.

Over-80-Byte-Limit Lookbehind Examples:
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/java.base/share/classes/sun/security/x509/NamedX509Key.java [Lines 43 & 44]
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/jdk.compiler/share/classes/com/sun/tools/javac/util/GraphUtils.java [Line 154]

closes: #17921

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 10:50:19 +02:00
Phạm Bình An
adfea9b4e6
runtime(help): Unset 'comments' and 'cms' options
Problem:  Vim's help file doesn't have any syntax for comments, but
          'comments' and 'commentstring' are still set in the help
          buffer.
Solution: Unset 'comments' and 'cms' in help buffer

closes: #17889

Signed-off-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 10:44:18 +02:00
Christian Brabandt
6a6a44ffb5
runtime(netrw): netrw#BrowseX() needs to distinguish local and remote file
fixes: #17794

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 20:23:16 +02:00
rhysd
66d8d286cd
runtime(typescript): Add syntax support for defer and arbitrary module identifiers
closes: #17911

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 20:08:42 +02:00
Xudong Zheng
d305729bc5
patch 9.1.1602: filetype: requirements-*.txt files are not recognized
Problem:  filetype: requirements-*.txt files are not recognized
Solution: Detect requirements-*.txt files as requirements filetype
          (Xudong Zheng).

References:
- https://github.com/search?q=path%3Arequirements-*.txt&type=code
- https://github.com/zephyrproject-rtos/zephyr/tree/v4.2.0/scripts

closes: #17894

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:55:49 +02:00
veotos
c849b17e19
runtime(netrw): Use correct "=~#" for the netrw_sizestyle='H' option
Correct expression syntax to match case in if and if-else clauses.

related: #8535
closes: #17901

Signed-off-by: veotos <veotos@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:48:11 +02:00
Squibid
93f6454724
runtime(openscad): add a filetype plugin
closes: #17902

Signed-off-by: Squibid <me@zacharyscheiman.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:42:54 +02:00
Yee Cheng Chin
cad3b2421d
patch 9.1.1600: using diff anchors with hidden buffers fails silently
Problem:  diff: using diff anchors with hidden buffers fails silently
Solution: Give specific error message for diff anchors when using hidden
          buffers (Yee Cheng Chin).

Diff anchors currently will fail to parse if a buffer used for diff'ing
is hidden. Previously it would just fail as the code assumes it would
not happen normally, but this is actually possible to do if `closeoff`
and `hideoff` are not set in diffopt. Git's default diff tool "vimdiff3"
also takes advantage of this.

This fix this properly would require the `{address}` parser to be
smarter about whether a particular address relies on window position or
not (e.g. the `'.` address requires an active window, but `'a` or `1234`
do not). Since hidden diff buffers seem relatively niche, just provide a
better error message / documentation for now. This could be improved
later if there's a demand for it.

related: #17615
closes: #17904

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:33:34 +02:00
Nir Lichtman
589aa284f6
runtime(javascript): add "as" as a reserved keyword to syntax script
closes: #17912

Signed-off-by: Nir Lichtman <nir@lichtman.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:30:42 +02:00
veotos
9c4de84b2d
runtime(doc): Update ft-vim-syntax documentation
g:vimsyn_folding and g:vimsyn_embed regexps need to match case.

closes: #17914

Signed-off-by: veotos <veotos@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:22:04 +02:00
Furkan Sahin
a6e28b1d05
patch 9.1.1598: filetype: waybar config file is not recognized
Problem:  filetype: waybar config file is not recognized
Solution: Detect */waybar/config file as jsonc filetype
          (Furkan Sahin)

closes: #17915

Signed-off-by: Furkan Sahin <furkan-dev@proton.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 15:13:21 +02:00
Lane East
54fb7ba256
runtime(doc): remove mentioning of netrwSettings.vim
closes: #17925

Signed-off-by: Lane East <laneast@laneast.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-07 14:37:20 +02:00
Girish Palya
f7deb815b0
runtime(doc): fix typo at :h cmdline-autocompletion
The '?' needs to be escaped, because the autocommand is using
file-patterns (glob like) and not a regex). See :h file-pattern

closes: #17890

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 20:53:33 +02:00
Hirohito Higashi
bb0860abc9
runtime(doc): tweak option name notation further
related: #17857
closes: #17917

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 17:00:58 +02:00
zeertzjq
067adc1ff2
runtime(doc): add back bars for the '' mark
this was erroneously changed in commit
85cd509885a05c3a6bb029fb378b1295f107f8f6

related: #17857

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 13:41:05 +02:00
lacygoill
c0b3c19120
runtime(vim): add gf support for import and packadd in ftplugin
closes: #17881

Signed-off-by: lacygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 13:38:30 +02:00
lacygoill
9340aa1bf8
runtime(helptoc): add s keymap to split and jump to selected entry
closes: #17876

Signed-off-by: lacygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 13:06:34 +02:00
Aliaksei Budavei
af2c8e256a
runtime(syntax-tests): Break up non-ASCII over-75-byte-long lines
And anticipate occasional multibyte line wrapping owing to:
> A poorly rendered line may otherwise become wrapped when enough of
> spurious U+FFFD (0xEF 0xBF 0xBD) characters claim more columns than
> are available (75) and then invalidate line correspondence under test.

Observe that for "vim_ex_command.vim" another workaround is
chosen: the long line containing an only multibyte character
near its EOL is conversely made longer by padding and moving
the character to a separate _tail_ part of the wrapped line.
That is, the _head_ part of the line is all ASCII characters
and the wrapped _tail_ part is a mix of various characters
whose total byte count is within bounds.

Other unmodified tracked files of interest:
  java_lambda_expressions.java,
  java_lambda_expressions_signature.java,
  java_numbers.java,
  markdown_conceal.markdown,
  vim9_generic_function_example_set.vim

Also, remove stray U+FFFC (0xEF 0xBF 0xBC) characters.

Related to #16559 and #17704.

Reference:
0fde6aebdd/runtime/syntax/testdir/README.txt (L120-L123)

closes: #17868

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 12:50:30 +02:00
Emilien Breton
3769100a8e
runtime(doc): fix mismatch between 'backspace' and |i_backspacing|
closes: #17867

Signed-off-by: Emilien Breton <bricktech2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 12:48:06 +02:00
Hirohito Higashi
85cd509885
runtime(doc): Use correct option-name tags
closes: #17857

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 12:44:36 +02:00
Hirohito Higashi
a7a2a2b5ae
runtime(doc): Tweak documentation style
closes: #17862

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-06 11:43:45 +02:00
Luca Saccarola
becf1844e0
runtime(misc): removing saccarosium from maintainer list
closes: #17848

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-05 19:38:12 +02:00
Doug Kearns
ee865249b1 runtime(vim): Update base syntax, match Neovim builtin functions
Match Neovim functions when has("nvim") is true or g:vimsyn_vim_features
contains "nvim".

Fixes issue #17884.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
2025-08-04 22:25:27 +10:00
Doug Kearns
b88f9e4a04 runtime(vim): Update base syntax, fix :map termination in :command RHS
Ensure :map (and :abbreviate) terminate at | when included in :command
replacement strings containing commands separated by line continuations.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
2025-08-01 22:20:15 +10:00
Aliaksei Budavei
0fde6aebdd
CI: Manage multibyte characters in syntax tests
As reported in #16559, bytes of a multibyte character may
be written as separate U+FFFD characters in a ":terminal"
window on a busy machine.  The testing facilities currently
offer an optional filtering step to be carried out between
reading and comparing the contents of two screendump files
for each such file.  This filtering has been resorted to
(#14767 and #16560) in an attempt to unconditionally replace
known non-Latin-1 characters with an arbitrary substitute
ASCII character and avoid this rendering mishap leading to
syntax tests failures.  However, it has been overlooked at
the time that metadata description (in shorthand) to follow
spurious U+FFFD characters may be *distinct* and make the
remainder of such a line, ASCII characters and whatnot, also
unequal between compared screendump files.

While it is straightforward to adapt current filter files to
ignore the line characters after the leftmost U+FFFD,

> It is challenging and error-prone to keep up to date filter
> files because moving around examples in source files will
> likely make redundant some previously required filter files
> and, at the same time, it may require creating new filter
> files for the same source file; substituting one multibyte
> character for another multibyte character will also demand
> a coordinated change for filter files.

Besides, unconditionally dropping arbitrary parts of a line
is rather too blunt an instrument.  An alternative approach
is to not use the supported filtering for this purpose; let
a syntax test pass or fail initially; then *if* the same
failure is imminent, drop the leftmost U+FFFD and the rest
of the previously seen line (repeating it for all previously
seen unequal lines) before another round of file contents
comparing.  The obvious disadvantage with this filtering,
unconditional and otherwise, is that if there are consistent
failures for _other reasons_ and the unequal parts happen to
be after U+FFFDs, then spurious test passing can happen when
stars align for _a particular test runner_.

Hence syntax test authors should strive to write as little
significant text after multibyte characters as syntactically
permissible, write multibyte characters closer to EOL in
general, and make sure that their checked-in and published
"*.dump" files do not have any U+FFFDs.

It is also practical to refrain from attempting screendump
generation if U+FFFDs can already be discovered, and instead
try re-running from scratch the syntax test in hand, while
accepting other recently generated screendumps without going
through with new rounds of verification.

Reference:
https://github.com/vim/vim/pull/16470#issuecomment-2599848525

closes: #17704

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-25 20:08:52 +02:00
Aliaksei Budavei
43b99c9376
CI: Remove the file filters for syntax tests
These file filters are not sufficient to work around #16559
and are to be superseded by a more promising alternative.

related: #17704

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-25 20:07:47 +02:00
Doug Kearns
cced80dcbb
runtime(vim): Cleanup syntax tests
Improve formatting and naming consistency of the syntax tests.

closes: #17850

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-25 20:00:46 +02:00