Commit Graph

7016 Commits

Author SHA1 Message Date
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
Sean Dewar 24dfa47e4f
vim-patch:partial:9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands
Problem:  win_splitmove fires WinNewPre and possibly WinNew when moving
          windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
          window, even if it isn't the current window. Improve the
          accuracy of related documentation. (Sean Dewar)

96cc4aef3d

Partial as WinNewPre has not been ported yet (it currently has problems anyway).
2024-03-08 23:24:04 +00:00
Sean Dewar a70eae57bd
fix(api): make open_win block only enter/leave events if !enter && !noautocmd
Problem: nvim_open_win blocking all win_set_buf autocommands when !enter &&
!noautocmd is too aggressive.

Solution: temporarily block WinEnter/Leave and BufEnter/Leave events when
setting the buffer. Delegate the firing of BufWinEnter back to win_set_buf,
which also has the advantage of keeping the timing consistent (e.g: before the
epilogue in enter_buffer, which also handles restoring the cursor position if
autocommands didn't change it, among other things). Reword the documentation for
noautocmd a bit.

I pondered modifying do_buffer and callees to allow for BufEnter/Leave being
conditionally disabled, but it seems too invasive (and potentially error-prone,
especially if new code paths to BufEnter/Leave are added in the future).

Unfortunately, doing this has the drawback of blocking ALL such events for the
duration, which also means blocking unrelated such events; like if window
switching occurs in a ++nested autocmd fired by win_set_buf. If this turns out
to be a problem in practice, a different solution specialized for nvim_open_win
could be considered. :-)
2024-03-08 23:24:04 +00:00
Sean Dewar b1577d371a
fix(api): make win_set_config with "win" for splits need "split/vertical"
Problem: currently, for splits, nvim_win_set_config accepts win without any of
split or vertical set, which has little effect and seems error-prone.

Solution: require at least one of split or vertical to also be set for splits.

Also, update nvim_win_set_config docs, as it's no longer limited to just
floating and external windows.
2024-03-08 23:24:04 +00:00
zeertzjq d741e5d162 vim-patch:9.1.0154: shm=F not respected when reloading buffer with 'autoread'
Problem:  shm=F not respected when reloading buffer with 'autoread'
Solution: Check SHM_FILEINFO in buf_check_timestamp()
          (Shougo Matsushita)

closes: vim/vim#14144

9db39b0ec9

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-03-08 06:53:37 +08:00
zeertzjq 5f3579e6ea
vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766)
Problem:  Duplicate assignment in f_getregion().
Solution: Remove the duplicate assignment.  Also improve getregion()
          docs wording and fix an unrelated typo (zeertzjq)

closes: vim/vim#14154

0df8f93bda
2024-03-08 06:44:57 +08:00
altermo 04232a19cc fix(type): remove incorrect arguments from vim.rpc* 2024-03-07 09:38:50 +00:00
Maria José Solano e52c25b761 feat(lua): deprecate vim.tbl_add_reverse_lookup 2024-03-07 10:24:34 +01:00
zeertzjq 6525832a8c
vim-patch:9.1.0155: can only get getregion() from current buffer (#27757)
Problem:  can only call getregion() for current buffer
Solution: Allow to retrieve selections from different buffers
          (Shougo Matsushita)

closes: vim/vim#14131

84bf6e658d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-03-07 06:43:08 +08:00
altermo ae5095cac9 fix(fs): use generics for better typing 2024-03-06 21:56:47 +00:00
Maria José Solano 0101bdaa1a docs(lsp): nits and typos in client.lua 2024-03-06 19:37:20 +00:00
Will Hopkins 191cca2566 fix(types): move type annotation for `IterMod` 2024-03-06 16:03:58 +00:00
Lewis Russell 85b13751a5 refactor(types): more fixes (2) 2024-03-06 16:03:33 +00:00
Yi Ming 3c572a31a3 docs(treesitter): fix ambiguous parameter description about `lang` 2024-03-06 14:21:46 +01:00
Lewis Russell 3e016fa8d4 fix(lsp): actually send diagnostic-tags back to the server
Fixes #27318
2024-03-06 11:12:41 +00:00
Lewis Russell 8149bd089e feat(lsp): report fswatch errors
Resolves #27713

Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
2024-03-06 10:57:21 +00:00
Lewis Russell 3d2aeec68d refactor(lua): more efficient vim.tbl_islist
No need to run a full iteration of the table. Simply return false when
the next key isn't what we expect.
2024-03-06 10:57:04 +00:00
Lewis Russell ea44f74d84 refactor(types): more fixes 2024-03-06 10:45:22 +00:00
Christian Clason d72c9d1d19 vim-patch:63c39e4ef749
runtime(c): Recognize "__inline" (vim/vim#14145)

`__inline` is recognized by GCC, and may even be preferred, as MSVC does
not recognize `__inline__`.

63c39e4ef7

Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
2024-03-06 10:05:12 +01:00
Lewis Russell a4290f462e docs(lua): improvements for LSP and Diagnostic 2024-03-05 13:36:46 +00:00
zeertzjq 0ffc926499
vim-patch:e5c9ba601573 (#27737)
runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (vim/vim#14137)

* runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups

- Remove contained :syntax and :highlight sub-groups from the function
  body cluster.  These should only match in the respective commands.
- Remove vimSynLine syntax group from several clusters.  The definition
  of vimSynLine was removed in Vim 5.3.

* runtime(vim): Update syntax generator, use standard Last Change date format

The de facto standard date format is YYYY MMM DD.

e5c9ba6015

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-05 11:28:34 +08:00
Christian Clason 9716020293 vim-patch:d9ebd46bd090
runtime(mswin): Use unnamed register when clipboard not working (vim/vim#13813)

* Use unnamed register while clipboard not exist
* Do not need to specify the unnamed register explicitly
fixes: vim/vim#13809

d9ebd46bd0

Co-authored-by: Shixian Li <34830785+znsoooo@users.noreply.github.com>
2024-03-04 23:03:09 +01:00
Christian Clason 66c9f987e7 vim-patch:1bdc9435c1a1
runtime(sh): Update syntax file, fix issue vim/vim#962 (vim/vim#14138)

Allow the opening parenthesis of a multiline array assignment, within an
if statement, to appear at EOL.

Fixes issue vim/vim#962.

1bdc9435c1

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-04 23:03:09 +01:00
Christian Clason 56734226af vim-patch:e84490311ba3
runtime(css): update syntax script

e84490311b

Co-authored-by: Jay Sitter <jay@jaysitter.com>
2024-03-04 23:03:09 +01:00
altermo a8131aee9e
fix(tohtml): replace hex escape with digit escape (#27728) 2024-03-04 19:08:23 +08:00
Luna Saphie Mittelbach 3df1211ebc
docs(lua): clarify when `vim.bo`/`vim.wo` acts like `:setlocal` (#27708) 2024-03-04 07:33:09 +08:00
zeertzjq fc2be84e44 vim-patch:691aee8b0705
runtime(vim): Update base-syntax, fix issue vim/vim#14135 (vim/vim#14136)

Fix incorrect error highlighting for function calls in :command
definitions.  vimFunctionError should be restricted to :function header
lines.

fixes: vim/vim#14135

691aee8b07

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-04 06:44:54 +08:00
zeertzjq b86799a076 vim-patch:c4aef9a97b36
runtime(vim): Update base-syntax, improve :augroup highlighting (vim/vim#14125)

- Explicitly match the bang and group name in :aug! {name}.
- Allow any characters in a group name.
- Match default group switch marker, END.
- Match :aug without arguments (list command).

c4aef9a97b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-04 06:40:31 +08:00
Christian Clason 3971797be1 vim-patch:b3030b653bbd
runtime(java): Recognise text blocks (vim/vim#14128)

Also, accept as valid the space escape sequence `\s`.

Also, consistently use the claimed `javaDebug` prefix for
syntax group definitions kept under `g:java_highlight_debug`.

Since `javaStringError` is commented out for its generality,
let's comment out `javaDebugStringError`, its copy, as well.

References:
https://openjdk.org/jeps/378
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7

Closes vim/vim#10910.

b3030b653b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-03 17:41:04 +01:00
Christian Clason bf695b5ef4 vim-patch:e93afc2e6126
runtime(r,rhelp,rmd,rnoweb,rrst): Update ftplugin, browsefilter labels (vim/vim#14126)

Use the standard format for browsefilter labels:
  "File Description (*.ext1, *.ext2, *.ext3)"

e93afc2e61

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-03-03 10:38:58 +01:00
Jaehwang Jung dc8c086c7e
fix(lsp): directly rename the existing buffers when renaming (#27690)
Problem:
`vim.lsp.util.rename()` deletes the buffers that are affected by
renaming. This has undesireable side effects. For example, when renaming
a directory, all buffers under that directory are deleted and windows
displaying those buffers are closed. Also, buffer options may change
after renaming.

Solution:
Rename the buffers with :saveas.

An alternative approach is to record all the relevant states and restore
it after renaming, but that seems to be more complex. In fact, the older
version was attempting to restore the states but only partially and
incorrectly.
2024-03-02 15:21:53 +01:00
Jaehwang Jung 39cc38a87b
fix(lsp): defer writing error msgs (#27688)
Context:
Nvim catches errors from the user's `on_exit` and rpc handler callbacks
and prints the error message.

Problem:
Printing the error message uses Nvim api functions. But callbacks
mentioned above run in `:h lua-loop-callbacks` where most of `vim.api`
is not allowed, so Nvim itself raises error.

Solution:
`vim.schedule()` the error reporting when necessary.
2024-03-02 10:51:10 +01:00
Christian Clason 72e0ef2f46 vim-patch:100a665634a0
runtime(java): Improve the recognition of literals (vim/vim#14120)

* Emend the Unicode and octal escape sequence patterns;
* Accept the (repeated) underscore separators in all
  numerical literals;
* Recognise hexadecimal floating-point literals.

(The space escape sequence '\s' will be introduced along
with text blocks in another PR.)

References:
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.3
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.1
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.2
https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7

100a665634

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
2024-03-02 10:06:26 +01:00
Lewis Russell 39928a7f24
Merge pull request #27347 from lewis6991/fswatch
feat(lsp): add fswatch watchfunc backend
2024-03-01 23:31:20 +00:00
Lewis Russell a5fe8f59d9 docs: improve/add documentation of Lua types
- Added `@inlinedoc` so single use Lua types can be inlined into the
  functions docs. E.g.

  ```lua
  --- @class myopts
  --- @inlinedoc
  ---
  --- Documentation for some field
  --- @field somefield integer

  --- @param opts myOpts
  function foo(opts)
  end
  ```

  Will be rendered as

  ```
  foo(opts)

    Parameters:
      - {opts} (table) Object with the fields:
               - somefield (integer) Documentation
                 for some field
  ```

- Marked many classes with with `@nodoc` or `(private)`.
  We can eventually introduce these when we want to.
2024-03-01 23:02:18 +00:00
Lewis Russell 4ff3217bbd feat(lsp): add fswatch watchfunc backend
Problem:
  vim._watch.watchdirs has terrible performance.

Solution:
  - On linux use fswatch as a watcher backend if available.

  - Add File watcher section to health:vim.lsp. Warn if watchfunc is
    libuv-poll.
2024-03-01 23:00:20 +00:00
Will Hopkins 813dd36b72
fix(types): rename win_get_config return type to win_config
Follow-up to #27397
2024-03-02 06:59:32 +08:00
zeertzjq 1fe65b3457
vim-patch:87410ab3f556 (#27696)
runtime(doc): some improvements to getregion() docs (vim/vim#14122)

- Mention the default selection behavior
- Remove useless sentence
- Correct description about space padding

87410ab3f5
2024-03-02 06:42:39 +08:00
Lewis Russell 816b56f878 fix(lsp): cancel watchers when closing a client 2024-03-01 22:30:27 +00:00
Lewis Russell bf1e098d97 refactor(watch): simplify filechanges processing 2024-03-01 22:30:27 +00:00
Lewis Russell b87505e116 refactor(watch): general tidy up
- Rename watch.poll to watch.watchdirs
- Unify how include and exclude is applied
- Improve type hints
2024-03-01 22:30:27 +00:00
Jaehwang Jung b413f5d048
fix(lsp): rename undofile when renaming (#27684)
Problem:
After `rename()`, the undo information for the renamed file(s) are lost.

Solution:
Rename the undofile as well.
2024-03-01 18:31:54 +01:00
glepnir a5ade3c63d fix(snippet): correct indent with newline
Problem: snippet newline use before line indent after expand.

Solution: it should level + 1.
2024-03-01 14:35:52 +08:00
Christian Clason 41f2cbe171 vim-patch:8fad5d58874e
runtime(doc,netrw): update "Last Change header", remove trailing whitespace

Update Last-Change Header for netrw and doc/indent.txt, fix a trailing
whitespace in indent.txt and make CI happy.

8fad5d5887

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 22:54:57 +01:00
Christian Clason c8299d15db vim-patch:b4eb3f1e4489
runtime(yaml): disable multiline_scalar detection by default

There have been many complaints about Yaml indenting too much, because
it considers values to be multi-line by default, which leads to
unintended indenting for (apparently most) users.

So let's hide this feature behind the new feature flag, keep it
simple and prefer single line value key pairs by default.

If you want the old behaviour, set the following value: >

  :let g:yaml_indent_multiline_scalar = 1

If not set, it will indent the same as the previous line.

closes vim/vim#13845

b4eb3f1e44

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 22:54:57 +01:00
Christian Clason bfcf5666cc vim-patch:56b7da3c051f
runtime(netrw): handle file/dir symlinks specifically in tree mode

fixes: vim/vim#2386
related: vim/vim#3609

56b7da3c05

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-29 22:54:57 +01:00
glepnir 6ab0876f51 docs(eval): getline and indent function support string type
Problem: getline and indent function missing string type in param.

Solution: add string type in eval gen.
2024-02-29 13:30:25 +00:00
Christian Clason 2c8f36a3b0 fix(lsp): use plain loop for non-list-like table of protocol values
Fixup for #27628

Closes #27669
2024-02-29 11:37:30 +01:00
Christian Clason 86c3f284fc vim-patch:9ecf02cd5f5f
runtime(java): Recognise _when_ clauses in _switch_ blocks

Also:

- distinguish _yield_ when used as a contextual keyword from
  when used qualified as a method or a method reference (as
  can be seen in testdir/input/java_switch.java, variables
  and method declarations named _yield_ will be recognised
  as the namesake keyword--consider picking other names for
  variables, and defining g:java_highlight_functions to have
  method names painted; since _yield_ statements can have
  trailing parens, they must be recognised as statements,
  for only qualified _yield_ method calls are supported);

- recognise grouped _default_ _case_ labels;

- describe primitive types for _case_ labels (JLS, §14.11,
  §3.10.1);

- recognise some non-ASCII identifiers (see javaLambdaDef,
  javaUserLabel) (further improvement for better recognition
  of identifiers will be arranged in a separate PR).

Because the arrow '->' is used in two kinds of expressions,
lambda (abstractions) and _switch_, necessary changes were
made for the recognition of either (and further improvement
touching lambda expressions will be separately arranged).

Because 'default' is used for instance method declarations
in interfaces and in _switch_ labels, necessary changes were
made for the recognition of either (and further improvement
touching method declarations will be separately arranged).

Finally, it deemed appropriate to put 'yield' in the syntax
group of javaOperator rather than javaStatement, for its
member 'var' is also another contextual keyword (e.g., this
is valid syntax: "var var = var(test.var);").

References:
https://openjdk.org/jeps/361 (Switch Expressions)
https://openjdk.org/jeps/440 (Record Patterns)
https://openjdk.org/jeps/441 (Pattern Matching for switch)

Also, add a Java specific filetype plugin for the syntax
test, so that no soft-wrapping of long indented lines occur.

Otherwise the syntax scripts would miss a few lines during
scrolling and verification of the screen dumps.

closes: vim/vim#14105

9ecf02cd5f

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-02-29 09:53:09 +01:00
zeertzjq f9e7c4c9c4
refactor(defaults): use getregion() for Visual mode gx (#27663)
Also make it work better on a multiline selection.
2024-02-29 08:21:13 +08:00
zeertzjq ce7c51a1a3
vim-patch:9.1.0142: getregion() can be improved (#27662)
Problem:  getregion() can be improved (after v9.1.120)
Solution: change getregion() implementation to use pos as lists and
          one optional {opt} dictionary (Shougo Matsushita)

Note: The following is a breaking change!

Currently, the getregion() function (included as of patch v9.1.120) takes
3 arguments: the first 2 arguments are strings, describing a position,
arg3 is the type string.

However, that is slightly inflexible, there is no way to specify
additional arguments. So let's instead change the function signature to:

getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists.
This is slightly cleaner, and gives us the flexibility to specify
additional arguments as key/value pairs to the optional Dict arg.

Now it supports the "type" key to specify the selection type
(characterwise, blockwise or linewise) and now in addition one can also
define the selection type, independently of what the 'selection' option
actually is.

Technically, this is a breaking change, but since the getregion()
Vimscript function is still quite new, this should be fine.

closes: vim/vim#14090

19b718828d

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-02-29 07:19:26 +08:00
Maria José Solano f912030d4e
docs(lpeg): remove double backticks from meta (#27659) 2024-02-29 06:14:49 +08:00
Maria José Solano 853f647da6 fix(lsp): handle reverse lookup in capabilities 2024-02-28 20:20:02 +00:00
Maria José Solano d981670bc9 refactor(lsp): remove outdated comment 2024-02-28 20:20:02 +00:00
Christian Clason 0246f1a897 fix(tohtml): set filetype of generated HTML to `html`
Problem: `:TOhtml` opens the generated HTML code in a split, meaning it
inherits the `help` filetype if a help buffer is to be converted.

Solution: Explicitly set the filetype to `html`.
2024-02-28 18:34:12 +00:00
notomo aa62898ae3
fix(lsp): correct the error message's cmd on spawning (#27632) 2024-02-28 17:36:28 +01:00
Jaehwang Jung 7311958e12
fix(lsp): remove unnecessary file load/write when renaming (#27621)
Previously rename would unconditionally read the to-be-renamed file from the
disk and write it to the disk. This is redundant in some cases

If the file is not already loaded, it's not attached to lsp client, so nvim
doesn't need to care about this file.
If the file is loaded but has no change, it doesn't need to be written.
2024-02-28 17:32:25 +01:00
altermo 2f85bbe615 feat!: rewrite TOhtml in lua
Co-authored-by: wookayin <wookayin@gmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <me@lewisr.dev>
2024-02-28 16:26:00 +00:00
Christian Clason 07b4b7524f vim-patch:e84d2d4432cd
runtime(sh): Update ftplugin, fix vim/vim#14101 (vim/vim#14102)

Add the 'b' flag to 'comments', so that the shebang line is not detected as comment.

Fixes vim/vim#14101.

e84d2d4432

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-28 10:56:58 +01:00
Ilia Choly 0190771713
fix(lua): remove uri fragment from file paths (#27647)
Problem: Some LSP servers return `textDocument/documentLink` responses
         containing file URIs with line/column numbers in the fragment.
         `vim.uri_to_fname` returns invalid file names for these URIs.

Solution: Remove the URI fragment from file URIs.
2024-02-28 10:50:53 +01:00
Maria José Solano cb146cc4aa docs(lpeg): merge upstream changes 2024-02-28 09:22:09 +00:00
zeertzjq a7788c2e25
vim-patch:b1427b46f5fe (#27652)
runtime(vim): Update base-syntax, improve :echo highlighting (vim/vim#14103)

- Normalise behaviour of :echo commands and improve expression matching.
- Allow continued argument lines.
- Refine string interpolation groups.
- Remove duplicated :menu and :map generated commands that are handled
  specially later in the file.

b1427b46f5

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-28 07:57:18 +08:00
Maria José Solano 63f9c2da9a feat(lsp): support completion itemDefaults 2024-02-27 16:50:51 +01:00
Maria José Solano 3d96e3f9f2 refactor(lsp): alias for CompletionResult 2024-02-27 16:50:51 +01:00
Lewis Russell 9beb40a4db feat(docs): replace lua2dox.lua
Problem:

The documentation flow (`gen_vimdoc.py`) has several issues:
- it's not very versatile
- depends on doxygen
- doesn't work well with Lua code as it requires an awkward filter script to convert it into pseudo-C.
- The intermediate XML files and filters makes it too much like a rube goldberg machine.

Solution:

Re-implement the flow using Lua, LPEG and treesitter.

- `gen_vimdoc.py` is now replaced with `gen_vimdoc.lua` and replicates a portion of the logic.
- `lua2dox.lua` is gone!
- No more XML files.
- Doxygen is now longer used and instead we now use:
  - LPEG for comment parsing (see `scripts/luacats_grammar.lua` and `scripts/cdoc_grammar.lua`).
  - LPEG for C parsing (see `scripts/cdoc_parser.lua`)
  - Lua patterns for Lua parsing (see `scripts/luacats_parser.lua`).
  - Treesitter for Markdown parsing (see `scripts/text_utils.lua`).
- The generated `runtime/doc/*.mpack` files have been removed.
   - `scripts/gen_eval_files.lua` now instead uses `scripts/cdoc_parser.lua` directly.
- Text wrapping is implemented in `scripts/text_utils.lua` and appears to produce more consistent results (the main contributer to the diff of this change).
2024-02-27 14:41:17 +00:00
Maria José Solano 7ad2e3c645
docs: fix type of setreg() argument {options} (#27631) 2024-02-27 19:53:49 +08:00
Christian Clason 1a7c38caec vim-patch:c7ddc9b73543
runtime(debian): update Debian syntax files (#14098)

* debversions.vim: Move lunar to unsupported release
* debsources: Add word boundaries around keyword match patterns

c7ddc9b735

Co-authored-by: James McCoy <jamessan@jamessan.com>
Co-authored-by: James Addison <jay@jp-hosting.net>
2024-02-27 10:31:11 +01:00
zeertzjq a4b4442524
vim-patch:2c51e15b66a4 (#27637)
runtime(vim): Update syntax file, improve :substitute matching (vim/vim#14093)

- Differentiate between :substitute and substitute(), fixes vim/vim#13883.
- Match all allowed :substitute delimiters.
- Remove leading context from :substitute matches.

2c51e15b66

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-27 06:22:57 +08:00
zeertzjq 0d75324e3b
vim-patch:9.1.0137: <Del> in cmdline mode doesn't delete composing chars (#27636)
Problem:  <Del> in cmdline mode doesn't delete composing chars
Solution: Use mb_head_off() and mb_ptr2len() (zeertzjq)

closes: vim/vim#14095

ff2b79d239
2024-02-27 06:09:06 +08:00
Gregory Anders a8e4ee2f2b
fix(defaults): validate 'channel' before responding to OSC request (#27594)
Validate the channel number before responding to an OSC 10/11 request.
When used with nvim_open_term, the channel number is unset (since there
is no process on the other side of the PTY).
2024-02-26 11:33:16 -06:00
VanaIgr ad5a155b1f
fix(mbyte): fix bugs in utf_cp_*_off() functions
Problems:
- Illegal bytes after valid UTF-8 char cause utf_cp_*_off() to fail.
- When stream isn't NUL-terminated, utf_cp_*_off() may go over the end.
Solution: Don't go over end of the char of end of the string.
2024-02-26 18:12:55 +08:00
Maria José Solano 185752614d refactor(types): fix miscellaneous type warnings 2024-02-25 22:08:11 +00:00
zeertzjq c651a0f643
vim-patch:partial:d086b8f646a6 (#27623)
runtime(doc): fix inconsistent indent (vim/vim#14089)

d086b8f646
2024-02-25 16:38:34 +08:00
Gregory Anders 2e1f5055ac
fix(lsp): add assertion for explicit bufnr in apply_text_edits (#27614)
Assert that the buffer number passed to apply_text_edits is fully
resolved (not 0 or null). Pass the known buffer number to
apply_text_edits from lsp.formatexpr().
2024-02-24 19:21:57 -06:00
Evgeni Chasnovski c2ddef30e7
docs: fix several misleading and superfluous wordings (#27609) 2024-02-25 08:45:34 +08:00
zeertzjq 52fe3741aa
vim-patch:374e26aba2e5 (#27617)
runtime(doc): clarify ':set[l] {option}<' behaviour

closes: vim/vim#14062

374e26aba2

Co-authored-by: Matt Ellis <m.t.ellis@gmail.com>
2024-02-25 08:19:43 +08:00
Jaehwang Jung 8addd27504
fix(lsp): when renaming directory, check path prefix of buffer names (#27603)
For example, when renaming /path/to/dir, buffers like
fern://drawer/file:///path/to/dir, /path/to/dir123 should not be
matched.
2024-02-24 16:47:34 +01:00
Christian Clason a0394b648c docs(lsp): mark `ClientConfig.init_options` as optional
Followup to neovim/neovim#27443
2024-02-24 15:45:54 +01:00
Jaehwang Jung 90f6d999b1
refactor(lsp): remove redundant code (#27601)
* use builtin function
* buffer:// was removed in 236c20795e.
2024-02-24 13:14:12 +01:00
zeertzjq 9418381ccc
vim-patch:a35235e824bb (#27598)
runtime(doc) Update help text for matchbufline() and matchstrlist()

closes: vim/vim#14080

a35235e824

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2024-02-24 17:55:32 +08:00
Tim Pope 15f7ac6a04
docs(lsp): remove obsolete didChangeConfiguration explanation (#27595)
Rendered obsolete by c6d747e6a5.
2024-02-24 07:19:33 +01:00
Christian Clason 7e008799a8 vim-patch:315cd1fbcbba
runtime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)

rpm-4.19.0 added a new SourceLicense tag. It is used at the same place
as License tag.

This patch adds the new tag name into a Vim syntax file to be
highligted the same way as the License tag. Note that it has to be
defined in the syntax file before Source\d* regexp. Otherwise it's not
recognized by Vim.

315cd1fbcb

Co-authored-by: Petr Pisar <ppisar@redhat.com>
2024-02-23 09:31:30 +01:00
zeertzjq eb4783fb6c
refactor(defaults): use getregion() for default * and # mappings 2024-02-23 08:12:46 +08:00
zeertzjq df1795cd6b
vim-patch:1624970d321c (#27582)
runtime(vim): Update base-syntax, fix :unabbrev highlighting (vim/vim#14077)

Fixes issue vim/vim#7876

1624970d32

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-23 07:13:33 +08:00
zeertzjq 06df895e71 vim-patch:9.1.0126: Internal error when using upper-case mark in getregion()
Problem:  Internal error when passing mark in another buffer to
          getregion().
Solution: Don't allow marks in another buffer (zeertzjq)

closes: vim/vim#14076

Internal error when passing mark in another buffer to getregion()

421b597470
2024-02-23 06:39:05 +08:00
zeertzjq 20e4001eee vim-patch:9.1.0120: hard to get visual region using Vim script
Problem:  hard to get visual region using Vim script
Solution: Add getregion() Vim script function
          (Shougo Matsushita, Jakub Łuczyński)

closes: vim/vim#13998
closes: vim/vim#11579

3f905ab3c4

Cherry-pick changes from patch 9.1.0122, with :echom instead of :echow.

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
2024-02-23 06:39:03 +08:00
再生花 bb15fa0356
feat(treesitter): add folding for `InspectTree` (#27518)
As the InspectTree buffer is now a valid tree-sitter query tree, we can
use the bundled fold queries to have folding for the tree.
2024-02-22 14:58:59 -06:00
Evgeni Chasnovski 85cb0b0ddc
fix(defaults): make terminal autoclose not block other events (#27581)
Problem: When terminal is autocloses, it blocks other events, like
  `BufEnter`.

Solution: Use `nested = true`.
2024-02-22 13:54:21 -06:00
Christian Clason 0760d98680 vim-patch:20d61e1b94e5
runtime(java): add syntax support for Java switch expressions (#9124)

20d61e1b94

Co-authored-by: Nick Hanley <nicholasjhanley@gmail.com>
2024-02-22 16:27:56 +01:00
zeertzjq eef2aedff6
fix(defaults): remove tmux background detection passthrough (#27571)
There is now a new tmux 3.4 release that queries background color from
the parent terminal if background is not set in tmux, so removing the
passthrough still works when background is not set in tmux, and fixes
the incorrect detection when background is set in tmux.
2024-02-22 21:15:56 +08:00
zeertzjq 741a6684e0
docs(builtin): show tag at first line with multiple signatures (#27577)
Problem:
When a function has multiple signatures, putting its tag at the last one
may make one think that's its only signature.

Solution:
When a function has multiple signatures, put its tag at the first one.
2024-02-22 19:39:58 +08:00
Christian Clason 42f8ada59d build(deps): bump luv to v1.48.0-0
* fix: Use os_uname() to check for Linux by @cryptomilk in #686
    * docs: typo in a table field name by @Bilal2453 in #689
    * docs: most new_handle methods won't return fail by @Bilal2453 in #683
    * test-tty: Don't depend on stdin/stdout handle type by @squeek502 in #688
    * Bump/libuv by @zhaozg in #690
    * Annotate .gitmodules with branch and tag by @creationix in #693
2024-02-22 10:07:04 +01:00
Christian Clason bba4834ede vim-patch:e8f6af609178
runtime(tmux): Update tmux syntax (#14065)

e8f6af6091

Co-authored-by: Eric Pruitt <eric.pruitt@gmail.com>
2024-02-22 09:50:35 +01:00
altermo e2e63bd045
fix(lua): make highlight.on_yank use win-local highlight (#27349)
Currently, highlight.on_yank() does buffer-local highlighting, this PR
makes it window scoped.

Also fix the problem that when yanking in a buffer, moving to another
buffer, and yanking before the original buffer highlight disappears, the
original buffer highlight won't disappear on timeout.
2024-02-22 16:39:32 +08:00
altermo 1c032ad703 feat(extmark): window scoped extmark
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-02-21 16:11:50 +01:00
rktjmp 6d8bbfe19d
docs: remove mention of foreground/background/special keys in nvim_set_hl (#27558)
To align the output of `nvim_get_hl` with its documentation -- which
points to `nvim_set_hl`, remove mentions of the keys `foreground`,
`background` and `special`.

The long keys are are still supported (via fallback checks inside
`dict2hlattrs`), but the `fg`, `bg` and `sp` keys are preferenced.
2024-02-21 21:25:08 +08:00
Maria José Solano ac0e8323dc
fix(lsp): add parentheses to generated union array types (#27560) 2024-02-21 12:31:56 +01:00
zeertzjq 9bb046d1be
vim-patch:f9ca139e3aa1 (#27554)
runtime(misc): announce adoption of various runtime files

f9ca139e3a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-21 06:30:18 +08:00
zeertzjq f25c0c1eb9
vim-patch:ef387c062bb1 (#27553)
runtime(filetype): Modula-2 files with priority not detected (vim/vim#14055)

Problem:  Modula-2 files with a specified priority are not detected.
Solution: Match the priority syntax in module header lines when
          performing heuristic content detection.

Disable the :defcompile debug line.  This was accidentally left enabled
in commit 68a8947.

ef387c062b

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-21 06:29:53 +08:00
Vu Nhat Chuong 5e4a5f1aaa
fix(vim.ui.open): use explorer.exe instead of wslview #26947
Problem:
`vim.ui.open` uses `wslview`, which is slow and require a package from external PPA:
https://wslutiliti.es/wslu/install.html#ubuntu

Solution:
Use `explorer.exe` instead. WSL supports it by default:
https://learn.microsoft.com/en-us/windows/wsl/filesystems#view-your-current-directory-in-windows-file-explorer
2024-02-20 09:14:50 -08:00
itchyny ddda5e0a48
feat(help): hide filename of "gO" outline using conceal #27547
Help outlines, invoked by `gO`, displays the help section titles in the
location list window. This feature is implemented by setting the buffer
lines after opening the window, but this implementation breaks the
assumption that the quickfix window texts are consistently constructed
by the quickfix list items. I think we can use the conceal feature here.
Using conceal here improves interoperability between quickfix plugins,
and also simplifies the outline implementation.

Originally reported at https://github.com/itchyny/vim-qfedit/issues/12
2024-02-20 03:57:13 -08:00
zeertzjq a0790558c3
fix(extmarks): priority order of inline and non-inline virt_text (#27532) 2024-02-20 19:53:49 +08:00
Maria José Solano cc15ba212c refactor(lsp): typings for protocol constants 2024-02-19 11:23:35 +00:00
zeertzjq a9f578b7a5
docs: improve 'tabline' click label docs (#27529) 2024-02-19 11:22:00 +08:00
Nacho Nieva fa131de9ad
feat(tabline): middle mouse button now closes tab (#27522) 2024-02-19 10:49:33 +08:00
Gregory Anders 478273a423
fix: fix iter_matches call in query linter (#27496) 2024-02-16 14:00:19 -06:00
Thomas Vigouroux bd5008de07
fix(treesitter): correctly handle query quantifiers (#24738)
Query patterns can contain quantifiers (e.g. (foo)+ @bar), so a single
capture can map to multiple nodes. The iter_matches API can not handle
this situation because the match table incorrectly maps capture indices
to a single node instead of to an array of nodes.

The match table should be updated to map capture indices to an array of
nodes. However, this is a massively breaking change, so must be done
with a proper deprecation period.

`iter_matches`, `add_predicate` and `add_directive` must opt-in to the
correct behavior for backward compatibility. This is done with a new
"all" option. This option will become the default and removed after the
0.10 release.

Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: MDeiml <matthias@deiml.net>
Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-02-16 11:54:47 -06:00
Marcus Michaels 1ba3500abd
docs(tutor): include https urls where applicable (#27461)
Problem:  URLs in :Tutor use "http" instead of "https".
Solution: Update URLs with a valid "https" equivalent.
2024-02-16 20:54:32 +08:00
zeertzjq 615b48aca6 fix(runtime): add more Nvim-only highlight groups to Vim syntax 2024-02-16 19:06:10 +08:00
zeertzjq 608f238bc6 vim-patch:1633de8c35fd
runtime(vim): Update base-syntax, remove unused vimString region

These were included with the initial release of the syntax file for Vim
5 and were probably intended to allow for syn-region start/skip/end
patterns with a '!' or '+' delimiter.  However, these cases are
currently handled by the vimSynRegPat group.

The removed patterns never match anywhere in the distributed runtime
files and it is believed that this is generally true.

closes: vim/vim#14035

1633de8c35

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-02-16 19:06:10 +08:00
zeertzjq 18dfe175e7 vim-patch:fe6d5b0ae47e
runtime(vim): Update base-syntax, fix :behave highlighting

closes: vim/vim#14036

fe6d5b0ae4

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2024-02-16 19:06:10 +08:00
zeertzjq 7751ff7394 vim-patch:5c3855bcab42
runtime(vim): update Vim Syntax generator

- Add missing "Last Change:" line.
- The date on this line in vim.vim is updated by update_date.vim at
  Make time. (I made a mistake in the file path)
- Remove unnecessary "b:loaded_syntax_vim_ex".
- Remove "Base File Date:" line in vim.vim.base
- Add Doug Kearns as Maintainer

closes: vim/vim#14031

5c3855bcab

Co-authored-by: h-east <h.east.727@gmail.com>
2024-02-16 19:06:10 +08:00
zeertzjq 2a6c7d0ccc vim-patch:9b53c052d58f
runtime(vim): include Vim Syntax generator

fixes: vim/vim#13939
closes: vim/vim#14021
related: vim-jp/syntax-vim-ex#28

9b53c052d5

Omit the generator as it cannot be used for Nvim.
Keep vimHLGroup and vimOnlyHLGroup separate.

N/A patch:
vim-patch:b418a51933bb

Co-authored-by: h-east <h.east.727@gmail.com>
2024-02-16 19:05:57 +08:00
zeertzjq 5de14b7206 vim-patch:ceed36873e92
runtime(vim): accept dot in completionList for Vim9 syntax (vim/vim#13832)

if you have autoloaded command complete function in vim9script, it shouldn't be highlighted as Error:

```
import autoload "share.vim"
command! -range=% -nargs=? -complete=custom,share.Complete Share share.Paste(<q-args>, <line1>, <line2>)
```

`share.Complete` is a valid complete function.

ceed36873e

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-02-16 19:05:50 +08:00
Christian Clason 422b090e0c vim-patch:79230f027a25
runtime(less): update "Last Change:" header

Commit 103f1dfb7df350650a5d7caadb0364bd79e9d25b forgot to update the
"Last Change:" header. So update it now.

79230f027a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 08:57:45 +01:00
Christian Clason a1d977d8eb vim-patch:103f1dfb7df3
runtime(less): reset readonly setting when disabling less mode

While at it, also do the unmap only if a specific key has been mapped.
There are some keys that are only selectively mapped and it would cause
an error if we are trying to unmap such a key (e.g. z when your
foldmethod is not manual).

fixes: vim/vim#14040

103f1dfb7d

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-16 08:57:45 +01:00
Gregory Anders 55a4aa41bb
docs: document breaking change for nvim_create_autocmd callback (#27484)
https://github.com/neovim/neovim/pull/27428 changed the semantics of
callbacks passed to nvim_create_autocmd such that any truthy value will
delete the autocommand (rather than just the literal boolean value
`true`). Update the documentation accordingly and add an entry to
`news.txt`.

The behavior is now consistent between nvim_create_autocmd and
nvim_buf_attach.
2024-02-15 19:56:58 -06:00
Lewis Russell 35f453f65d fix: type warnings in shared.lua 2024-02-15 11:32:50 +00:00
Christian Clason 0a51e7626a vim-patch:9.1.0111: filetype: no support for bats files
The '*.bats' file type is for Bash Automated Testing System (BATS)
scripts. BATS scripts are Bash with a special '@test' extension but they
otherwise work with Vim's bash filetype.

See https://github.com/bats-core/bats-core

closes: vim/vim#14039

d00fb4b3a2

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
Christian Clason d0599b0ed9 vim-patch:9.1.0110: filetype: add 'Config.in' filetype detection
The 'Config.in' file type is for Buildroot configuration files.
Buildroot Config.in files use the same Kconfig backend as the Linux
kernel's Kconfig files.

Buildroot also has other filename variants that follow "Config.in.*",
they are used to distinguish multiple Config.in files in the same
directory.

See https://buildroot.org/downloads/manual/manual.html#_literal_config_in_literal_file

closes: vim/vim#14038

5f20f050ef

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
Christian Clason 7ed75d410a vim-patch:9.1.0109: filetype: no support for its files
Problem:  filetype: no support for its files
Solution: Add detection for *.its files as dts file type
          (Brandon Maier)

The '*.its' file type is for U-Boot Flattened Image Trees (FIT) which
use the flattened devicetree format.

See https://github.com/u-boot/u-boot/blob/master/doc/usage/fit/source_file_format.rst#terminology

closes: vim/vim#14037

cf1d65e060

Co-authored-by: Brandon Maier <brandon.maier@collins.com>
2024-02-15 10:01:16 +01:00
Christian Clason 4f07ad7786 vim-patch:9.1.0108: filetype: no support for dtso files
Problem:  filetype: no support for dtso files
Solution: Add detection for *.dtso files as dts file type
          (Markus Schneider-Pargmann)

*.dtso files are devicetree overlay files which have the same syntax as dts or dtsi files.

closes: vim/vim#14026

b1700fb33f

Co-authored-by: Markus Schneider-Pargmann <msp@baylibre.com>
2024-02-15 10:01:16 +01:00
Christian Clason 989312ed84 vim-patch:1da0e8581671
runtime(asciidoc): include basic ftplugin

closes: vim/vim#13873

1da0e85816

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2024-02-15 10:00:59 +01:00
zeertzjq 31b3c62845 vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors'
Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: vim/vim#14024
closes: vim/vim#14025

34e4a05d02

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-02-15 10:50:29 +08:00
zeertzjq 440ce0d246 vim-patch:9.1.0068: Visual highlighting can still be improved
Problem:  Visual highlighting can still be improved
Solution: Update Visual highlighting for 8 color terminals,
          use uniform grey highlighting for dark and light bg
          (Maxim Kim)

Update terminal Visual

1. Use `ctermbg=Grey ctermfg=Black` for both dark and light

This uniforms Visual highlighting between default dark and light colors
And should work for vim usually detecting light background for terminals
with black/dark background colors.

Previously used `ctermfg=White` leaks `cterm=bold` if available colors
are less than 16.

2. Use `term=reverse cterm=reverse ctermbg=NONE ctermfg=NONE`
   for terminals reporting less than 8 colors available

If the terminal has less than 8 colors, grey just doesn't work right

closes: vim/vim#13940

59bafc8171

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-02-15 07:49:23 +08:00
Tomasz N d09957e0a0
fix(lsp): rename: load and list new buffer if attached to window (#27408) 2024-02-14 21:11:29 +01:00
Lewis Russell 9f8c96240d refactor(lsp): resolve the config-client entanglement
Previously the LSP-Client object contained some fields that are also
in the client config, but for a lot of other fields, the config was used
directly making the two objects vaguely entangled with either not having
a clear role.

Now the config object is treated purely as config (read-only) from the
client, and any fields the client needs from the config are now copied
in as additional fields.

This means:
- the config object is no longet normalised and is left as the user
  provided it.
- the client only reads the config on creation of the client and all
  other implementations now read the clients version of the fields.

In addition, internal support for multiple callbacks has been added to
the client so the client tracking logic (done in lua.lsp) can be done
more robustly instead of wrapping the user callbacks which may error.
2024-02-13 14:49:20 +00:00
bfredl 1a3a8d903e refactor(lua): use a keyset for vim.diff opts parsing 2024-02-13 11:54:44 +01:00
bfredl 0353dd3029 refactor(lua): use Arena when converting from lua stack to API args
and for return value of nlua_exec/nlua_call_ref, as this uses
the same family of functions.

NB: the handling of luaref:s is a bit of a mess.
add api_luarefs_free_XX functions as a stop-gap as refactoring
luarefs is a can of worms for another PR:s.

as a minor feature/bug-fix, nvim_buf_call and nvim_win_call now preserves
arbitrary return values.
2024-02-13 11:54:44 +01:00
Jongwook Choi 89135cff03 fix(loader): remove cyclic dependency on vim.fs (when --luamod-dev)
Problem: Loading `vim.fs` via the `vim.loader` Lua package loader will
result in a stack overflow due to a cyclic dependency. This may happen
when the `vim.fs` module isn't byte-compiled, i.e. when `--luamod-dev`
is used (#27413).

Solution: `vim.loader` depends on `vim.fs`. Therefore `vim.fs` should
be loaded in advance.
2024-02-13 10:29:22 +00:00
Jongwook Choi 309c36d3c9 docs(builtin): fix lua types for vim.fn.sign_getplaced
Per :help sign_getplaced():

- Parameter {dict}: lnum also accepts integer as well as string
- Return value: item has field bufnr, not buf
2024-02-13 08:22:32 +00:00
Maria José Solano 1c7b0b9d5f
docs: stricter bufname and bufnr types (#27454) 2024-02-13 12:15:27 +08:00
Lewis Russell 597ecf7516 fix(lsp): re-add client.commands and mark private 2024-02-12 13:18:23 +01:00
altermo 6c168c0f4d
docs: correct on_key docs (#27429) 2024-02-12 20:03:53 +08:00
Lewis Russell 917172dd96 fix(lsp): semantic token defer loading
Fixes #27424
2024-02-12 09:31:48 +00:00
zeertzjq 950a0ac61c
vim-patch:b614b284ee06 (#27433)
runtime(vim): Update syntax file (vim/vim#14009)

- allow comments after :highight commands
- match the bang in a :highlight[!] command
- highlight the bang in :map[!], :menu[!] and :unlet[!] with vimOper
  like all other commands

b614b284ee

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-02-12 06:56:48 +08:00
Christian Clason 46390635cd vim-patch:6d91227267a5
runtime(gpg): Mark dangerous use-embedded-filename with WarningMsg

The syntax highlighter is likely to encourage people to use the listed
commands.

But `use-embedded-filename` is a dangerous option that can cause GnuPG
to write arbitrary data to arbitrary files whenever GnuPG encounters
malicious data.

GnuPG upstream explicitly warns against using this option:

https://dev.gnupg.org/T4500
https://dev.gnupg.org/T6972

However, since this is a valid option, we cannot just drop it from the
syntax script. Instead, let's mark it with the WarningMsg highlighting
to make it obvious, that this option is different (and should not be
used for security reasons).

closes: vim/vim#13961

6d91227267

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2024-02-11 20:09:43 +01:00
Lewis Russell ed1b66bd99
refactor(lsp): move more code to client.lua
The dispatchers used by the RPC client should be defined in the client,
so they have been moved there. Due to this, it also made sense to move
all code related to client configuration and the creation of the RPC
client there too.

Now vim.lsp.start_client is significantly simplified and now mostly
contains logic for tracking open clients.

- Renamed client.new -> client.start
2024-02-11 12:37:20 +00:00
Lewis Russell 8e86193502
Merge pull request #27420 from MariaSolOs/warning-anxiety
refactor(lsp): fix type annotations and add shared diagnostic helper
2024-02-11 11:42:21 +00:00
Maria José Solano eac7e3fc6c refactor(lsp): add vim.lsp.sync.Range type 2024-02-10 20:05:47 -08:00
Maria José Solano 5a6868c888 refactor(lsp): add shared diagnostic handler 2024-02-10 20:05:47 -08:00
Maria José Solano c73d67d283 refactor(lsp): add type annotations 2024-02-10 20:05:47 -08:00
Trevor Arjeski 170c890dca
feat(shortmess): "q" flag fully hides recording message (#27415)
When "q" is set in 'shortmess' it now fully hides the "recording @a" message
when you are recording a macro instead of just shortening to "recording". This
removes duplication when using reg_recording() in the statusline.

Related #19193
2024-02-11 07:39:39 +08:00
bfredl 320eec496c
Merge pull request #27253 from MariaSolOs/codelens-refresh
feat(lsp): add opts to vim.lsp.codelens.refresh
2024-02-10 21:48:45 +01:00
Christian Clason 71429c90ee build(deps): bump tree-sitter-bash to v0.20.5 2024-02-10 14:49:09 +01:00
Pablo Arias 8e739af064
fix(startup): multiprocess startuptime #26790
Problem:
Since 2448816956, the --startuptime report shows
two blocks of data. The TUI process and its embedded nvim process write to the
file concurrently, which may interleave the two startup sequences into the same
timeline.

Solution:
Report each process as a separate section in the same file.
1. Each process buffers the full report.
2. After startup is finished, the buffer is flushed (appended) to the file.

Fix #23036
Sample report:

    --- Startup times for process: Primary/TUI ---

    times in msec
     clock   self+sourced   self:  sourced script
     clock   elapsed:              other lines

    000.006  000.006: --- NVIM STARTING ---
    000.428  000.422: event init
    000.728  000.301: early init
    ...
    005.880  000.713: init highlight
    005.882  000.002: --- NVIM STARTED ---

    --- Startup times for process: Embedded ---

    times in msec
     clock   self+sourced   self:  sourced script
     clock   elapsed:              other lines

    000.006  000.006: --- NVIM STARTING ---
    000.409  000.403: event init
    000.557  000.148: early init
    000.633  000.077: locale set
    ...
    014.383  000.430: first screen update
    014.387  000.003: --- NVIM STARTED ---
2024-02-09 14:56:52 -08:00