Commit Graph

7161 Commits

Author SHA1 Message Date
dundargoc
052498ed42 test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.

Closes https://github.com/neovim/neovim/issues/27004.
2024-04-23 18:17:04 +02:00
Evgeni Chasnovski
c5af5c0b9a
perf(lua): faster vim.deprecate() #28470
Problem: `vim.deprecate()` can be relatively significantly slower than
  the deprecated function in "Nvim" plugin.
Solution: Optimize checks for "Nvim" plugin. This also results into not
  distinguishing "xxx-dev" and "xxx" versions when doing checks, which
  is essentially covered by the deprecation logic itself.

With this rewrite I get the times from #28459: `{ 0.024827, 0.003797, 0.002024, 0.001774, 0.001703 }`.
For quicker reference:
    -  On current Nightly it is something like `{ 3.72243, 0.918169, 0.968143, 0.763256, 0.783424 }`.
    - On 0.9.5: `{ 0.002955, 0.000361, 0.000281, 0.000251, 0.00019 }`.
2024-04-23 08:23:45 -07:00
Raphael
a4fc3bb0e6
fix(diagnostic): vim.diagnostic.get(…,{lnum=…}) on multi-line diagnostic #28273
Problem:
vim.diagnostic.get(…,{lnum=…}) does not match multi-line diagnostics.

Solution: add end_lnum support.
2024-04-23 04:13:58 -07:00
Raphael
ad76b050eb
fix(diagnostic): open_float on multi-line diagnostics #28301
Problem: when diagnostic have a range of line, open_float not work.

Solution: filter diagnostic by line number range.
2024-04-23 04:06:41 -07:00
Christian Clason
aef120d1e9 vim-patch:9.1.0366: filetype: ondir files are not recognized
Problem:  filetype: ondir files are not recognized
Solution: Detect '.ondirrc' as ondir filetype
          (Jon Parise)

closes: vim/vim#14604

ea999037a4

Co-authored-by: Jon Parise <jon@indelible.org>
2024-04-23 09:38:46 +02:00
zeertzjq
7508f1e607
vim-patch:f7a38650eaf6 (#28465)
runtime(doc): update documentation

closes: vim/vim#14616

f7a38650ea

Co-authored-by: RestorerZ <restorer@mail2k.ru>
2024-04-23 08:20:36 +08:00
Yi Ming
39fc340276
fix(lsp): avoid assertion when client_hints do not exist (#28461) 2024-04-22 20:18:49 +02:00
Justin M. Keyes
fb5e2db4c7
refactor(api): deprecate nvim_call_atomic #28433
TODO:
FUNC_API_REMOTE_ONLY APIs such as `nvim_ui_*` cannot (yet) be used in
`nvim_exec_lua`. We can change FUNC_API_REMOTE_ONLY to allow
Vimscript/Lua to pass an explicit `channel_id`. #28437
2024-04-22 04:28:16 -07:00
Justin M. Keyes
013afc6863
refactor(lua): deprecate tbl_flatten #28457
forgot some changes in 9912a4c81b
2024-04-22 04:27:57 -07:00
Justin M. Keyes
f112ac73bd fix: unreliable "checkhealth completions" test
ref https://github.com/neovim/neovim/issues/19596

    FAILED   test/functional/plugin/health_spec.lua @ 37: :checkhealth completions can be listed via getcompletion()
    test/functional/plugin/health_spec.lua:40: Expected objects to be the same.
    Passed in:
    (string) 'provider.node'
    Expected:
    (string) 'provider.clipboard'

    stack traceback:
            test/functional/plugin/health_spec.lua:40: in function <test/functional/plugin/health_spec.lua:37>
2024-04-22 02:43:24 +02:00
Justin M. Keyes
9912a4c81b refactor(lua): deprecate tbl_flatten
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:

- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
  - iter.flatten():
    ```
    vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
    ```
  - tbl_flatten:
    ```
    vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
    ```

Solution:
Deprecate tbl_flatten.

Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:

    local anonym = vim.iter({ -- remove nil
      anonymous_num > 1 and '' or nil,
      '---@class ' .. anonymous_classname,
    }):flatten():totable()

Should we enhance :flatten() to work for arrays?
2024-04-22 02:11:23 +02:00
Christian Clason
7b8e582f1c vim-patch:d3ff129ce8c6
runtime(astro): Add filetype, syntax and indent plugin

related: vim/vim#14558
closes: vim/vim#14561

ported from: https://github.com/wuelnerdotexe/vim-astro

d3ff129ce8

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
2024-04-22 00:18:34 +02:00
Justin M. Keyes
5c8dfb0e37 refactor(lua): rename tbl_isarray => isarray
tbl_isarray was not released yet, so it will not go through
a deprecation cycle.

ref #24572
2024-04-21 17:42:17 +02:00
Justin M. Keyes
d9d890562e refactor(lua): rename tbl_islist => islist
ref #24572
2024-04-21 17:08:07 +02:00
Lewis Russell
032df963bb refactor(treesitter): language loading 2024-04-21 14:09:27 +01:00
Jaehwang Jung
2b6c9bbe7f perf(treesitter): incremental foldupdate
Problem:
While the fold level computation is incremental, the evaluation of the
foldexpr is done on the full buffer. Despite that the foldexpr reads
from the cache, it can take tens of milliseconds for moderately big (10K
lines) buffers.

Solution:
Track the range of lines on which the foldexpr should be evaluated.
2024-04-21 10:42:00 +02:00
bfredl
f42ab1dc48
Merge pull request #27872 from luukvbaal/cmdheight
fix(ui): don't force 'cmdheight' to zero with ext_messages
2024-04-21 09:31:24 +02:00
Christian Clason
9e1bbb9813 vim-patch:564166f68184
ftplugin(cmake): Add include and suffixesadd

closes: vim/vim#14520

564166f681

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-21 00:09:48 +02:00
Riley Bruins
5e6240ffc2 feat(treesitter): handle quantified fold captures 2024-04-20 22:11:45 +02:00
Luuk van Baal
b5a38530ba fix(ui): don't force 'cmdheight' to zero with ext_messages
Remove remaining code that prevents non-zero 'cmdheight' with ext_messages.
2024-04-20 15:44:12 +02:00
Yinzuo Jiang
f190f758ac
feat(lsp): add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)
Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2024-04-20 15:40:01 +02:00
Justin M. Keyes
fd085d9082
fix(vim.ui.open): try wslview before explorer.exe #28424
Problem:
explorer.exe is unreliable on WSL.

Solution:
Try wslview before explorer.exe.

fix #28410
2024-04-20 05:47:08 -07:00
zeertzjq
0ea38c9a53
refactor: add xmemcpyz() and use it in place of some xstrlcpy() (#28422)
Problem:  Using xstrlcpy() when the exact length of the string to be
          copied is known is not ideal because it requires adding 1 to
          the length and an unnecessary strlen().
Solution: Add xmemcpyz() and use it in place of such xstrlcpy() calls.
2024-04-20 19:31:00 +08:00
Christian Clason
52d2851ca4 vim-patch:9.1.0355: filetype: flake.lock files are not recognized
Problem:  filetype: flake.lock files are not recognized
Solution: Detect 'flake.lock' as json filetype
          (Riley Bruins)

closes: vim/vim#14589

ce736033ae

Co-authored-by: Riley Bruins <ribru17@hotmail.com>
2024-04-19 16:09:41 +02:00
Christian Clason
57c8f68e3b vim-patch:cee034112d41
runtime(bp): fix comment definition in filetype plugin (vim/vim#14594)

I somehow messed up the previous patch, I think a copy-paste error when
creating the file.

Blueprint files have C and C++ style comments, not shell-like '#'
comments.

cee034112d

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-19 16:09:30 +02:00
Justin M. Keyes
18da6964cc
refactor(vim.iter)!: remove vim.iter.map/filter/totable #26138
Problem:
The use-case for the convenience functions vim.iter.map(),
vim.iter.filter(), vim.iter.totable() is not clear.

Solution:
Drop them for now. We can revisit after 0.10 release.
2024-04-19 06:22:41 -07:00
zeertzjq
8d77061051
vim-patch:9.1.0354: runtime(uci): No support for uci file types (#28409)
Problem:  runtime(uci): No support for uci file types
          (Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
          (Colin Caine)

closes: vim/vim#14575

4b3fab14db

Co-authored-by: Colin Caine <complaints@cmcaine.co.uk>
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-19 14:50:12 +08:00
zeertzjq
3e6a9fb599
vim-patch:36e667ab837c (#28407)
runtime(java): Support "g:ftplugin_java_source_path" with archived files

Also, document for "g:ftplugin_java_source_path" its current
modification of the local value of the 'path' option.

closes: vim/vim#14570

36e667ab83

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-19 14:49:33 +08:00
dundargoc
c791aa8aae docs: update supported platforms 2024-04-18 23:39:26 +02:00
Maria José Solano
97c0a52416
fix(lsp): correct deprecation message #28403 2024-04-18 12:06:52 -07:00
Justin M. Keyes
f1dfe32bf5
feat(lua): enable(enable:boolean, filter:table) #28374
Problem:
We need to establish a pattern for `enable()`.

Solution:
- First `enable()` parameter is always `enable:boolean`.
- Update `vim.diagnostic.enable()`
- Update `vim.lsp.inlay_hint.enable()`.
    - It was not released yet, so no deprecation is needed. But to help
      HEAD users, it will show an informative error.
- vim.deprecate():
    - Improve message when the "removal version" is a *current or older* version.
2024-04-18 07:57:58 -07:00
Mathias Fußenegger
97323d821b
refactor(lsp): merge rpc.domain_socket_connect into rpc.connect (#28398)
See discussion in https://github.com/neovim/neovim/pull/26850
2024-04-18 15:34:10 +02:00
Michael
96d0c709b6
fix(healthcheck): expand vimrc variable (#28379) 2024-04-17 14:31:13 +08:00
Famiu Haque
8e5c48b08d
feat(lua): vim.fs.normalize() resolves ".", ".." #28203
Problem:
`vim.fs.normalize` does not resolve `.` and `..` components. This makes
no sense as the entire point of normalization is to remove redundancy
from the path. The path normalization functions in several other
languages (Java, Python, C++, etc.) also resolve `.` and `..`
components.

Reference:
- Python: https://docs.python.org/3/library/os.path.html#os.path.normpath
- Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize--
- C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal

Solution:
Resolve "." and ".." in `vim.fs.normalize`.

    Before:
    "~/foo/bar/../baz/./" => "~/foo/bar/../baz/."
    After:
    "~/foo/bar/../baz/./" => "~/foo/baz"
2024-04-16 12:13:44 -07:00
Luna Saphie Mittelbach
20b38677c2 feat(defaults): use ripgrep (rg) for 'grepprg' if available 2024-04-16 19:21:02 +02:00
Justin M. Keyes
fe4583127f
fix: vim.validate() order is not deterministic #28377
Problem:
The order of the validation performed by vim.validate() is
unpredictable.
- harder to write reliable tests.
- confusing UX because validation result might return different errors randomly.

Solution:
Iterate the input using `vim.spairs()`.

Future:
Ideally, the caller could provide an "ordered dict".
2024-04-16 07:31:43 -07:00
Justin M. Keyes
3065e2fa5d
Merge #28227 feat(diagnostic): is_enabled, enable(…, enable:boolean) 2024-04-16 04:37:54 -07:00
zeertzjq
9b485e3f42
vim-patch:8a31de6dd275 (#28361)
compiler(rime_deployer): include new compiler, use it for '*.custom.yaml' files (vim/vim#14460)

8a31de6dd2

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-16 09:33:51 +08:00
zeertzjq
fb7ffac69f
vim-patch:9.1.0326: filetype: some requirements files are not recognized (#28360)
Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

f9f5424d3e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
2024-04-16 09:33:33 +08:00
zeertzjq
07661009c5
vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)
vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized

Problem:  filetype: CMakeCache.txt files not recognized
Solution: Detect 'CMakeCache.txt' files as cmakecache filetype,
          include basic syntax script for cmakecache
          (Wu, Zhenyu, @bfrg)

closes: vim/vim#14384

62c09e032c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: bfrg <bfrg@users.noreply.github.com>
2024-04-16 09:33:16 +08:00
zeertzjq
537ba34953
vim-patch:4052474a1bd2 (#28358)
runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)

* runtime(java): Recognise non-ASCII identifiers

Also:

- Remove the already commented out and less general in its
  definition javaFuncDef alternative.

- Stop recognising some bespoke {p,trace} debugging API.

Non-ASCII identifiers have been supported from the outset
of the Java language.

> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter.  An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true.  A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .

(Separate syntax tests will be written when particular parts
now touched will have been further improved.)

Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]

* Take on the maintenance of Java filetype and syntax files

4052474a1b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-04-16 09:32:55 +08:00
zeertzjq
ca2f24cbbd vim-patch:9.1.0324: filetype: some json files are not recognized
Problem:  filetype: some json files are not recognized
Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype
          (Wu, Zhenyu)

See:
- https://github.com/microsoft/PowerToys/blob/main/.vsconfig
- https://jscs-dev.github.io/

closes: vim/vim#14452

c59a8648b2

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:32:08 +08:00
zeertzjq
fcf17c8859 vim-patch:9.1.0323: filetype: cabal config files may not be recognized
Problem:  filetype: cabal config files may not be recognized
Solution: Change filetype pattern to '*/{,.}cabal/config'
          (Wu Zhenyu)

closes: vim/vim#14498

799dedec0e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-16 08:22:37 +08:00
zeertzjq
6717cc5b41 vim-patch:9.1.0322: filetype: some mail tools not recognized
Problem:  filetype: some mail tools not recognized
Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp
          and '.notmuch-config' as ini filetype
          (Shane-XB-Qian)

closes: vim/vim#14533

a7a9a476cf

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2024-04-16 08:19:17 +08:00
zeertzjq
b4ddee1116
vim-patch:fb8f31ea7d7f (#28356)
runtime(doc): document pandoc compiler and enable configuring arguments

closes: vim/vim#14550

fb8f31ea7d

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-16 08:13:21 +08:00
Josef Litoš
8c970d3403
vim-patch:dd83b63eb5b7 (#28351)
runtime(i3config/swayconfig): update syntax scripts

modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only

closes: vim/vim#14544

dd83b63eb5
2024-04-16 07:48:15 +08:00
Justin M. Keyes
5ed9916a28 feat(diagnostic): enable(…, opts)
Problem:
vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable()

Solution:
- Change the signature so that the first 2 args are (bufnr, enable).
- Introduce a 3rd `opts` arg.
    - Currently it only supports `opts.ns_id`.
2024-04-15 21:32:31 +02:00
Ivan Georgiev
603f3b36a4
fix(checkhealth): error in node.js check #28348
Problem:
:checkhealth node.js check fails:

    ERROR Failed to run healthcheck for "provider.node" plugin ...
    node/health.lua:98: attempt to call local 'message' (a string value)

`message` is called as a function, when it is actually a string.

Solution:
Pass `message` to `warn()` as an argument.

Fix #28346
2024-04-15 09:23:22 -07:00
Justin M. Keyes
26765e8461 feat(diagnostic): is_enabled, enable(…, enable:boolean)
Problem:
`vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary
and inconsistent with the "toggle" pattern (established starting with
`vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276

As a reminder, the rationale is:
- we always need `enable()`
- we always end up needing `is_enabled()`
- "toggle" can be achieved via `enable(not is_enabled())`
- therefore,
    - `toggle()` and `disable()` are redundant
    - `is_disabled()` is a needless inconsistency

Solution:
- Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)`
    - Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`.
- Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
2024-04-15 13:54:33 +02:00
Justin M. Keyes
57adf8c6e0
fix(vim.ui): open() may wait indefinitely #28325
Problem:
vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986

Solution:
- Change `vim.ui.open()`:
    - Do not call `wait()`.
    - Return a `SystemObj`. The caller can decide if it wants to `wait()`.
- Change `gx` to `wait()` only a short time.
    - Allows `gx` to show a message if the command fails, without the
      risk of waiting forever.
2024-04-15 04:33:09 -07:00
zeertzjq
0f5c94c04b
vim-patch:4ba70cab37d2 (#28338)
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.

Fixes vim/vim#14393

4ba70cab37

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-15 07:46:14 +08:00
zeertzjq
bcfad7fe62
vim-patch:e92ed1b45c54 (#28337)
runtime(vim): don't set compiler, update a comment for vimdoc compiler (vim/vim#14532)

e92ed1b45c

Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
2024-04-15 07:39:32 +08:00
zeertzjq
43f8d7e3ef
vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
Problem:  String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
          (without having to convert it to string() first)
          (Yegappan Lakshmanan)

fixes: vim/vim#14529
closes: vim/vim#14541

f01493c550

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-04-15 07:11:39 +08:00
Sean Dewar
7180ef6901
feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192
Problem: noautocmd is confusing; despite its name, it doesn't block all
autocommands (instead it blocks only those related to setting the buffer), and
is commonly used by plugins to open windows while producing minimal
side-effects.

Solution: be consistent and block all autocommands when noautocmd is set.
This includes WinNew (again), plus autocommands from entering the window (if
enter is set) like WinEnter, WinLeave, TabEnter, .etc.

See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517
for more information.

Remove win_set_buf's noautocmd argument, as it's no longer needed.

NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its
callers already use block_autocmds.

Despite that, pum_create_float_preview doesn't actually properly handle
autocommands (it has no checks for whether those from win_enter or
nvim_create_buf free the window).

For now, ensure autocommands are blocked within it for correctness (in case it's
ever called outside of a block_autocmds context; the function seems to have been
refactored in #26739 anyway).
2024-04-14 16:10:16 -07:00
zeertzjq
aa1d0ac095
fix(defaults): only repeat macro for each selected line if linewise (#28289)
As mentioned in #28287, repeating a macro for each selected line doesn't
really make sense in non-linewise Visual mode.

Fix #28287
2024-04-15 03:43:33 +08:00
Christian Clason
4ca6e08327 vim-patch:9.1.0318: filetype: translate shell config files are not recognized
Problem:  filetype: translate shell config files are not recognized
Solution: Detect 'init.trans', 'translate-shell' and '.trans' files as
          clojure (Wu, Zhenyu)

See: https://github.com/soimort/translate-shell/wiki/Configuration

closes: vim/vim#14499

4b5cd7257e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
391200f198 vim-patch:9.1.0317: filetype: matplotlibrc files are not recognized
Problem:  filetype: matplotlibrc files are not recognized
Solution: Detect 'matplotlibrc' file as yaml filetype
          (Wu, Zhenyu)

See: https://matplotlib.org/stable/users/explain/customizing.html#the-matplotlibrc-file

closes: vim/vim#14501

55d4f3c006

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
737091d234 vim-patch:9.1.0316: filetype: some sh and confini files not recognized
Problem:  filetype: some sh and confini files not recognized
Solution: Detect neofetch, '.xprofile', XDG-User-Dirs files,
          paru and makepkg config files
          (Wu, Zhenyu)

See:
- https://github.com/dylanaraps/neofetch/wiki/Customizing-Info#config-file-location
- https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

closes: vim/vim#14505

5a9f7e6750

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
Christian Clason
420f130223 vim-patch:9.1.0315: filetype: a few more dosini files are not recognized
Problem:  filetype: a few more dosini files are not recognized
Solution: Detect wakatime, reply config files, flatpak, nfs config files
          and a few more python tools as dosini (or toml)
          (Wu, Zhenyu)

Refer:
- https://packaging.python.org/en/latest/specifications/pypirc/
- https://jorisroovers.com/gitlint/latest/configuration/
- https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#command-line-options
- https://docs.bpython-interpreter.org/en/latest/configuration.html
- https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
- https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
- https://github.com/wakatime/wakatime-cli?tab=readme-ov-file#usage
- https://metacpan.org/dist/Reply/view/bin/reply#-cfg-~/.replyrc

close: vim/vim#14512

0881329d12

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-14 13:21:10 +02:00
zeertzjq
a928228355
vim-patch:ce06493aeb3d (#28321)
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#14530

ce06493aeb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-14 07:35:08 +08:00
Christian Clason
b87212e669 vim-patch:5392970921ab
runtime(i3config): Line continuation is not detected for 'set' command (vim/vim#14531)

Problem:  Valid i3config syntax is highlighted as error.
Solution: Skip over line-breaks correctly.

5392970921

Co-authored-by: julio-b <julio.bacel@gmail.com>
2024-04-13 22:41:51 +02:00
Christian Clason
ee18c26f26 vim-patch:122d06858568
runtime(go): fix highlighting import string followed by some comment (vim/vim#14538)

122d068585

Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
2024-04-13 22:41:51 +02:00
Jaehwang Jung
328a237351
fix(defaults): auto-close terminal for &shell with args (#28276)
Problem:
The `:terminal` auto-close logic does not support `&shell` that has
arguments, e.g., `/bin/bash -O globstar`.

Solution:
Join `argv` and match `&shell`. This is not perfect since `&shell` may
contain irregular spaces and quotes, but it seems to be good enough.
2024-04-13 19:41:59 +08:00
zeertzjq
ab1203b2eb vim-patch:0549c503ba20
runtime(dts): include ftplugin support (vim/vim#14522)

0549c503ba

Co-authored-by: wzy <32936898+Freed-Wu@users.noreply.github.com>
2024-04-13 17:28:55 +08:00
zeertzjq
3b639222ff vim-patch:159dc0fcf950
runtime(kconfig): add include to ftplugin (vim/vim#14524)

related: vim/vim#14521

159dc0fcf9

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-13 17:28:39 +08:00
zeertzjq
355c149ba0
vim-patch:9.1.0311: filetype: Some config files are not recognized (#28311)
Problem:  Some config files are not recognized
Solution: Add some patterns for chktex, ripgreprc and ctags config
          files.

See: https://www.nongnu.org/chktex/
See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file
See: https://docs.ctags.io/en/latest/option-file.html#order-of-loading-option-files

closes: vim/vim#14506

a1dcd76ce7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-13 09:59:53 +08:00
dundargoc
66220d164a revert: "feat(health): fold successful healthchecks #22866"
This reverts commit 4382d2ed56.

The story for this feature was left in an incomplete state. It was never
the intention to unilaterally fold all information, only the ones that
did not contain relevant information. This feature does more harm than
good in its incomplete state.
2024-04-13 01:18:40 +02:00
zeertzjq
a629978cb6
vim-patch:9.1.0305: filetype: some history files are not recognized (#28300)
Problem:  filetype: some history files are not recognized
Solution: Add some history patterns to filetype.vim
          (Wu, Zhenyu)

closes: vim/vim#14513

da70feabea

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 18:08:54 +08:00
zeertzjq
8c112a8235 vim-patch:9.1.0307: filetype: texdoc config files is not recognized
Problem:  filetype: texdoc config files is not recognized
Solution: Detect 'texdoc.cnf' as conf filetype
          (Wu, Zhenyu)

See: https://github.com/TeX-Live/texdoc/blob/master/texdoc.cnf

closes: vim/vim#14507

7fdbd1bb58

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:22:16 +08:00
zeertzjq
be7d8ff0e4 vim-patch:9.1.0306: filetype: x11vnc config file is not recognized
Problem:  filetype: x11vnc config file is not recognized
Solution: Detect '.x11vncrc' as conf filetype
          (Wu, Zhenyu)

See: https://linux.die.net/man/1/x11vnc

closes: vim/vim#14511

58ce78ad43

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:21:28 +08:00
zeertzjq
7334e9055b vim-patch:9.1.0295: filetype: pip config files are not recognized
Problem:  filetype: pip config files are not recognized
Solution: detect pip.conf as dosini filetype
          (Wu, Zhenyu)

closes: vim/vim#14448

d2b95b8446

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:19:10 +08:00
zeertzjq
60ced890f3 vim-patch:9.1.0293: filetype: lxqt config files are not recognized
Problem:  filetype: lxqt config files are not recognized
Solution: Detect {lxqt,screengrab}/*.conf files as dosini,
          fix failing filetype test for */tex/latex/**.cfg
          (Wu, Zhenyu)

closes: vim/vim#14450

41208884b8

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:17:39 +08:00
zeertzjq
b0ded42680 vim-patch:9.1.0292: filetype: XDG mimeapps.list file is not recognized
Problem:  filetype: XDG mimeapps.list file is not recognized
Solution: Detect mimeapps.list as dosini filetype
          (Wu, Zhenyu)

Refer: https://wiki.archlinux.org/title/XDG_MIME_Applications#Format

closes: vim/vim#14451

efd752ec38

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:15:44 +08:00
zeertzjq
07c5969aa9 vim-patch:9.1.0291: filetype: libreoffice config files are not recognized
Problem:  filetype: libreoffice config files are not recognized
Solution: Detect Libreoffice config fils as xml/dosini
          (Wu, Zhenyu)

closes: vim/vim#14453

73c89bcf79

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:14:43 +08:00
zeertzjq
611cc7de43
vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)
Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

1492fe6903

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:07:24 +08:00
zeertzjq
e4fb3e2007
vim-patch:9.1.0303: filetype: some protocol buffer files not recognized (#28293)
Problem:  filetype: some protocol buffer files not recognized
Solution: Detect '*.textproto', '*.textpb', '*.txtpb' as pbtxt files
          (Bruno Belanyi)

See: https://protobuf.dev/reference/protobuf/textformat-spec/#text-format-files

closes: vim/vim#14463

e54a8e7c73

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:06:21 +08:00
zeertzjq
a93a045e63
vim-patch:9.1.0302: filetype: blueprint files are not recognized (#28292)
Problem:  filetype: blueprint files are not recognized
Solution: Detect '*.bp' files as blueprint files, add
          a minimal filetype plugin (Bruno Belanyi)

See: https://source.android.com/docs/setup/build

closes: vim/vim#14488

6be7ef5bc7

Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
2024-04-12 17:05:11 +08:00
zeertzjq
da3059b00f
vim-patch:9.1.0290: filetype: xilinx files are not recognized (#28295)
Problem:  filetype: xilinx files are not recognized
Solution: Add a few xilinx specific file patterns,
          inspect lpr files for being xml/pascal
          (Wu, Zhenyu)

closes: vim/vim#14454

614691ceef

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:03:45 +08:00
zeertzjq
5aee587970
vim-patch:9.1.0289: filetype: some TeX files are not recognized (#28291)
Problem:  filetype: some TeX files are not recognized
Solution: Add more patterns for TeX files and inspect
          a few more files for being TeX files
          (Wu, Zhenyu)

closes: vim/vim#14456

61ee833a50

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 17:02:25 +08:00
zeertzjq
fe42574230
vim-patch:83424105cb42 (#28298)
runtime(doc): mention :argded for :argedit

related: vim/vim#14464

83424105cb

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-12 16:56:22 +08:00
zeertzjq
8cca787155
test: macros in Visual mode without default mappings (#28288) 2024-04-12 09:16:13 +08:00
zeertzjq
c6d1144515
vim-patch:fcbefe74f161 (#28285)
runtime(compiler): add vimdoc

closes: vim/vim#14459

https://github.com/google/vimdoc generates vim help files from vimscript files

fcbefe74f1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-12 05:48:25 +08:00
zeertzjq
3b9a152396
vim-patch:3cb2b3776700 (#28283)
runtime(doc): clarify behaviour or :argadd and :argedit

related: vim/vim#14464

3cb2b37767

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-12 05:39:30 +08:00
zeertzjq
55ffca2f9f vim-patch:dbca7d80457d
ftplugin(asm): add Matchit support

closes: vim/vim#14461

Refer https://github.com/vim/vim/blob/master/runtime/ftplugin/masm.vim#L18-L29

dbca7d8045

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-11 18:23:18 +08:00
zeertzjq
d2d4ad4b32 vim-patch:27f17a6d3493
runtime(asm): add basic indent support

closes: vim/vim#14383

27f17a6d34

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-11 18:22:57 +08:00
zeertzjq
245745f9f0 vim-patch:556c62165963
ftplugin(gdb): add matchit support

closes: vim/vim#14462

556c621659

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-11 18:22:32 +08:00
zeertzjq
1746b9234c
vim-patch:6ce07edd600e (#28275)
runtime(compiler): fix inaccuracies in pandoc compiler (vim/vim#14467)

as kindly pointed out by @Freed-Wu

6ce07edd60

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-04-11 17:59:29 +08:00
zeertzjq
d627497156
vim-patch:04e5363b8238 (#28268)
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.

Fixes vim/vim#13047, vim/vim#11307 and vim/vim#9587.

04e5363b82

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-04-11 07:41:44 +08:00
zeertzjq
d0afb2dc4e
vim-patch:9.1.0297: Patch 9.1.0296 causes too many issues (#28263)
Problem:  Patch 9.1.0296 causes too many issues
          (Tony Mechelynck, chdiza, CI)
Solution: Back out the change for now

Revert "patch 9.1.0296: regexp: engines do not handle case-folding well"

This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes
issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It
needs more work.

fixes: vim/vim#14487

c97f4d61cd

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 07:40:16 +08:00
zeertzjq
adb70a351d
vim-patch:c9ec20d94ea5 (#28267)
runtime(doc): Update documentation

- Add security e-mail for private bugreports
- Remove mentioning of the voting feature

closes: vim/vim#14483

c9ec20d94e

Co-authored-by: RestorerZ <restorer@mail2k.ru>
Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-11 07:39:29 +08:00
altermo
00e6651880 fix(treesitter): use tree range instead of tree root node range 2024-04-10 15:54:52 +01:00
Yi Ming
1dacf2ecee
fix(lsp): prevent code-lens refresh from becoming a permanent no-op (#28228)
To avoid repeatedly requesting a buffer multiple times before a request is completed, the current implementation puts the requested buffer into the active_refreshes table before requesting.

But since we only remove the buffer from active_refreshes in the lsp-handler of textDocument/codeLens, this will cause if the user sends a request that cannot trigger lsp-handler (for example, if there is an LSP server attached to the current buffer, and especially when the user creates an autocmd which performs vim.lsp.codelens.refresh after the BufEnter event is triggered like in the document example), this buffer will be put into active_refreshes, and there is no way to remove it, which will result in all subsequent vim.lsp.codelens.refresh not requesting textDocument/codeLens.
2024-04-10 12:27:37 +02:00
Yi Ming
b95b6ed975
fix(lsp): empty commands should not be considered executable (#28216)
According to the LSP specification, the CodeLens.command is optional but the CodeLens.command.command is not optional, which means the correct representation of a display-only code lens is indeed one with a command with a title to display and an empty string as command.
2024-04-10 12:23:47 +02:00
zeertzjq
f49408454d
vim-patch:9.1.0296: regexp: engines do not handle case-folding well (#28259)
Problem:  Regex engines do not handle case-folding well
Solution: Correctly calculate byte length of characters to skip

When the regexp engine compares two utf-8 codepoints case insensitively
it may match an adjacent character, because it assumes it can step over
as many bytes as the pattern contains.

This however is not necessarily true because of case-folding, a
multi-byte UTF-8 character can be considered equal to some single-byte
value.

Let's consider the pattern 'ſ' and the string 's'. When comparing and
ignoring case, the single character 's' matches, and since it matches
Vim will try to step over the match (by the amount of bytes of the
pattern), assuming that since it matches, the length of both strings is
the same.

However in that case, it should only step over the single byte
value 's' so by 1 byte and try to start matching after it again. So for the
backtracking engine we need to ensure:
- we try to match the correct length for the pattern and the text
- in case of a match, we step over it correctly

The same thing can happen for the NFA engine, when skipping to the next
character to test for a match. We are skipping over the regstart
pointer, however we do not consider the case that because of
case-folding we may need to adjust the number of bytes to skip over. So
this needs to be adjusted in find_match_text() as well.

A related issue turned out, when prog->match_text is actually empty. In
that case we should try to find the next match and skip this condition.

fixes: vim/vim#14294
closes: vim/vim#14433

7a27c108e0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-10 07:08:49 +08:00
zeertzjq
7142c5dde9
vim-patch:e43ace558aee (#28258)
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>
2024-04-10 06:31:10 +08:00
zeertzjq
4946489e2e
vim-patch:9.1.0283: Several small issues in doc and tests (#28249)
Problem:  Wrong doc style for pandoc syntax description,
          Test_diff_eob_halfpage() may fail depending on
          screen size, using braces in highlight.c when
          not necessary
Solution: Fix pandoc documentation, make sure the window
          for the test has 7 lines, remove the braces.

a040019be6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-09 16:42:39 +08:00
Christian Clason
41521658b1 vim-patch:9.1.0276: No pandoc syntax support
Problem:  No pandoc syntax support
Solution: Add pandoc syntax and compiler plugins
          (Wu, Zhenyu, Konfekt)

closes: vim/vim#14389

7005b7ee7f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-04-09 10:24:49 +02:00
Christian Clason
4a1eec85dd vim-patch:a2385c233499
runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants

closes: vim/vim#14406

a2385c2334

Co-authored-by: jiangyinzuo <jiangyinzuo@foxmail.com>
2024-04-09 09:54:16 +02:00
Christian Clason
cbe982bbd5 vim-patch:9.1.0278: filetype: zathurarc files not recognized
Problem:  filetype: zathurarc files not recognized
Solution: Detect '.zathurarc' files as zathurarc filetype,
          add zathurarc filetype (Wu, Zhenyu)

closes: vim/vim#14380

72d81a66ed

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:54:07 +02:00
Christian Clason
2857cde070 vim-patch:9.1.0275: filetype: R history files are not recognized
Problem:  filetype: R history files are not recognized
Solution: Detect '.Rhistory' files as r filetype
          (Wu, Zhenyu)

closes: vim/vim#14440

fc21b6437c

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-09 09:53:58 +02:00
Christian Clason
bef4ad6507 vim-patch:9.1.0279: filetype: roc files are not recognized
Problem:  filetype: roc files are not recognized
Solution: Detect '*.roc' files as roc filetype,
          add a basic filetype plugin (nat-418)

closes: vim/vim#14416

196b6678c5

Co-authored-by: nat-418 <93013864+nat-418@users.noreply.github.com>
2024-04-09 09:53:49 +02:00
zeertzjq
2528093bbe
vim-patch:9.1.0277: Cannot highlight the Command-line (#28244)
Problem:  Cannot highlight the Command-line
Solution: Add the MsgArea highlighting group
          (Shougo Matsushita)

closes: vim/vim#14327

be2b03c6ee

Cherry-pick Test_highlight_User() from patch 8.2.1077.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-04-09 07:20:49 +08:00
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
Christian Clason
541c2d3816 vim-patch:9.1.0273: filetype: keymap files are not recognized
Problem:  filetype: keymap files are not recognized
Solution: Detect '*.keymap' files as Device Tree Files
          (0xadk)

closes: vim/vim#14434

b78753db5f

Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2024-04-08 00:35:38 +02:00
zeertzjq
d32cbef595
vim-patch:9cd9e759ab1e (#28224)
runtime(doc): Normalise builtin-function optional parameter formatting

These should generally be formatted as func([{arg}]) and referenced as
{arg} in the description.

closes: vim/vim#14438

9cd9e759ab

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-08 06:11:31 +08:00
Barrett Ruth
f6dcc464f2
fix(health): check unmatching python_glob as empty table (#28215) 2024-04-07 11:50:45 +08:00
dundargoc
9dd112dd48 refactor: remove fn_bool
It's better to use vim.fn directly instead of creating minor
abstractions like fn_bool.
2024-04-06 16:42:26 +02:00
zeertzjq
7560aee595
vim-patch:9.1.0266: filetype: earthfile files are not recognized (#28207)
Problem:  filetype: earthfile files are not recognized
Solution: Detect 'Earthfile' as earthfile
          (Gaëtan Lehmann)

closes: vim/vim#14408

28e5e7c484

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
2024-04-06 21:11:57 +08:00
dundargoc
0443f06b71 docs: don't mention executable() can return -1
This cannot happen for neovim.
2024-04-06 12:47:28 +02:00
zeertzjq
703f97568d
docs: tags for commenting mappings without "-default" suffix (#28205)
This actually won't cause "duplicate tag" errors if plugins have tags of
the same name, because E154 is only given for duplicate tags in the same
directory.

Without those tags, trying to use :h for these mappings jumps to other
places, because there are matches with higher score.
2024-04-06 18:40:38 +08:00
Yinzuo Jiang
fe0f1f1c19
vim-patch:cec44eae82c1 (#28199)
runtime: Remove more fallback :CompilerSet definitions from compiler plugins

Continue with vim/vim#14399

vim/vim@cec44ea
2024-04-06 11:13:56 +08:00
zeertzjq
66568ed452
vim-patch:b73faa1c02d0 (#28193)
runtime: fix :compiler leaving behind a g:makeprg variable (vim/vim#14414)

Problem:  :compiler may leave behind a g:makeprg variable after vim/vim#14336.
Solution: Use a script local variable.

b73faa1c02

Also apply previously omitted change to compiler/context.vim.
2024-04-06 05:44:37 +08:00
Christian Clason
39a0e6bf3c fix(treesitter): update parsers and queries 2024-04-05 18:36:17 +02:00
Evgeni Chasnovski
73de98256c feat(comment): add built-in commenting
Design

- Enable commenting support only through `gc` mappings for simplicity.
  No ability to configure, no Lua module, no user commands. Yet.

- Overall implementation is a simplified version of 'mini.comment'
  module of 'echasnovski/mini.nvim' adapted to be a better suit for
  core. It basically means reducing code paths which use only specific
  fixed set of plugin config.

  All used options are default except `pad_comment_parts = false`. This
  means that 'commentstring' option is used as is without forcing single
  space inner padding.

As 'tpope/vim-commentary' was considered for inclusion earlier, here is
a quick summary of how this commit differs from it:

- **User-facing features**. Both implement similar user-facing mappings.
  This commit does not include `gcu` which is essentially a `gcgc`.
  There are no commands, events, or configuration in this commit.

- **Size**. Both have reasonably comparable number of lines of code,
  while this commit has more comments in tricky areas.

- **Maintainability**. This commit has (purely subjectively) better
  readability, tests, and Lua types.

- **Configurability**. This commit has no user configuration, while
  'vim-commentary' has some (partially as a counter-measure to possibly
  modifying 'commentstring' option).

- **Extra features**:
    - This commit supports tree-sitter by computing `'commentstring'`
      option under cursor, which can matter in presence of tree-sitter
      injected languages.

    - This commit comments blank lines while 'tpope/vim-commentary' does
      not. At the same time, blank lines are not taken into account when
      deciding the toggle action.

    - This commit has much better speed on larger chunks of lines (like
      above 1000). This is thanks to using `nvim_buf_set_lines()` to set
      all new lines at once, and not with `vim.fn.setline()`.
2024-04-05 18:07:43 +02:00
Christian Clason
2b9d8dc87e vim-patch:408281e16a36
runtime: Remove fallback :CompilerSet definition from compiler plugins

The :CompilerSet command was added in version Vim 6.4 which was released
twenty years ago.  Other runtime files do not support versions of that
vintage so it is reasonable to remove this fallback command definition
now.

closes: vim/vim#14399

408281e16a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-04-05 15:45:13 +02:00
Mathias Fußenegger
9af3559643
feat(lsp): set workDoneToken in initialize request (#28182)
Problem:

Some servers don't report progress during initialize unless the client
sets the `workDoneToken`

See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress

In particular:

> There is no specific client capability signaling whether a client will
> send a progress token per request. The reason for this is that this is
> in many clients not a static aspect and might even change for every
> request instance for the same request type. So the capability is signal
> on every request instance by the presence of a workDoneToken property.

And:

> Servers can also initiate progress reporting using the
> window/workDoneProgress/create request. This is useful if the server
> needs to report progress outside of a request (for example the server
> needs to re-index a database). The token can then be used to report
> progress using the same notifications used as for client initiated
> progress.

So far progress report functionality was relying entirely on the latter.

Solution:

Set a `workDoneToken`

Closes https://github.com/neovim/neovim/issues/27938
2024-04-05 13:24:39 +02:00
zeertzjq
9711370c26
feat(defaults): add :Inspect to right-click menu (#28181)
Ref #21393

- Move default user commands to _defaults.lua as that now contains all
  kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
2024-04-05 18:08:54 +08:00
zeertzjq
a500c5f808
vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)
Problem:    Dialog for file changed outside of Vim not tested.
Solution:   Add a test.  Move FileChangedShell test.  Add 'L' flag to
            feedkeys().

5e66b42aae

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-05 18:04:45 +08:00
Christian Clason
4add77ddbf vim-patch:5ccdcc482e29
runtime(java): Improve the matching of contextual keywords

- Recognise a _record_ contextual keyword.
- Recognise _non-sealed_, _sealed_, and _permits_ contextual
  keywords.
- Admit _$_ to keyword characters.
- Group _abstract_, _final_, _default_, _(non-)sealed_
  (apart from _(non-)sealed_, the incompossibility of these
  modifiers calls for attention).
- Remove another _synchronized_ keyword redefinition.

I have also replaced a function with an expression.  Before
patch 8.1.0515, it should have been declared :function! to
work with repeatable script sourcing; there is less to worry
about with an expression.

References:
https://openjdk.org/jeps/395 (Records)
https://openjdk.org/jeps/409 (Sealed Classes)
https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8

closes: vim/vim#14403

5ccdcc482e

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-04-05 09:07:07 +02:00
Christian Clason
56701cd21e vim-patch:08d2401fbc6d
runtime(netrw): filetype not detected when editing remote files

fixes: vim/vim#14400

08d2401fbc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-04-04 10:29:58 +02:00
zeertzjq
15a2dd9e96
vim-patch:89cc03af71d9 (#28168)
runtime(doc): sort filetype.txt in the alphabetical order (vim/vim#14395)

89cc03af71

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-04-04 06:19:13 +08:00
Christian Clason
e74cd1d9ff vim-patch:9.1.0253: filetype: typespec files are not recognized
Problem:  filetype: typespec files are not recognized
Solution: Detect '*.tsp' files as typespec
          (Hilmar Wiegand)

Specs is at https://typespec.io/

closes: vim/vim#14392

6c9f4f98f1

Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
2024-04-03 10:45:29 +02:00
Lewis Russell
d9235efa76 refactor(lsp): move workspace folder logic into the client
- Changed `reuse_client` to check workspace folders in addition to
  root_dir.
2024-04-02 16:47:17 +01:00
Christian Clason
6cfca21bac feat(treesitter): add @injection.filename
Problem: Injecting languages for file redirects (e.g., in bash) is not
possible.

Solution: Add `@injection.filename` capture that is piped through
`vim.filetype.match({ filename = node_text })`; the resulting filetype
(if not `nil`) is then resolved as a language (either directly or
through the list maintained via `vim.treesitter.language.register()`).

Note: `@injection.filename` is a non-standard capture introduced by
Helix; having two editors implement it makes it likely to be upstreamed.
2024-04-02 11:13:16 +02:00
Christian Clason
feaab21c71 vim-patch:cc7597c1edf4
runtime(yaml): improve syntax highlighting for YAML

- Recognize block scalar style to avoid unexpected highlighting by `yamlFlowString` (fix vim/vim#11517)
- Improve performance of `yamlFlowMappingKey` by allowing execution by the NFA engine (fix vim/vim#10730)
  - It was intentionally disabled before patterns were optimized by `s:SimplifyToAssumeAllPrintable`.
- Fix detection of flow style mapping indicators (fix vim/vim#8234).
- Enable highlighting of explicit mapping value indicators and node properties in flow style.
- Add syntax highlighting tests

closes: vim/vim#14354

cc7597c1ed

Co-authored-by: itchyny <itchyny@cybozu.co.jp>
2024-04-01 15:52:26 +02:00
zeertzjq
381806729d
vim-patch:9.0.1643: filetype detection fails if file name ends in many '~' (#28141)
Problem:    Filetype detection fails if file name ends in many '~'.
Solution:   Strip multiple '~' at the same time. (closes vim/vim#12553)

c12e4eecbb

In Nvim this already works as Lua filetype detection isn't subject to
such a small recursion limit as autocommands, but it still makes sense
to avoid unnecessary recursion.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-04-01 18:43:30 +08:00
Christian Clason
2e97ae2664 vim-patch:9.1.0250: filetype: ldscripts cannot be recognized
Problem:  filetype: ldscripts cannot be recognized
Solution: Detect '*/ldscripts/*' as ld
          (Wu, Zhenyu)

closes: vim/vim#14371

4c7098b00a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
000431820e vim-patch:9.1.0249: filetype: rock_manifest and config.ld files are not recognized
Problem:  filetype: rock_manifest and config.ld files are not recognized
Solution: Detect 'rock_manifest' and 'config.ld' as lua
          (Wu, Zhenyu)

closes: vim/vim#14370

a917bd58bd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
19ee281809 vim-patch:9.1.0248: filetype: yarn lock files are not recognized
Problem:  filetype: yarn lock files are not recognized
Solution: Detect 'yarn.lock' files as yaml
          (Wu, Zhenyu)

closes: vim/vim#14369

3b497aa247

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
de1a54dfe1 vim-patch:9.1.0247: filetype: bundle config files are not recognized
Problem:  filetype: bundle config files are not recognized
Solution: Detect '*/.bundle/config' as yaml
          (Wu, Zhenyu)

closes: vim/vim#14368

3f6fa93b3b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
09869c3745 vim-patch:9.1.0246: filetype: fontconfig files are not recognized
Problem:  filetype: fontconfig files are not recognized
Solution: detect 'fonts.conf' as xml
          (Wu, Zhenyu)

closes: vim/vim#14367

a2c27b01dc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
fa863c17b2 vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not recognized
Problem:  filetype: zsh theme, history and zunit files are not
          recognized.
Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh
          (Wu, Zhenyu)

closes: vim/vim#14366

a55a22a1a3

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
239101e32a vim-patch:9.1.0244: filetype: bash history files are not recognized
Problem:  filetype: bash history files are not recognized
Solution: detect .bash-history and .bash_history files as bash
          (Wu, Zhenyu)

closes: vim/vim#14365

84ce55001a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
1a0b27965c vim-patch:9.1.0243: filetype: netrw history file is not recognized
Problem:  filetype: netrw history file is not recognized
Solution: Detect .netrwhist as vim files (Wu, Zhenyu)

closes: vim/vim#14364

abbb4a4f70

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
5cdbb22c34 vim-patch:9.1.0242: filetype: octave history files are not recognized
Problem:  filetype: octave history files are not recognized
Solution: Detect octave/history files as octave
          (Wu, Zhenyu)

closes: vim/vim#14363

be71ac694f

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
afc7a5611e vim-patch:9.1.0241: filetype: mysql history files are not recognized
Problem:  filetype: mysql history files are not recognized
Solution: Detect .mysql_history as mysql
          (Wu, Zhenyu)

closes: vim/vim#14362

6b285c8cfd

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
a978e83158 vim-patch:9.1.0240: filetype: some python tools config files are not recognized
Problem:  filetype: some python tools config files are not recognized
Solution: Detect config files for setuptools, pudb, coverage as dosini
          (Wu, Zhenyu)

closes: vim/vim#14361

665220a17b

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
acac56360f vim-patch:9.1.0239: filetype: gnuplot history files are not recognised
Problem:  filetype: gnuplot history files are not recognised
Solution: detect .gnuplot_history files as gnuplot
          (Wu, Zhenyu)

closes: vim/vim#14360

8e47eb31cc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
ce69056e95 vim-patch:9.1.0238: filetype: jupyterlab and sublime config are not recognized
Problem:  filetype: jupyterlab and sublime config are not recognized
Solution: Detect jupyterlab and sublime config files as json
          (Wu, Zhenyu)

closes: vim/vim#14359

75c607dff7

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
f29ba3c46c vim-patch:9.1.0237: filetype: mplstyle files are not recognized
Problem:  filetype: mplstyle files are not recognized
Solution: Detect '*.mplstyle' files as yaml (Wu, Zhenyu)

closes: vim/vim#14358

0fd560d46a

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
2e0233d003 vim-patch:9.1.0236: filetype: texlua files are not recognized
Problem:  filetype: texlua files are not recognized
Solution: Add '*.tlu' pattern for texlua files (Wu, Zhenyu)

Reference: https://github.com/TeX-Live/texdoc/tree/master/script

closes: vim/vim#14357

a75f4791b1

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
96d77b2051 vim-patch:9.1.0235: filetype: supertux files are not recognized
Problem:  filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
          so add a pattern for supertux files.
          (Wu, Zhenyu)

Reference: https://github.com/SuperTux/supertux/wiki/S-Expression

closes: vim/vim#14356

4ff83b904e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
c24dcb1bea vim-patch:9.1.0234: filetype: support for Intel HEX files is lacking
Problem:  filetype: support for Intel HEX files is lacking
Solution: Add more file extensions that are typical for Intel HEX files
          (Wu, Zhenyu)

Reference: https://en.wikipedia.org/wiki/Intel_HEX

closes: vim/vim#14355

e523dd9803

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-04-01 12:01:47 +02:00
Christian Clason
6b9a808d13 vim-patch:18d730d7b572
runtime(compilers): ensure compiler! sets global options (vim/vim#14336)

Previously some options were only set locally by
&l:makeprg/errorformat

This suffices for :compiler (without a trailing bang)
but falls short for :compiler! that sets &g:makeprg/errorformat as
well

Also apply kind suggestions by @dkearns and @lifepillar

18d730d7b5

omit context.vim (vim9script only)

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-04-01 00:48:30 +02:00
Christian Clason
9b9dab622a vim-patch:807fff135d52
runtime(pamconf): add support for Debian specific @includes

fixes: vim/vim#14335

807fff135d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-31 23:05:38 +02:00
Christian Clason
20dd60f13c vim-patch:cbb92b5ceb6a
runtime(sshconfig,sshdconfig): update syntax (vim/vim#14351)

* fix case insensitivity of Host and Hostname keys
* improve regexps
* add keywords

cbb92b5ceb

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2024-03-31 23:05:20 +02:00
Marcin Szamotulski
01691c5447
fix(lsp): abort callHierarchy on no result (#28102)
The `callHierarchy` function should warn the user when
`textDocument/prepareCallHierarchy` didn't resolve an entity and
return, rather than calling the `callHierarchy/{incoming,outgoing}Calls`
method with an empty object - which is encoded as an empty list (which
doesn't respect language server specification for the
`callHierarchy/incomingCalls` call).
2024-03-31 20:43:34 +02:00
zeertzjq
e1ff2c51ca
feat(lua): pass keys before mapping to vim.on_key() callback (#28098)
Keys before mapping (i.e. typed keys) are passed as the second argument.
2024-03-31 11:20:05 +08:00
Evgeni Chasnovski
837f268093
fix(highlight): add Nvim{Light,Dark}Gray{1,2,3,4} colors 2024-03-30 14:31:46 +02:00
dundargoc
2424c3e696 fix: support UNC paths in vim.fs.normalize
Closes https://github.com/neovim/neovim/issues/27068.
2024-03-30 00:51:09 +01:00
James Trew
38e38d1b40
fix(fs): allow backslash characters in unix paths
Backslashes are valid characters in unix style paths.

Fix the conversion of backslashes to forward slashes in several `vim.fs`
functions when not on Windows. On Windows, backslashes will still be converted
to forward slashes.
2024-03-29 17:23:01 +01:00
dundargoc
8424c64498
docs: document setting g:clipboard to v:false (#28085) 2024-03-29 09:43:26 -05:00
zeertzjq
d223a7cbd2
vim-patch:9.1.0228: Two unrelated things are tested by a single test (#28093)
Problem:  Two unrelated things are tested by a single test.
Solution: Split it into two, restoring the old Test_brace_single_line().
          Add missing cleanup to some tests.
          (zeertzjq)

closes: vim/vim#14323

ad493ef3ea
2024-03-29 17:49:25 +08:00
bfredl
2e4e12756a feat(ui): indicate margins for the area used by win_viewport
Problem: using win_viewport for implementing smooth scrolling in an external
UI might run into problems when winbar or borders is used, as there is
no indication that the entire grid is not used for scrolled buffer text.

Solution: add `win_viewport_margins` event.
2024-03-29 08:15:28 +01:00
dundargoc
0ebc4de0ff
feat: allow opting in to builtin clipboard providers (#28083)
Setting `vim.g.clipboard = false` will use the builtin clipboard
providers.

Closes https://github.com/neovim/neovim/issues/27698.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-03-28 15:17:08 -05:00
zeertzjq
dde2cc65fd
Merge pull request #28044 from luukvbaal/vim-9.1.0211
vim-patch:9.1.{0211,0215}
2024-03-28 19:47:40 +08:00
Luuk van Baal
2f638c0ac6 vim-patch:9.1.0215: Half-page scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-D/Ctrl-U implements
          it's own logic to change the topline and cursor.
          More logic than necessary for scrolling with Ctrl-F/Ctrl-B
          was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
          staying backward compatible as much as possible.
          Restore some of the logic that determined how many lines will
          be scrolled (Luuk van Baal)

5a2e3ec9ac
2024-03-28 11:39:34 +01:00
zeertzjq
c804d7968b
vim-patch:982e191b38b4 (#28073)
runtime(vim): Update base-syntax, match empty blob and :abclear modifiers (vim/vim#14318)

- Match empty blob literals.
- Match modifier arguments to :abclear commands.

982e191b38

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-28 18:08:05 +08:00
Christian Clason
2dea0ea820 vim-patch:b2e1fee72c45
runtime(haskell): allow TODO keywords in comments

closes: vim/vim#14319

b2e1fee72c

Co-authored-by: Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
2024-03-28 10:41:42 +01:00
Luuk van Baal
4147302f4b vim-patch:9.1.0211: page-wise scrolling does not support smooth-scrolling
Problem:  Page-wise scrolling with Ctrl-F/Ctrl-B implements
          it's own logic to change the topline and cursor.
          In doing so, skipcol is not handled properly for
          'smoothscroll', and virtual lines.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying
          backward compatible as much as possible.

b9f5b95b7b
2024-03-28 10:18:09 +01:00
Christian Clason
19b443251f vim-patch:677cd956810e
runtime(debcontrol): add Static-Built-Using field (vim/vim#14306)

677cd95681

Co-authored-by: Guilherme Puida <guilherme@puida.xyz>
2024-03-28 10:15:47 +01:00
dundargoc
a89ce89742
docs: fix typos (#27868)
Co-authored-by: ite-usagi <77563904+ite-usagi@users.noreply.github.com>
Co-authored-by: v-sim <56476039+v-sim@users.noreply.github.com>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Quico Augustijn <quico.public@gmail.com>
Co-authored-by: nhld <nahnera@gmail.com>
Co-authored-by: francisco souza <108725+fsouza@users.noreply.github.com>
2024-03-28 09:32:32 +08:00
zeertzjq
4ee9e58056
feat(tui): query extended underline support using DECRQSS (#28052) 2024-03-28 07:39:36 +08:00
Christian Clason
1fcf84d46a
vim-patch:9.1.0196: filetype: support for gnuplot files is lacking (#27972)
Problem:  filetype: support for gnuplot files is lacking
Solution: Also detect *.gnuplot files
          (RobbiZ98)

closes: vim/vim#14243

3a6bd0c5c7

Co-authored-by: RobbiZ98 <113035863+RobbiZ98@users.noreply.github.com>
2024-03-27 19:46:31 +08:00
Lewis Russell
7d97150084 fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
Mayrom
fc6d713dd8
feat(diagnostic): add support for many namespaces filtering in GetOpts (#28045) 2024-03-26 19:08:54 -05:00
zeertzjq
77458e613b
vim-patch:9.1.0207: No autocommand when writing session file (#28048)
Problem:  No autocommand when writing session file
Solution: Add SessionWritePost autocommand
          (Colin Kennedy)

fixes: vim/vim#14242
closes: vim/vim#14288

e5f2280381

Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
2024-03-27 05:41:41 +08:00
Christian Clason
d3771e68a2 vim-patch:63833bb0217f
runtime(json5): add basic indent support (vim/vim#14298)

63833bb021

Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
2024-03-26 21:48:41 +01:00
Christian Clason
3587377cda vim-patch:63d68c2c218e
runtime(java): Update java[CR]_JavaLang type lists (vim/vim#14297)

- Add to the list of java.lang runtime exceptions two new
  types: MatchException (Pattern Matching for _switch_) and
  WrongThreadException (Virtual Threads).
- "Demote" Compiler (removed in JDK 21) from the list of
  java.lang class types to a new list javaLangDeprecated.

References:
https://bugs.openjdk.org/browse/JDK-8205129
https://bugs.openjdk.org/browse/JDK-8282274
https://bugs.openjdk.org/browse/JDK-8284161

63d68c2c21

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-26 21:37:50 +01:00
zeertzjq
3f3c7299a1
docs: remove remaining mentions of hkmap (#28038) 2024-03-26 18:30:17 +08:00
zeertzjq
d6f406db45
fix(filetype): don't use fnamemodify() with :e for extension (#27976)
Use pattern matching instead, as fnamemodify() with :e produces an empty
string when the file name only has an extension, leading to differences
in behavior from Vim.

Related #16955 #27972
2024-03-26 13:31:37 +08:00
Lewis Russell
00e71d3da3 refactor(lsp): simplify client tracking
- Remove:
    - uninitialized_clients
    - active_clients
    - all_buffer_active_clients
- Add:
    - all_clients

- Use `lsp.get_clients()` to get buffer clients.
2024-03-25 22:21:08 +00:00
Lewis Russell
a7bbda121d fix(test): typing 2024-03-25 21:09:57 +00:00
Christian Clason
3fd8292aaf vim-patch:ab01adf7c65b
runtime(doc): Update options.txt

closes: vim/vim#14295

ab01adf7c6

Co-authored-by: Song-Tianxiang <149415622+Song-Tianxiang@users.noreply.github.com>
2024-03-25 22:07:17 +01:00
zeertzjq
fb4e2dbbeb
vim-patch:9.1.0205: Cannot use modifiers before :-Ntabmove (#28031)
Problem:  Cannot use modifiers before :-Ntabmove.
Solution: Check backwards from the command instead of checking from the
          start of the command line. Slightly adjust docs to make them
          more consistent (zeertzjq).

closes: vim/vim#14289

076faac537
2024-03-26 05:04:57 +08:00
Christian Clason
31c4cb2347 vim-patch:8e59a7ba8877
runtime(java): Recognise the inline kind of the {@return} tag (vim/vim#14284)

Also:

- Refine comment matching (javaComment{Error\ and,Start}).
- Continue rewriting regexps (prefer atom grouping with
  non-capturing parens; factor out common prefixes in
  alternations).
- Allow for relative paths with the _file_ attribute of
  {@snippet}.
- Anticipate HTML in the @see tags.
- Match the nullary method parens in javaDocSeeTagParam.
- Improve the boundary patterns for summary sentences of
  documentation.

> This sentence ends at ... or at the first tag (as defined
> below).

There are Java documentation tags (@) and there are HTML
tags (<?>) (with Markdown looming large; see JEP 467).  With
block tags, e.g. @param, @return, @see, we begin another
documentation "sentence" whether or not the author has
terminated the summary sentence with a period; with
.<!-- -->, we may follow abbreviations, enumerations,
initials, (but instead consider @literal or &nbsp;) _within_
the summary sentence.  On the other hand, inline tags, e.g.
@code, @link, @literal, should not terminate the summary
sentence.

References:
https://bugs.openjdk.org/browse/JDK-8075778
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentence
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

8e59a7ba88

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-25 21:39:46 +01:00
Lewis Russell
934f38682a Revert "refactor(lsp): simplify client tracking"
This reverts commit 3f238b39cf.
2024-03-25 20:16:42 +00:00
Lewis Russell
3f238b39cf refactor(lsp): simplify client tracking
- Remove:
    - uninitialized_clients
    - active_clients
    - all_buffer_active_clients
- Add:
    - all_clients

- Use `lsp.get_clients()` to get buffer clients.
2024-03-25 18:02:38 +00:00
Christian Clason
31a15fb2a1 vim-patch:3e72bf10a0a2
runtime(java): Recognise the {@snippet} documentation tag (vim/vim#14271)

Remember that ‘code fragments are typically Java source
code, but they may also be fragments of properties files,
source code in other languages, or plain text.’  Therefore,
with these changes, markup tags are highlighted in the Java
source files (as external snippets) and in the {@snippet}
tags.

Also:

- Improve matching of the multi-line {@code} documentation
  tag with any contained balanced braces.
- Recognise the {@literal} documentation tag.
- Highlight stray blanks in comments.

Related to an enhancement proposal for PCRE-like callouts
discussed at https://github.com/vim/vim/issues/11217.

References:
https://openjdk.org/jeps/413
https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html

3e72bf10a0

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-25 14:18:52 +01:00
Christian Clason
665d5d3969 vim-patch:4b715bdaf4ca
runtime(netrw): Fix typo in netrw#NetWrite (vim/vim#14283)

Fix typo in netrw#NetWrite (http) error message call.

4b715bdaf4

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-24 23:00:43 +01:00
Christian Clason
011585f35f vim-patch:6f438199c92b
runtime(compiler): update errorformat for dot and neato compiler (vim/vim#14257)

* add errorformat for dot compiler
* add errorformat for neato compiler

6f438199c9

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
2024-03-24 11:05:04 +01:00
Christian Clason
ed910604ca vim-patch:d3c0ff5d5a90
runtime(termdebug): allow multibyte characters as breakpoint signs (vim/vim#14274)

Allow multibyte characters as termdebug signs using slice() function

d3c0ff5d5a

Co-authored-by: Mihai Ciuraru <mihai.ciuraru@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-03-24 10:32:07 +01:00
Calvin Bochulak
ca6dbf3558
fix(vim.iter): use correct cmp function when truncating tail in take (#27998) 2024-03-23 16:46:54 -05:00
zeertzjq
881f5e5917
vim-patch:9.1.0199: Not enough tests for the slice() function (#27991)
Problem:  Not enough tests for the slice() function.
Solution: Test with multibyte chars, and in both Legacy and Vim9 script.
          Update docs to be clearer about how it treats composing chars.
          (zeertzjq)

closes: vim/vim#14275

ad38769030
2024-03-23 16:33:53 +08:00
zeertzjq
2955c921ce
fix(filetype): use unexpanded file name (#27931)
When the edited file is a symlink, the unexpanded file name is needed to
to achieve the same behavior as the autocommand pattern matching in Vim.
Neither args.file nor args.match are guaranteed to be unexpanded, so use
bufname() instead.
2024-03-23 11:46:23 +08:00
zeertzjq
a44ac26c75
vim-patch:76d62985c1ff (#27985)
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>
2024-03-23 06:43:25 +08:00
Jaehwang Jung
849d82b80b
fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#27981)
continuation of https://github.com/neovim/neovim/pull/24013
2024-03-22 17:46:01 +01:00
zeertzjq
15c6909bb1
vim-patch:35e6f4ca27c8 (#27973)
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>
2024-03-22 07:31:43 +08:00
Evgeni Chasnovski
45032a941d docs(lsp): describe semantic tokens highlight groups with more details
Problem: Description of highlight groups for LSP semantic tokens can be
  more up to date and useful.
  Right now it misses several actually defined highlight groups and
  presents information about Vim highlight groups they are linked to.
  This is both outdated (they link to tree-sitter `@` groups now) and
  redundant (users can see this information with `:Inspect` over the
  group name itself).

Solution: Synchronize the list of groups with specification and provide
  actionable descriptions.
2024-03-21 09:01:37 +01:00
Christian Clason
cfc9fcc91f vim-patch:2708c0b5854f
runtime(deb822sources): Add minimal ftplugin (vim/vim#14240)

Set comment related options and avoid automatic line wrapping.

2708c0b585

Co-authored-by: James McCoy <jamessan@jamessan.com>
2024-03-20 22:01:40 +01:00
zeertzjq
37db3d97ea
vim-patch:ec21bafc135a (#27939)
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 fixes vim/vim#14230.  "popup" is still incorrectly matched as the Ex
command.

ec21bafc13

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-20 07:04:31 +08:00
Christian Clason
4694ce6877
vim-patch:9.1.0188: filetype: no support for Vento files (#27935)
Problem:  Vento files are not recognized.
Solution: Recognize *.vto files as filetype "vento" (wrapperup)

Vento is a templating engine https://vento.js.org/

closes: vim/vim#14229

9f26e5a9bc

Co-authored-by: wrapperup <wrapperup4@gmail.com>
2024-03-20 05:31:44 +08:00
Lewis Russell
aca2048bcd refactor(treesitter): redesign query iterating
Problem:

  `TSNode:_rawquery()` is complicated, has known issues and the Lua and
  C code is awkwardly coupled (see logic with `active`).

Solution:

  - Add `TSQueryCursor` and `TSQueryMatch` bindings.
  - Replace `TSNode:_rawquery()` with `TSQueryCursor:next_capture()` and `TSQueryCursor:next_match()`
  - Do more stuff in Lua
  - API for `Query:iter_captures()` and `Query:iter_matches()` remains the same.
  - `treesitter.c` no longer contains any logic related to predicates.
  - Add `match_limit` option to `iter_matches()`. Default is still 256.
2024-03-19 14:24:59 +00:00
Christian Clason
c30ebb17f6 fix(treesitter): document more standard highlight groups
Problem: Not all standard treesitter groups are documented.

Solution: Document them all (without relying on fallback); add default
link for new `*.builtin` groups to `Special` and `@keyword.type` to
`Structure`. Remove `@markup.environment.*` which only made sense for
LaTeX.
2024-03-19 09:41:16 +01:00
Christian Clason
5e875ae8d0 feat(treesitter): update Markdown parsers and queries to v0.2.1 2024-03-19 09:41:16 +01:00
Christian Clason
ff6092b4ee feat(treesitter): update Bash parser and queries to v0.21.0 2024-03-19 09:41:16 +01:00
Christian Clason
8a3385dde7 feat(treesitter): update Python parser and queries to v0.21.0 2024-03-19 09:41:16 +01:00
Christian Clason
987dff6713 feat(treesitter): update Vimdoc parser and queries to v2.4.0 2024-03-19 09:41:16 +01:00
Christian Clason
20dcbaaaf8 feat(treesitter): update Vim parser and queries to v0.4.0 2024-03-19 09:41:16 +01:00
Christian Clason
aca4ad430b feat(treesitter): update Lua parser and queries to v0.1.0 2024-03-19 09:41:16 +01:00
Christian Clason
8dda630ae9 feat(treesitter): update C parser and queries to v0.21.0 2024-03-19 09:41:16 +01:00
zeertzjq
79af4e7e73
vim-patch:78c189837ae6 (#27920)
runtime(doc): Recover some missed commas and periods in starting.txt

Also:

- Insert some missing words;
- Strive for consistency with capitalisation of words;
- Improve shell alias examples.

The gvim words were left alone for now, but they deserve to
be treated like proper names, GVim or GUI Vim, unless these
refer to executable filenames (on *nix systems).

closes: vim/vim#14194

78c189837a

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-03-19 06:55:30 +08:00
zeertzjq
b5e3df37a4
vim-patch:9530fe4f3a69 (#27919)
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>
2024-03-19 06:38:30 +08:00
Christian Clason
5c9033024f
vim-patch:9.1.0187: filetype: no support for Dafny files (#27918)
Problem:  Dafny files are not recognized.
Solution: Recognize *.dfy files as filetype "dafny" (zeertzjq).

Ref: https://dafny.org/
Ref: https://github.com/mlr-msft/vim-loves-dafny

closes: vim/vim#14226

4e334d0443

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-03-18 22:47:51 +01:00
Christian Clason
920ef1fd71 vim-patch:ef21bcaab145
runtime(rust): Respect no_plugin_maps and no_rust_maps globals (vim/vim#14221)

ef21bcaab1

Co-authored-by: MyyPo <110892040+MyyPo@users.noreply.github.com>
2024-03-18 22:01:33 +01:00
En-En
e34c23b701
fix(tutor): set a value for ":syntax iskeyword" (#27833)
Problem: "NOTE"s, inline Vim script code, and links ending in digits may not be
highlighted correctly within the :Tutor.

Solution: set an explicit value for ":syntax iskeyword" that includes digits. Do
it after ":syntax include"s, so the included syntax/sh.vim doesn't mess with the
value.

Increase screen test width so all text within the conclusion section is visible.

Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
2024-03-18 11:19:20 +00:00
Christian Clason
f0bd895995 vim-patch:3d46de703cf6
runtime(go): `goPackageComment` highlighting too broad

Previously this would highlight any comment before a line starting
`package`, for example

    var (
      // This comment would be highlighted as a goPackageComment
      packages []string
    )

The package clause is only valid when followed by a space[1], so include
this restriction

This is upstreaming a change from `go-vim`[2]

[1] https://go.dev/ref/spec#Package_clause
[2] d1c36cc417

3d46de703c

Co-authored-by: Matthew Hughes <matthewhughes934@gmail.com>
2024-03-18 15:49:08 +08:00
Lewis Russell
3b29b39e6d fix(treesitter): revert to using iter_captures in highlighter
Fixes #27895
2024-03-17 20:37:15 +00:00
Takuya Tokuda
77a9f3395b
fix(lsp): create codelens request parameters for each buffer (#27699) 2024-03-17 21:04:59 +01:00
Lewis Russell
14e4b6bbd8 refactor(lua): type annotations 2024-03-16 19:26:10 +00:00
Caleb Marshall
542c910a1d fix(lsp): add missing LSP semantic token highlight links
Added the following LSP semantic token types to be linked to highlight
groups by default:

* @lsp.type.event
* @lsp.type.keyword
* @lsp.type.modifier
* @lsp.type.number
* @lsp.type.operator
* @lsp.type.regexp
* @lsp.type.string
2024-03-16 20:37:56 +08:00
zeertzjq
848e64322a
vim-patch:989faa4fce65 (#27880)
runtime(doc): make :h tag-! more consistent (vim/vim#14208)

- Use "on" and "off" for 'winfixbuf' option values.
- Retab the table.

989faa4fce
2024-03-16 16:38:40 +08:00
ite-usagi
4447cefa48
fix(l10n): update Japanese translations (#27856) 2024-03-16 14:50:52 +08:00
zeertzjq
59aadf33ef
fix(man): pass modifiers also to :tag (#27878)
There aren't really many modifiers that take an effect on :tag (except
maybe :confirm, :unsilent, :verbose), but pass them for consistency.
2024-03-16 09:56:58 +08:00
Tomasz N
25e7299707
feat(man): allow opening pages in current window (#27861)
With :hide modifier, open page in current window.
2024-03-16 09:00:25 +08:00
zeertzjq
b82d755109 vim-patch:b4b3d7de2413
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>
2024-03-16 04:09:35 +08:00
zeertzjq
b958b5ee4f vim-patch:61887b3d6fd8
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>
2024-03-15 21:49:17 +08:00
bfredl
8350839a87
Merge pull request #27674 from glepnir/snippet_indent
fix(snippet): correct indent with newline
2024-03-15 09:32:03 +01:00
zeertzjq
d326e04860
vim-patch:9.1.0181: no overflow check for string formatting (#27863)
Problem:  no overflow check for string formatting
Solution: Check message formatting function for overflow.
          (Chris van Willegen)

closes: vim/vim#13799

c35fc03dbd

Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
2024-03-15 08:05:59 +08:00
Christian Clason
120c4ec855 fix(terminal): disable reflow again
reverts c855eee919

This setting introduces constant CI failures on macos
(see https://github.com/neovim/neovim/issues/23762).
2024-03-14 19:22:16 +08:00
zeertzjq
2aa84ce210 vim-patch:45da32964d6e
runtime(mswin): still another clipboard_working test

Commit 760f664213dea9a300454992ba1589f4601d622f missed to revert back
another test for `if has('clipboard_working')`

So change the remaining check around the inoremap <c-v> mappings.

fixes vim/vim#14195

45da32964d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14 15:04:31 +08:00
zeertzjq
ff972b88db vim-patch:760f664213de
runtime(mswin): revert back the check for clipboard_working support

Commit d9ebd46bd090c598adc82e6 changed the condition to
check if the clipboard is available from:
```
has('clipboard')
```
to
```
has('clipboard_working')
```
Assuming that is the more accurate test because even when clipboard
support is enabled at compile time it may not be actually working (e.g.
if no X11 environment is available, or when working on a remote server).

However it seems that condition does not evaluate to true, when the GUI
has not been started up yet (and there was no X11 Connection yet possible).

So let's just revert back the check to `has('clipboard')`, since that
has been proven to be working well enough.

related: vim/vim#13809

760f664213

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14 15:03:47 +08:00
Lewis Russell
00c4962cd2 refactor(treesitter): move some logic into functions 2024-03-14 06:55:19 +00:00
Lewis Russell
12faaf40f4 fix(treesitter): highlight injections properly
`on_line_impl` doesn't highlight single lines, so using pattern indexes
to offset priority doesn't work.
2024-03-14 06:55:19 +00:00
zeertzjq
b17be231a6
vim-patch:9.1.0178: E1513 might be confusing (#27846)
Problem:  E1513 might be confusing
          (Christoph Thoma)
Solution: reword error message, fix test to not
          depend on the actual message

fixes: vim/vim#14189

0a32b8854b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-14 06:44:50 +08:00
Sean Dewar
bbb68e2a03
vim-patch:9.1.0175: wrong window positions with 'winfix{width,height}' (#27845)
Problem:  winframe functions incorrectly recompute window positions if
          the altframe wasn't adjacent to the closed frame, which is
          possible if adjacent windows had 'winfix{width,height}' set.

Solution: recompute for windows within the parent of the altframe and
          closed frame. Skip this (as before) if the altframe was
          top/left, but only if adjacent to the closed frame, as
          positions won't change in that case. Also correct the return
          value documentation for win_screenpos. (Sean Dewar)

The issue revealed itself after removing the win_comp_pos call below
winframe_restore in win_splitmove. Similarly, wrong positions could result from
windows closed in other tabpages, as win_free_mem uses winframe_remove (at least
until it is entered later, where enter_tabpage calls win_comp_pos).

NOTE: As win_comp_pos handles only curtab, it's possible via other means for
positions in non-current tabpages to be wrong (e.g: after changing 'laststatus',
'showtabline', etc.). Given enter_tabpage recomputes it, maybe it's intentional
as an optimization? Should probably be documented in win_screenpos then, but I
won't address that here.

closes: vim/vim#14191

Nvim: don't reuse "wp" for "topleft" in winframe_remove, so the change
integrates better with the call to winframe_find_altwin before it.

5866bc3a0f
2024-03-13 22:06:39 +00:00
Sean Dewar
9f59415243
Merge pull request #27839 from seandewar/vim-9.1.0169
vim-patch:9.1.{0169,0170,0171,9a660d2883f9}
2024-03-12 23:05:09 +00:00
Sean Dewar
c048beef6c
vim-patch:9a660d2883f9
runtime(doc): add reference to matchbufline() at :h search()

related: vim/vim#14173

9a660d2883

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-12 21:42:47 +00:00
Sean Dewar
ca7b603d02
vim-patch:9.1.0170: Re-allow curwin == prevwin, but document it instead
Problem:  more places exist where curwin == prevwin, and it may even be
          expected in some cases.
Solution: revert v9.1.0001, but document that it's possible instead.
          (Sean Dewar)

I've had a change of heart for the following reasons:

- A quick 'n dirty [GitHub code search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code)
  reveals some cases where it's expected in the wild.

  Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin
  is changed temporarily during the evaluation of a &statusline expression item
  (`%{...}`), and is used to show something different on the statusline
  belonging to the previous window; that behaviour wasn't changed in v9.1.0001,
  but it means curwin == prevwin makes sense in some cases.

- The definition and call sites of back_to_prevwin imply some expectation that
  prevwin == wp (== curwin) is possible, as it's used to skip entering the
  prevwin in that case.

- Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in
  v9.1.0001, but now does. That resulted in vim/vim#14047 being opened, as it affected
  the CtrlP plugin.

  I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing
  nothing, but it may be preferable to keep things that way (or instead also
  beep if curwin == prevwin, if that's preferred).

- After more digging, I found cases in win_free_mem, enter_tabpage,
  aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible
  (many of them from autocommands). Others probably exist too, especially in
  places where curwin is changed temporarily.

fixes: vim/vim#14047
closes: vim/vim#14186

d64801e913
2024-03-12 21:14:40 +00:00
Gregory Anders
dc7ccd6bca
fix(treesitter): use 0 as initial value for computing maximum (#27837)
Using -1 as the initial value can cause the pattern offset to become
negative, which in turn results in a negative subpriority, which fails
validation in nvim_buf_set_extmark.
2024-03-12 16:13:40 -05:00
Gregory Anders
cb46f6e467
feat(treesitter): support URLs (#27132)
Tree-sitter queries can add URLs to a capture using the `#set!`
directive, e.g.

  (inline_link
    (link_text) @text.reference
    (link_destination) @text.uri
    (#set! @text.reference "url" @text.uri))

The pattern above is included by default in the `markdown_inline`
highlight query so that users with supporting terminals will see
hyperlinks. For now, this creates a hyperlink for *all* Markdown URLs of
the pattern [link text](link url), even if `link url` does not contain
a valid protocol (e.g. if `link url` is a path to a file). We may wish to
change this in the future to only linkify when the URL has a valid
protocol scheme, but for now we delegate handling this to the terminal
emulator.

In order to support directives which reference other nodes, the
highlighter must be updated to use `iter_matches` rather than
`iter_captures`. The former provides the `match` table which maps
capture IDs to nodes. However, this has its own challenges:

- `iter_matches` does not guarantee the order in which patterns are
  iterated matches the order in the query file. So we must enforce
  ordering manually using "subpriorities" (#27131). The pattern index of
  each match dictates the extmark's subpriority.
- When injections are used, the highlighter contains multiple trees. The
  pattern indices of each tree must be offset relative to the maximum
  pattern index from all previous trees to ensure that extmarks appear
  in the correct order.
- The `iter_captures` implementation currently has a bug where the
  "match" table is only returned for the first capture within a pattern
  (see #27274). This bug means that `#set!` directives in a query
  apply only to the first capture within a pattern. Unfortunately, many
  queries in the wild have come to depend on this behavior.
  `iter_matches` does not share this flaw, so switching to
  `iter_matches` exposed bugs in existing highlight queries. These
  queries have been updated in this repo, but may still need to be
  updated by users. The `#set!` directive applies to the _entire_ query
  pattern when used without a capture argument. To make `#set!`
  apply only to a single capture, the capture must be given as an
  argument.
2024-03-12 09:32:17 -05:00
Tomas Slusny
41fb98d6fa
fix: move fswatch linux check inside of vim.schedule (#27824)
Fixes issue reported in the original PR:
https://github.com/neovim/neovim/pull/27810

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-03-12 15:15:55 +08:00
dundargoc
a74e869ffa
docs: small fixes (#27364)
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: Ynda Jas <yndajas@gmail.com>
Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com>
Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com>
Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com>
Co-authored-by: cuinix <915115094@qq.com>
2024-03-12 13:51:53 +08:00
zeertzjq
59e3bcfb00
vim-patch:5cd86c6cff94 (#27822)
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>
2024-03-12 07:20:04 +08:00
zeertzjq
e20e5ecf0a
vim-patch:9.1.0167: Changing buffer in another window causes it to show matchparen (#27820)
Problem:  Changing buffer in another window using win_execute() causes
          it to show matchparen (after 9.0.0969).
Solution: Delay highlighting with SafeState in BufWinEnter.
          (zeertzjq)

closes: vim/vim#14177

49ffb6b428
2024-03-12 07:19:47 +08:00
zeertzjq
9cc755ad6a
vim-patch:0049a495c8d4 (#27817)
runtime(doc): improve 'winfixbuf' docs (vim/vim#14180)

- Make it not sound like a buffer option.
- "!" is called a modifier, not an option.

0049a495c8
2024-03-12 05:39:21 +08:00
Tomas Slusny
0f20b7d803 docs: adjust fswatch overflow message to mention docs with info
- Add :h fswatch-limitations that notifies user about default inotify
  limitations on linux and how to adjust them
- Check for Event queue overflow message from fswatch and refer user to
  new documentation

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-03-11 14:05:26 +00:00
Lewis Russell
cdbc3e3f3e fix(editorconfig): syntax error regression 2024-03-11 10:06:57 +00:00
Colin Kennedy
141182d6c6 vim-patch:9.1.0147: Cannot keep a buffer focused in a window
Problem:  Cannot keep a buffer focused in a window
          (Amit Levy)
Solution: Add the 'winfixbuf' window-local option
          (Colin Kennedy)

fixes:  vim/vim#6445
closes: vim/vim#13903

2157035637

N/A patch:
vim-patch:58f1e5c0893a
2024-03-11 11:38:13 +08:00
Lewis Russell
a09ddd7ce5 docs(editorconfig): move to source 2024-03-10 23:20:44 +00:00
Riley Bruins
09a919f313 docs: more accurate typing for vim.tbl_extend 2024-03-10 23:20:26 +00:00
zeertzjq
47942db307
vim-patch:675cbfb47f03 (#27806)
runtime(doc): Update Markdown syntax, add missing configs

fixes: vim/vim#14168

675cbfb47f

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-03-11 06:41:53 +08:00
Oscar Creator
06fcf71bd0 fix(fswatch): --latency is locale dependent 2024-03-10 19:50:32 +00:00
zeertzjq
b465ede2c7
vim-patch:9.1.0138: too many STRLEN calls when getting a memline (#27799)
Problem:  too many STRLEN calls when getting a memline
Solution: Optimize calls to STRLEN(), add a few functions in memline.c
          that return the byte length instead of relying on STRLEN()
          (John Marriott)

closes: vim/vim#14052

02d7a6c6cf

Cherry-pick line break changes from patch 8.1.0226.
Cherry-pick ml_line_len from patch 8.1.0579.
Cherry-pick test_comments.vim change from patch 9.1.0153.

Co-authored-by: John Marriott <basilisk@internode.on.net>
2024-03-10 17:08:00 +08:00
zeertzjq
b5f870cf12 vim-patch:5d67aef3060d
runtime(vim): Update base-syntax, improve :map highlighting (vim/vim#14141)

Improve :map command highlighting.

- Fix multiline RHS matching, allow continued lines and comments.
- Allow ^V-escaped whitespace in LHS.
- Handle map-bar properly and allow trailing commands.

Fixes issue vim/vim#12672.

5d67aef306

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-10 10:39:43 +08:00
zeertzjq
84b6ae82c7 vim-patch:62b26040eb4b
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>
2024-03-10 10:39:43 +08:00
Christian Clason
3c66e285cc vim-patch:a2c65809dafe
runtime(java): Recognise string templates (vim/vim#14150)

As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.

According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines.  Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.

References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465

a2c65809da

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-10 10:36:26 +08:00
Sean Dewar
b596732831
Merge pull request #27330 from seandewar/win_set_config-fixes
fix(api): various window-related function fixes

This is a big one!
2024-03-09 22:32:20 +00:00
Lewis Russell
ade1b12f49 docs: support inline markdown
- Tags are now created with `[tag]()`
- References are now created with `[tag]`
- Code spans are no longer wrapped
2024-03-09 11:21:55 +00:00
dundargoc
649dd00fe2 feat!: remove deprecated functions 2024-03-09 10:54:24 +01:00