Commit Graph

7135 Commits

Author SHA1 Message Date
7e194f0d0c NVIM 0.10.1
This is a maintenance release.

FEATURES
--------------------------------------------------------------------------------
- ebc6c38cde lsp: update LSP healthcheck format (#28988)

BUILD
--------------------------------------------------------------------------------
- ba90b54301 deps: drop unused bundled bash, python parsers and queries
- 803cc08c17 deps: bump tree-sitter-c to v0.21.3
- 91e337a477 deps: bump tree-sitter-query to v0.4.0
- 978b63a9f1 deps: bump tree-sitter-vimdoc to v3.0.0
- b322c3560b "popcount" name conflict on NetBSD #28983
- b397b5672c remove -O2 from gen_cflags
- f77db12995 reuse code for deps.txt for both deps and main build
- 46d2906332 macos: disable deduplication in link step

FIXES
--------------------------------------------------------------------------------
- 70f7708cdf assert failure in VimL expression parser
- 28f03205be show swapfile warning as a warning (#28972)
- 0d293e4315 api: alloc and draw cursor window in nvim__redraw
- e1b6187801 colorscheme: underline StatusLineNC with 'notermguicolors' #28810
- aa1321801d column: clamp line number for legacy signs
- df6ce8377f column: crash with 'signcolumn' set to "number" (#29003)
- 97be9d8563 column: modifying a sign should update placed signs (#29750)
- 21b21b94e6 comment: fall back to using trimmed comment markers (#28950)
- 0827279ff5 defaults: default @/Q broken when 'ignorecase' is set (#29343)
- 5d9f2d7ecc drawline: don't draw beyond end of window (#29035)
- eadc4e03a2 drawline: don't draw beyond end of window with 'rnu' (#29406)
- bec397edda extmarks: issues with revalidating marks #28961
- 1fe1f8556e filetype: fix typos in filetype detection
- ad55ec350c float: handle error in win_float_create() (#29742)
- bf16fe3f01 fs: make vim.fs.root work for relative paths and unnamed buffers (#28973)
- 5eaae797af health: broken ruby detect #28804
- 24ee2e7c74 health: fix fetching url with python in provider health (#29594)
- 7582d4a7b5 input: handle vim.on_key() properly with ALT and K_SPECIAL (#29677)
- 4f0c4c3921 lsp: add textDocument/documentLink to capability map (#28838)
- 2d7aab623e lsp: avoid vim.keymap.del error when stopping a client (#29478)
- bdd5871dc5 lsp: check if buffer was detached in on_init callback (#28942)
- d8ff216040 lsp: clear lsp client diagnostics (#29091)
- 3a727beafd lsp: detach all clients on_reload to force buf_state reload (#28898)
- e98637e8c0 lsp: do not detach from buffer if there are uninitialized clients (#29043)
- 0ee3147bc7 lsp: do not reset buf version when detaching client (#29273)
- 24fa65a500 lsp: don't show codelens for buffers that don't support it (#29690)
- 4efca7cda5 lsp: handle nil root_dir in health check (#29010)
- efe8a0a520 lsp: hide layout in codelenses in virtual text (#28794) (#28895)
- 2fb69ccaf7 lsp: inlay hints are rendered in the correct order (#29707)
- dfff482efe lsp: remove superfluous on_detach callback from semantic tokens module (#29188)
- 10a16c1311 lsp: trigger LspDetach on buffer delete
- 33121f1eae lua: change some vim.fn.expand() to vim.fs.normalize() (#29583)
- ffc457a1dc marks: revalidate marks whose position did not change
- f82d7b8200 mouse: early return when clicking in padded 'statuscolumn' (#29394)
- d6756fc0a5 move: half-page scrolling with resized grid at eob (#28821)
- 0cf7e2570c path: avoid chdir() when resolving path (#28799)
- 63ff7338ea quickfix: make shortmess+=O work with cmdheight=0 (#29609)
- 46c2962b3a runtime: add commentstring for glsl ftplugin
- b98aa783f3 runtime: source c ftplugin properly for cpp on Windows (#29053)
- 039121f5a3 snippet: cancel snippet session when leaving the buffer (#29044)
- 84d7bfcf16 snippet: don't override unnamed register on tabstop select (#29008)
- e13f03af85 snippet: modify base indentation when there's actually whitespace (#29670)
- 9fd6664ba7 tohtml: extmark text may be out of bounds
- 8c88f402e1 tohtml: ignore lsp inlay hints
- 5cdf0c22bd tohtml: properly handle multiple hl groups #29012
- 3d319092d5 tohtml: replace ipairs with pairs
- 4150e5e6fd tohtml: show how many warnings are hidden
- 0389472961 tohtml: support ranges again
- ab2d243fd0 treesitter: display fields for anonymous nodes in :InspectTree
- 35f6425207 treesitter: do not modify highlight state for _on_spell_nav
- 356ddb1305 treesitter: ensure syntaxset augroup exists (#29542)
- eb53aba5af treesitter: recognize aliased parsers in omnifunc, query linter
- b6b2272573 tui: move $COLORTERM check to _defaults.lua (#29206)
- 89f29fcc92 tui: remove duplicate disabling of synchronized output (#28884)
- a784b901be tui: skip TUI in ui_rgb_attached (#29096)
- 19787d6057 ui: avoid ambiguity about last chunk when flushing halfway (#29718)
- 89fa1ee822 ui: flush ext_cmdline events before doing cmdpreview (#29062)
- 7055cd1238 ui: superfluous showmode / excessive grid_cursor_goto #29089
- 6802db7aa1 version: fix vim.version().prerelease
- 728f6c7c83 vim.text: remove assert from vim.text.hexdecode
- c3aef56199 win-msi: add bin to PATH per-machine after installation (#29099)

VIM PATCHES
--------------------------------------------------------------------------------
- fdf769fa86 0b74eec: runtime(stylus): remove remaining css code (vim/vim#14866)
- 29fd7432fd 74703f1: runtime(doc): remove obsolete Ex insert behavior (#29702)
- 891cc78179 7a85e34: runtime(doc): fix inconsistencies in :h file-searching (#29652)
- 704d33634e 8.2.0083: text properties wrong when tabs and spaces are exchanged
- 571e54e12c 8.2.0109: corrupted text properties when expanding spaces
- 7c055bd74b 8.2.3388: fnamemodify('path/..', ':p') differs from using 'path/../' (#29667)
- 9c91233a38 9.1.0414: Unable to leave long line with 'smoothscroll' and 'scrolloff'
- 34cc49bd72 9.1.0498: getcmdcompltype() interferes with cmdline completion (#29397)
- 259a620eb8 9.1.0512: Mode message for spell completion doesn't match allowed keys (#29437)
- f89d4ee6ce 9.1.0526: Unwanted cursor movement with pagescroll at start of buffer (#29569)
- 4ce293c2c3 9.1.0565: Stop directory doesn't work properly in 'tags'
- c467bfeb93 9.1.0566: Stop dir in findfile() doesn't work properly w/o trailing slash
- 576363a0fb 9.1.0567: Cannot use relative paths as findfile() stop directories
- ceb82a9396 9.1.0569: fnamemodify() treats ".." and "../" differently (#29673)
- 07de890de6 9.1.0580: :lmap mapping for keypad key not applied when typed in Select mode (#29693)
- b01202df15 9.1.0594: Unnecessary redraw when setting 'winfixbuf' (#29775)
- 804a94d300 9.1.0601: Wrong cursor position with 'breakindent' when wide char doesn't fit (#29793)
- a03cc83bfb df62c62: runtime(doc): grammar fixes in options.txt (#29729)
- fde5718e62 partial:9.0.0323: using common name in tests leads to flaky tests

REDACTOR
--------------------------------------------------------------------------------
- c35e040b7e replace deprecated vim.loop with vim.uv
- 3a354bfcaa lsp: reuse buf_detach_client logic in on_detach (#28939) (#29024)
- dffadc392e path.c: add nonnull attributes (#28829)
- db65017e60 tests: more global highlight definitions
- 3725db69ef tests: use more global highlight definitions

CI
--------------------------------------------------------------------------------
- 7400f9dfe5 adjust workflows to enable required checks
- 575136c178 always add `target:release` label when backporting
- 410f43c0ae bump backport action to version 3
- 9a2760a01f change label `backport` to `target:release`
- b94b341ef2 run workflows on release branches
- 0e81c62405 skip lintcommit workflow on release branches

TESTING
--------------------------------------------------------------------------------
- f03348472d add a test for #29119
- 18a36d3d9f do not set termguicolors in test runner
- 68513c2a89 fix reporting "no flush received" too early (#29735)
- 981548b7f7 remove checks for failed tests on Windows
- 65776124b1 starting and stopping treesitter highlight (#29546)

DOCUMENTATION
--------------------------------------------------------------------------------
- 891b235df0 document 'list' behavior when 'listchars' excludes "tab" (#29360)
- 8c00651131 fix more treesitter parsing errors
- 777e15fa61 update LSP quickstart (#28989)
- 6136326d63 lpeg: merge upstream changes
- f7d8650616 lsp: format the handwritten part #29295
2024-07-24 09:20:05 +02:00
0389472961 fix(tohtml): support ranges again 2024-07-18 09:44:52 +02:00
9fd6664ba7 fix(tohtml): extmark text may be out of bounds 2024-07-18 09:44:52 +02:00
5cdf0c22bd fix(tohtml): properly handle multiple hl groups #29012
Problem: :TOhtml doesn't properly handle virtual text when it has
multiple highlight groups. It also improperly calculates position offset
for multi-byte virt_text characters.

Solution: Apply the `vim.api.nvim_strwidth` broadly to properly
calculate character offset, and handle the cases where the `hl` argument
can be a table of multiple hl groups.
2024-07-18 09:44:52 +02:00
4150e5e6fd fix(tohtml): show how many warnings are hidden 2024-07-18 09:44:52 +02:00
8c88f402e1 fix(tohtml): ignore lsp inlay hints 2024-07-18 09:44:52 +02:00
3d319092d5 fix(tohtml): replace ipairs with pairs 2024-07-18 09:44:52 +02:00
2fb69ccaf7 fix(lsp): inlay hints are rendered in the correct order (#29707)
Problem:
When there are multiple inlay hints present at the same position, they
should be rendered in the order they are received in the response from
LSP as per the LSP spec. Currently, this is not respected.

Solution:
Gather all hints for a given position, and then set it in a single
extmark call instead of multiple set_extmark calls. This leads to fewer
extmark calls and correct inlay hints being rendered.
2024-07-17 17:56:04 +02:00
eb53aba5af fix(treesitter): recognize aliased parsers in omnifunc, query linter
**Problem:** A query file for something like `html_tags` will not be
given html node completion

**Solution:** Check for parser aliases before offering completions

Co-authored-by: Lewis Russell <me@lewisr.dev>
(cherry picked from commit 05dcda8f9b)
2024-07-17 12:37:42 +02:00
e13f03af85 fix(snippet): modify base indentation when there's actually whitespace (#29670)
(cherry picked from commit 5fe4ce6678)
2024-07-17 11:42:03 +02:00
24fa65a500 fix(lsp): don't show codelens for buffers that don't support it (#29690)
(cherry picked from commit 1f2f460b4a)
2024-07-17 11:41:53 +02:00
a03cc83bfb vim-patch:df62c62: runtime(doc): grammar fixes in options.txt (#29729)
closes: vim/vim#15265

df62c62177

Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
(cherry picked from commit c2b51e6c41)
2024-07-15 22:32:55 +00:00
6136326d63 docs(lpeg): merge upstream changes
(cherry picked from commit 8703e7bd12)
2024-07-15 22:16:53 +00:00
f654a30093 docs: misc (#29714)
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
2024-07-15 07:09:47 +08:00
29fd7432fd vim-patch:74703f1: runtime(doc): remove obsolete Ex insert behavior (#29702)
related: vim/vim#15120
closes: vim/vim#15228

74703f1086

Nvim only supports Vim Ex mode, so this is long obsolete in Nvim.

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2024-07-14 15:08:13 +08:00
891cc78179 vim-patch:7a85e34: runtime(doc): fix inconsistencies in :h file-searching (#29652)
closes: vim/vim#15201

7a85e343d2
(cherry picked from commit 15f6cf0c8f)
2024-07-14 06:46:36 +00:00
8c00651131 docs: fix more treesitter parsing errors 2024-07-09 16:13:26 +02:00
ba90b54301 build(deps): drop unused bundled bash, python parsers and queries
Problem: Neovim bundles treesitter parsers for bash and python but does
not use them by default. This dilutes the messaging about the bundled
parsers being required for functionality or reasonable out-of-the-box
experience. It also increases the risk of query incompatibilities for no
gain.

Solution: Stop bundling bash and python parser and queries.
(cherry picked from commit 51d85f7ea5)
2024-07-09 16:13:26 +02:00
978b63a9f1 build(deps): bump tree-sitter-vimdoc to v3.0.0 2024-07-09 13:49:12 +02:00
33121f1eae fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583)
Unlike vim.fn.expand(), vim.fs.normalize() doesn't expand wildcards.
2024-07-09 19:27:10 +08:00
24ee2e7c74 fix(health): fix fetching url with python in provider health (#29594) 2024-07-09 19:25:27 +08:00
c35e040b7e refactor: replace deprecated vim.loop with vim.uv
(cherry picked from commit 1a2e6ebc59)
2024-07-07 08:41:56 +00:00
ab2d243fd0 fix(treesitter): display fields for anonymous nodes in :InspectTree
(cherry picked from commit 9217e0d671)
2024-07-05 10:15:14 +02:00
2d7aab623e fix(lsp): avoid vim.keymap.del error when stopping a client (#29478)
(cherry picked from commit fc9b70826e)
2024-07-03 20:59:14 +00:00
356ddb1305 fix(treesitter): ensure syntaxset augroup exists (#29542)
Problem:
Error when calling vim.treesitter.start() and vim.treesitter.stop() in
init.lua.

Solution:
Ensure syntaxset augroup exists after loading synload.vim.

(cherry picked from commit d413038b4f)
2024-07-02 23:40:57 +00:00
91e337a477 build(deps): bump tree-sitter-query to v0.4.0
(cherry picked from commit 61b3a26e5b)
2024-06-25 10:04:44 +02:00
35f6425207 fix(treesitter): do not modify highlight state for _on_spell_nav
Problem:  Treesitter highlighter clears the already populated highlight
          state when performing spell checking while drawing a
          smoothscrolled topline.
Solution: Save and restore the highlight state in the highlighter's
          _on_spell_nav callback.
(cherry picked from commit da4e8dc5b0)
2024-06-24 11:40:30 +00:00
f7d8650616 docs(lsp): format the handwritten part #29295
(cherry picked from commit 7ce261c064)
2024-06-17 23:06:15 +00:00
891b235df0 docs: document 'list' behavior when 'listchars' excludes "tab" (#29360)
(cherry picked from commit 7e65f3757b)
2024-06-15 22:11:15 +00:00
0827279ff5 fix(defaults): default @/Q broken when 'ignorecase' is set (#29343)
Problem:
When 'ignorecase' is set, the default keymap Q and Q would exit visual
mode.

This issue was raised in #28287 and a fix was applied in #28289.

However, `==` operator is subject to user `ignorecase` setting.

Solution:
Switching to `==#` operator would guarantee case sensitive comparison
between visual mode and linewise visual mode.

Co-authored-by: Kuanju Chen <kuanju.chen@mksinst.com>
(cherry picked from commit 61aabe0730)
2024-06-15 02:21:35 +00:00
643d6af451 docs: misc (#29229)
Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
Co-authored-by: Jose Pedro Oliveira <jose.p.oliveira.oss@gmail.com>
Co-authored-by: Maria José Solano <majosolano99@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
(cherry picked from commit 6e28589e00)
2024-06-14 23:06:11 +00:00
728f6c7c83 fix(vim.text): remove assert from vim.text.hexdecode
Instead, return nil plus an error message if the input is invalid.

(cherry picked from commit 4cff418564)
2024-06-13 01:09:49 +00:00
0ee3147bc7 fix(lsp): do not reset buf version when detaching client (#29273)
(cherry picked from commit 37bf4c572a)

Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
2024-06-10 22:22:26 +02:00
46c2962b3a fix(runtime): add commentstring for glsl ftplugin
(cherry picked from commit b6c1ce8a95)
2024-06-09 14:56:21 +02:00
b6b2272573 fix(tui): move $COLORTERM check to _defaults.lua (#29206)
fix(tui): move $COLORTERM check to _defaults.lua (#29197)

We currently check $COLORTERM in the TUI process to determine if the
terminal supports 24 bit color (truecolor). If $COLORTERM is "truecolor"
or "24bit" then we automatically assume that the terminal supports
truecolor, but if $COLORTERM is set to any other value we still query
the terminal.

The `rgb` flag of the UI struct is a boolean which only indicates
whether the UI supports truecolor, but does not have a 3rd state that we
can use to represent "we don't know if the UI supports truecolor". We
currently use `rgb=false` to represent this "we don't know" state, and
we use XTGETTCAP and DECRQSS queries to determine at runtime if the
terminal supports truecolor. However, if $COLORTERM is set to a value
besides "truecolor" or "24bit" (e.g. "256" or "16) that is a clear
indication that the terminal _does not_ support truecolor, so it is
incorrect to treat `rgb=false` as "we don't know" in that case.

Instead, in the TUI process we only check for the terminfo capabilities.
This must be done in the TUI process because we do not have access to
this information in the core Neovim process when `_defaults.lua` runs.
If the TUI cannot determine truecolor support from terminfo alone, we
set `rgb=false` to indicate "we don't know if the terminal supports
truecolor yet, keep checking". When we get to `_defaults.lua`, we can
then check $COLORTERM and only query the terminal if it is unset.

This means that users can explicitly opt out of truecolor determination
by setting `COLORTERM=256` (or similar) in their environment.

(cherry picked from commit d7651b27d5)

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2024-06-05 08:52:48 -05:00
dfff482efe fix(lsp): remove superfluous on_detach callback from semantic tokens module (#29188)
LspDetach is now triggered by the main on_detach callback that is added
when an LSP client is attached to a buffer. The semantic_tokens module
already includes a LspDetach handler that does the right thing. When the
LspDetach trigger was added to the main LSP on_detach, it created a race
condition in semantic tokens when a buffer was deleted that would
trigger both its own on_detach and the LspDetach handlers. If the former
came last, an error was thrown trying to delete a non-existent augroup
(destroy() was being called twice).

(cherry picked from commit 43581011e4)

Co-authored-by: jdrouhard <john@drouhard.dev>
2024-06-04 19:00:51 +02:00
1fe1f8556e fix(filetype): fix typos in filetype detection
(cherry picked from commit aa9f21ee95)
2024-06-04 09:26:54 +00:00
d8ff216040 fix(lsp): clear lsp client diagnostics (#29091)
Problem: When an lsp client is stopped, the client will
only clear the diagnostics for the attached buffers but
not the unattached buffers.
Solution: Reset the diagnostics for the whole namespace rather than
for only the attached buffers.

(cherry picked from commit 025c874415)

Co-authored-by: crwebb85 <51029315+crwebb85@users.noreply.github.com>
2024-05-30 09:23:04 +02:00
fdf769fa86 vim-patch:0b74eec: runtime(stylus): remove remaining css code (vim/vim#14866)
This seems to be a forgotten fixup in 2d919d2744 (r141568461)

0b74eeceb8
(cherry picked from commit 4e2c8dc374)
2024-05-28 07:00:03 +00:00
b98aa783f3 fix(runtime): source c ftplugin properly for cpp on Windows (#29053)
On Windows, '{' is currently not treated as a wildcard char, so another
wildcard char is needed for the pattern to be treated as a wildcard.

It may be worth trying to make '{' always a wildcard char in the future,
but that'll be a bit harder as it'll be necessary to make sure '{' is
escaped at various places.

(cherry picked from commit 7b16c1fa84)
2024-05-27 22:39:22 +00:00
039121f5a3 fix(snippet): cancel snippet session when leaving the buffer (#29044)
(cherry picked from commit 608543f8a9)

Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2024-05-27 17:56:05 +02:00
e98637e8c0 fix(lsp): do not detach from buffer if there are uninitialized clients (#29043)
Problem: if on_lines is called before the LSP is initialized, the buffer
is detached.
Solution: check for uninitialized clients before detaching.

(cherry picked from commit 292365fa1b)

Co-authored-by: Ilia Choly <ilia.choly@gmail.com>
2024-05-27 17:26:42 +02:00
3a354bfcaa refactor(lsp): reuse buf_detach_client logic in on_detach (#28939) (#29024)
(cherry picked from commit 2908f71dc9)
2024-05-26 20:47:59 +02:00
4efca7cda5 fix(lsp): handle nil root_dir in health check (#29010)
fix(lsp): handle nil root_dir in health check (#29007)

The root directory could show up as something like:

    Root directory: ~/path/to/cwd/v:null

Despite being `nil`

(cherry picked from commit f03b1622ad)

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2024-05-25 17:30:27 -05:00
84d7bfcf16 fix(snippet): don't override unnamed register on tabstop select (#29008)
(cherry picked from commit 7994fdba6a)

Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
2024-05-25 22:05:23 +02:00
777e15fa61 docs: update LSP quickstart (#28989)
docs: update LSP quickstart (#28954)

The LSP quickstart can act as our true "entrypoint" for answering the
question "How do I use LSP in Neovim?" As such, it can be a little more
beginniner-friendly than other sections of our help docs by including
explanatory comments and a more fleshed out example (including a
`FileType` autocommand).

This also includes some other minor wording updates and points users
toward `:checkhealth lsp`.

(cherry picked from commit 28c04948a1)

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2024-05-24 18:47:36 -05:00
ebc6c38cde feat(lsp): update LSP healthcheck format (#28988)
feat(lsp): update LSP healthcheck format (#28980)

This is mostly an aesthetic change, although there are a few new pieces
of information included. Originally I wanted to investigate including
server capabilities in the healthcheck, but until we have the ability to
fold/unfold text in health checks that would be too much information.

(cherry picked from commit 5d26934c7c)

Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
2024-05-24 18:47:13 -05:00
bf16fe3f01 fix(fs): make vim.fs.root work for relative paths and unnamed buffers (#28973)
If a buffer does not have a backing file then fall back to the current
working directory.

(cherry picked from commit 206f8f24a2)
2024-05-24 10:57:21 -05:00
28f03205be fix: show swapfile warning as a warning (#28972)
The new default SwapExists autocommand displays warning text (W325) but
does not use the WarningMsg highlight group as other warnings do. Use
the WARN log level when displaying this warning.

(cherry picked from commit e71713ba2b)
2024-05-24 10:48:07 -05:00
21b21b94e6 fix(comment): fall back to using trimmed comment markers (#28950)
fix(comment): fall back to using trimmed comment markers (#28938)

Problem: Currently comment detection, addition, and removal are done
  by matching 'commentstring' exactly. This has the downside when users
  want to add comment markers with space (like with `-- %s`
  commentstring) but also be able to uncomment lines that do not contain
  space (like `--aaa`).

Solution: Use the following approach:
  - Line is commented if it matches 'commentstring' with trimmed parts.
  - Adding comment is 100% relying on 'commentstring' parts (as is now).
  - Removing comment is first trying exact 'commentstring' parts with
    fallback on trying its trimmed parts.
(cherry picked from commit 0a2218f965)

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2024-05-23 16:02:13 -05:00