Commit Graph

7518 Commits

Author SHA1 Message Date
Aaron
65a703e060
fix(lua): ignore stdout and stderr for xdg-open
Ref #19724
Fix #29932
2024-08-12 07:03:48 +00:00
Lewis Russell
9b5ab66678 test(lsp): refactor and tidy
- Merge all the top level 'LSP' describe blocks
- Refactor text edit tests
- Fix typing errors
- Add linebreaks between tests
2024-08-11 15:14:14 +01:00
Christian Clason
8df6736ca1 feat(term): enable reflow by default (#21124)
Problem: Contents of terminal buffer are not reflown when Nvim is
resized.

Solution: Enable reflow in libvterm by default. Now that libvterm is
vendored, also fix "TUI rapid resize" test failures there.

Note: Neovim's scrollback buffer does not support reflow (yet), so lines
vanishing into the buffer due to a too small window will be restored
without reflow.
2024-08-10 10:26:07 +02:00
Christian Clason
fa79a8ad6d build(deps): vendor libvterm at v0.3.3
Problem: Adding support for modern Nvim features (reflow, OSC 8, full
utf8/emoji support) requires coupling libvterm to Nvim internals
(e.g., utf8proc).

Solution: Vendor libvterm at v0.3.3.
2024-08-10 10:26:07 +02:00
zeertzjq
e01ccda1be vim-patch:0cc5dce: runtime(doc): clarify directory of Vim's executable vs CWD
According to :h win32-PATH, "the same directory as Vim" means the same
directory as the Vim executable, not Vim's current directory.  In patch
8.2.4860 these two concepts were mixed up.

closes: vim/vim#15451

0cc5dce578
2024-08-09 07:21:59 +08:00
Christian Clason
f35d5afbf1 vim-patch:39eff4c: runtime(proto): Add indent script for protobuf filetype
closes: vim/vim#15446

39eff4cdc0

Co-authored-by: David Pedersen <limero@me.com>
2024-08-08 00:17:11 +02:00
Grzegorz Rozdzialik
7031949be0
fix(lsp): avoid reusing diagnostics from different servers in actions (#30002)
Problem: When preparing the parameters for a code actions LSP request,
the code set `context.diagnostics` when processing the first LSP client,
and then reused those `context.diagnostics` for subsequent LSP clients.

This meant that the second and next LSP clients got diagnostics that
did not originate from them, and they did not get the diagnostics that
they sent.

Solution: Avoid setting `context.diagnostics` (which is referenced by
all clients). Instead, set `params.context.diagnostics` directly, which
is specific to a single client.

Fixes #30001
Caused by #29501
2024-08-07 17:28:01 +02:00
zeertzjq
450d49660f vim-patch:afea6b9: runtime(zip): use defer to restore old settings
Problem:  RestoreOpts() plugin called too often
Solution: use :defer to have the RestoreOpts() function
          called when the function returns automatically

afea6b9468

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
221c489edd vim-patch:8d52926: runtime(zip): add a generic Message function
Problem:  the zip plugin duplicates a lot of code for displaying
          warnings/errors
Solution: refactor common code into a generic Mess() function

8d52926857

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
025920b330 vim-patch:a336d8f: runtime(zip): increment base version of zip plugin
Problem:  the zip plugin version is still v33
Solution: increment the version to v34

a336d8f21e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:16:26 +08:00
zeertzjq
92981c8e0b vim-patch:19636be: runtime(zip): refactor save and restore of options
Problem:  zip plugin has no way to set/restore option values
Solution: Add the SetSaneOpts() and RestoreOpts() functions,
          so options that cause issues are set to sane values
          and restored back to their initial values later on.
          (this affects the 'shellslash' option on windows, which also
          changes how the shellescape() function works)

19636be55e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:07:34 +08:00
zeertzjq
11c57c25ef vim-patch:33836d3: runtime(zip): remove test for fnameescape
Problem:  zip plugin tests for fnameescape() function
Solution: Remove the check, fnameescape() has been available since
          7.1.299, it should nowadays always be available

33836d38b8

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:07:07 +08:00
zeertzjq
303b3e153d vim-patch:120c0dd: runtime(zip): use :echomsg instead of :echo
Problem:  zip plugin uses :echo which does not store messages
Solution: use :echomsg instead of :echo so that messages are stored in
          the message history

120c0dd815

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:06:35 +08:00
zeertzjq
0bf9a574b5 vim-patch:a63f66e: runtime(zip): clean up and remove comments
Problem:  zip plugin contains a lot of comments from the decho plugin
Solution: Clean up and remove un-used comments

a63f66e953

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-07 07:06:03 +08:00
Yi Ming
0a1212ef94 docs(treesitter): generate inline docs for Ranges
docs(treesitter): in-place parameter description

docs(treesitter): remove internal type names

docs(treesitter): add missing private annotation
2024-08-06 18:18:34 +02:00
zeertzjq
37952bf7b4
vim-patch:8.2.4838: checking for absolute path is not trivial (#29990)
Problem:    Checking for absolute path is not trivial.
Solution:   Add isabsolutepath(). (closes vim/vim#10303)

dca1d40cd0

vim-patch:8a3b805c6c9c

Co-authored-by: LemonBoy <thatlemon@gmail.com>
2024-08-06 21:19:12 +08:00
zeertzjq
28fbba2092
vim-patch:9.1.0465: missing filecopy() function (#29989)
Problem:  missing filecopy() function
Solution: implement filecopy() Vim script function
          (Shougo Matsushita)

closes: vim/vim#12346

60c8743ab6

Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
2024-08-06 12:49:59 +00:00
zeertzjq
6f5b904fb2 vim-patch:f0e9b72: runtime(zip): Fix for FreeBSD's unzip command
Problem:  Cannot browse zipfiles with the unzip program found
	  on FreeBSD.
Solution: Adjust command arguments.

Unzip found on FreeBSD complain about missing argument with the
zipinfo modifier '-Z -1'. Joining arguments seems to work
for both implementations.

Also change `:sil!` to `:sil` so that error messages are properly
reported (per review of Christian Brabandt).

related: vim/vim#15411

f0e9b72c8f

Co-authored-by: Damien <141588647+xrandomname@users.noreply.github.com>
2024-08-06 06:47:53 +08:00
zeertzjq
9a30abb292 vim-patch:217d3c1: runtime(doc): capitalize correctly
* do not capitalize after a double colon when introducing a list
* Capitalize a header line

closes: vim/vim#15433

217d3c17c6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-06 06:47:30 +08:00
Christian Clason
28e2e8aa04 vim-patch:c0f7505: runtime(lua): add/subtract a 'shiftwidth' after '('/')' in indentexpr
Problem:

- Current lua indentexpr does not indent for '(' ')'.
- Missing indent test for lua.

Solution:

- Match '(', ')' in `function GetLuaIndentIntern`.
- Add an indent test for lua.

closes: vim/vim#15364

c0f7505ede

Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
2024-08-04 19:00:10 +02:00
Christian Clason
be9eaac7e8 vim-patch:c5bdd66: runtime(zip): escape '[' on Unix as well
Problem:  After 6f1cbfc9ab fnameescape()
          is no longer called on the name of the file to be extracted.
          However, while spaces indeed don't need to be escaped, unzip
          treats '[' as a wildcard character, so it need to be escaped.
Solution: Escape '[' on both MS-Windows and Unix.

From the docs it seems '*' and '?' also need escaping, but they seem to
actually work without escaping.

fixes: neovim/neovim#29977
closes: vim/vim#15427

c5bdd66558

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-04 18:59:38 +02:00
zeertzjq
58406ab9f0
vim-patch:947f752: runtime(doc): fix typo in syntax.txt (#29974)
closes: vim/vim#15425

947f752a47

Co-authored-by: Jon Parise <jon@indelible.org>
2024-08-04 06:09:54 +08:00
Christian Clason
ac24b907f0 vim-patch:6228481: runtime(colors): update Todo highlight in habamax colorscheme
Magenta background Todo is too bright and might interfere with DiffText.
Make it less strong, without background, bold.

closes: vim/vim#15423

6228481b8e

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-03 15:22:11 +02:00
Christian Clason
3b58d93aae docs(filetype): consolidate comments in dev_vimpatch.txt 2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
37910f2703 docs(filetype): add note about prefering explicit lists over pattern 2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
95e0289cb2 refactor(filetype): use extension match instead of pattern if possible
Problem: some patterns are used as a replacement for several explicit
  extension matches (like '%.[Ss][Yy][Ss]$', '%.php%d$', etc.).
  They usually correspond to Vim's "ignore case" regexes (like
  '*.sys\c') and "convenience" patterns to not define many of them (like
  '*.php\d').
  As matching extension directly is faster and more explicit, it should
  be preferred.
Solution: move all such patterns to direct extension match.
2024-08-03 14:14:42 +02:00
Evgeni Chasnovski
66a74535d4 refactor(filetype): use file name match instead of pattern if possible
Problem: some patterns are used as a replacement for one-two explicit
  file matches (like '^[mM]akefile$'). As matching file name directly is
  faster and more explicit, it should be preferred.
Solution: move those patterns to direct file name match.
  NOTE: this is not strictly backwards compatible, because exact file
  name matching is done *before* pattern matching. If user has
  conflicting `vim.filetype.add()` call with high priority (like with
  `pattern='file$'` and `priority=100`), after this change it will be
  ignored (i.e. 'makefile' will match exactly).
  Judging by converted cases, it seems reasonable to prefer exact
  matches there.
2024-08-03 14:14:42 +02:00
Jaehwang Jung
eb629cce91
fix(lsp): redundant spaces in lsp log (#29970) 2024-08-03 11:14:34 +02:00
Mathias Fußenegger
6072153796
feat(lsp): announce codeLens resolveSupport (#29956)
The codelens implementation can resolve command via `codeLens/resolve`.

The spec added client capabilities for that:

https://github.com/microsoft/language-server-protocol/pull/1979
2024-08-03 11:14:12 +02:00
Christian Clason
e7f8349a2e vim-patch:9.1.0655: filetype: goaccess config file not recognized
Problem:  filetype: goaccess config file not recognized
Solution: detect 'goaccess.conf' as goaccess filetype, also
          include a basic syntax and ftplugin (Adam Monsen)

Add syntax highlighting for GoAccess configuration file.

GoAccess is a real-time web log analyzer and interactive viewer that
runs in a terminal in *nix systems or through your browser.

GoAccess home page: https://goaccess.io

closes: vim/vim#15414

0aa65b48fb

Co-authored-by: Adam Monsen <haircut@gmail.com>
2024-08-03 00:16:22 +02:00
Christian Clason
a90b1b7c6f vim-patch:c527d90: runtime(netrw): honor g:netrw_alt{o,v} for :{S,H,V}explore
Make `:Sexplore` / `:Hexplore` / `:Vexplore` commands honor the user
`&split{right,below}` settings (or netrw-specific `g:netrw_alt{o,v}`)
instead of hardcoding a split direction. Similarly, update banged
variants of the two latter commands to follow the inverted preference.

closes: vim/vim#15417

c527d90fae

Co-authored-by: Ivan Shapovalov <intelfx@intelfx.name>
2024-08-03 00:16:09 +02:00
zeertzjq
99bb0a10d3 refactor(eval): treat v:lua call as simple function 2024-08-02 12:56:57 +08:00
zeertzjq
582bf4f1e1 vim-patch:9.0.0634: evaluating "expr" options has more overhead than needed
Problem:    Evaluating "expr" options has more overhead than needed.
Solution:   Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
            "expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
            'formatexpr', 'indentexpr' and 'charconvert'.

a4e0b9785e

vim-patch:9.0.0635: build error and compiler warnings

Problem:    Build error and compiler warnings.
Solution:   Add missing change.  Add type casts.

3292a22940

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 11:56:51 +08:00
zeertzjq
f7fde0173a vim-patch:9.0.0632: calling a function from an "expr" option has overhead
Problem:    Calling a function from an "expr" option has too much overhead.
Solution:   Add call_simple_func() and use it for 'foldexpr'

87b4e5c5db

Cherry-pick a call_func() change from patch 8.2.1343.
Add expr-option-function docs to options.txt.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 11:56:51 +08:00
zeertzjq
48e4589ead
vim-patch:8.2.4416: Vim9: using a script-local function requires using "s:" (#29950)
Problem:    Vim9: using a script-local function requires using "s:" when
            setting 'completefunc'.
Solution:   Do not require "s:" in Vim9 script. (closes vim/vim#9796)

1fca5f3e86

vim-patch:8.2.4417: using NULL pointer

Problem:    Using NULL pointer.
Solution:   Set offset after checking for NULL pointer.

e89bfd212b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-02 02:58:10 +00:00
Mathias Fußenegger
720b309c78
fix(lsp): don't send foreign diagnostics to servers in buf.code_action (#29501)
`buf.code_action` always included diagnostics on a given line from all
clients. Servers should only receive diagnostics they published, and in
the exact same format they sent it.

Should fix https://github.com/neovim/neovim/issues/29500
2024-08-01 16:01:15 +02:00
Manuel
32e128f209
fix(watch): exclude .git when using inotifywait (#29914)
inotifywait man page specifies:
The file must be specified with a relative or absolute path according to whether a relative or absolute path is given for watched directories.

So it would only work this way in case the path is relative (which at least for gopls it is not)
2024-08-01 16:00:48 +02:00
Christian Clason
d3019419e7 vim-patch:30a8ad6: runtime(java): Document "g:java_space_errors" and "g:java_comment_strings"
closes: vim/vim#15399

30a8ad675d

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
2339bd894b vim-patch:77b87c3: runtime(java): Cluster optional group definitions and their group links
And keep non-optional group links at the end of the file.

related: vim/vim#15399

77b87c30d9

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
13a4e61231 vim-patch:9aabcef: runtime(java): Tidy up the syntax file
- Prefix all global variables with "g:".
- Add spaces around each variable assignment operator.
- Remove extraneous whitespace characters.
- Remove a spurious _serializable_ Java keyword (since v1.1,
  java.io.Serializable and java.io.Externalizable interfaces
  provide an API for object serialization; see vim-6-0j).
- Normalise the syntax definition argument order by making
  _contained_ the first argument of each such definition.
- Normalise the argument tabulation for highlighting group
  definitions.

Reference:
https://web.archive.org/web/20010821025330/java.sun.com/docs/books/jls/first_edition/html/1.1Update.html

related: vim/vim#15399

9aabcef1c8

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
Christian Clason
a70371ff00 vim-patch:3749dff: runtime(java): Tidy up the documentation for "ft-java-syntax"
- Reword a few sentences and reformat a few paragraphs.
- Supply absent capitalisation and punctuation.
- Make listed highlighting groups and code stand out.
- Prefix all Java-related global variables with "g:".
- Add spaces around each variable assignment operator.
- Acknowledge that some Javadoc variables are maintained in
  the HTML syntax file.

Also, move the overridable _default_ HTML group links before
the HTML syntax file inclusion in order to implement the
documented diverged settings.

related: vim/vim#15399

3749dff093

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-08-01 10:14:10 +02:00
zeertzjq
b7dec93e68
vim-patch:5b07213: runtime(doc): re-format tag example lines, mention ctags --list-kinds (#29938)
5b07213c0b

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-08-01 08:00:41 +00:00
zeertzjq
2b4049719a
vim-patch:partial:f10911e: Update runtime files (#29936)
f10911e5db

Also cherry-pick E1142 and E1156 tags from Vim.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2024-08-01 03:50:38 +00:00
Christian Clason
e820474cde vim-patch:d88ebcb: runtime(colors): update habamax scheme - tweak diff/search/todo colors
- Make diff colors more accessible, Green for added, Red for deleted, Blue for Changed
- Change Search to blue to be visible with Diff colors
- Change Todo to bright magenta

closes: vim/vim#15400

d88ebcbd9f

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-01 00:07:31 +02:00
Christian Clason
9e5381d1ad vim-patch:fcc5346: runtime(colors): update included colorschemes
- Add PmenuMatch and PmenuMatchSel to all colorschemes
- Add contrast to habamax Type, String, Constant and PreProc
- Change habamax PmenuSel to neutral gray to make PmenuMatchSel more visible
- Change habamax Tabline and VertSplit
- Make Conceal less visible for zellner, torte, shine, ron, peachpuff,
  pablo, morning, koehler, evening, delek, blue, darkblue, lunaperche,
  retrobox
- Add Added/Changed/Removed highlights
- Fix retrobox Terminal background
- Other minor fixes and improvements

closes: vim/vim#15267

fcc53461d4

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-08-01 00:07:31 +02:00
Christian Clason
e1d48d5cf2 vim-patch:5753d99: runtime(nohlsearch): add missing loaded_hlsearch guard
related: vim/vim#15039
closes: vim/vim#15402

5753d99ff6

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-07-31 23:06:28 +02:00
Christian Clason
479af3b006 vim-patch:56e8ed6: runtime(kivy): Updated maintainer info for syntax script
closes: vim/vim#15405

56e8ed6162

Co-authored-by: Corey Prophitt <git@prophitt.me>
2024-07-31 23:06:28 +02:00
Jaehwang Jung
6bb40f3dbf
fix(lsp): prevent desync due to empty buffer (#29904)
Problem:
Some language servers (e.g., rust-analyzer, texlab) are desynced when
the user deletes the entire contents of the buffer. This is due to the
discrepancy between how nvim computes diff and how nvim treats empty
buffer.
* diff: If the buffer became empty, then the diff includes the last
  line's eol.
* empty buffer: Even if the buffer is empty, nvim regards it as having
  a single empty line with eol.

Solution:
Add special case for diff computation when the buffer becomes empty so
that it does not include the eol of the last line.
2024-07-31 16:18:24 +02:00
glepnir
4e90bc3023
feat(lsp): lsp.completion support set deprecated (#29882)
Problem: CompletionItem in lsp spec mentioned the deprecated attribute

Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated
          in complete function
2024-07-31 16:15:34 +02:00
Lewis Russell
573a71469d fix(scrollbind): properly take filler/virtual lines into account
Problem:

`'scrollbind'` does not work properly if the window being scrolled
automatically contains any filler/virtual lines (except for diff filler
lines).

This is because when the scrollbind check is done, the logic only
considers changes to topline which are represented as line numbers.

Solution:

Write the logic for determine the scroll amount to take into account
filler/virtual lines.

Fixes #29751
2024-07-31 11:33:32 +01:00