Commit Graph

31679 Commits

Author SHA1 Message Date
Christian Clason
e3e1c1e765 vim-patch:509a8d5: runtime(just): fix typo in syntax file
closes: vim/vim#16515

509a8d58f9

Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-25 16:35:16 +01:00
zeertzjq
d4a65dad23
vim-patch:9.1.1052: tests: off-by-one error in CheckCWD in test_debugger.vim (#32202)
Problem:  tests: off-by-one error in CheckCWD in test_debugger.vim
Solution: Fix off-by-one in CheckCWD leading to local tests failure
          (Yee Cheng Chin)

Vim's test_debugger's Test_debug_backtrace_level test will fail if you
happen to run it in a Vim repository with full path of directory being
exactly 29 characters (e.g. `/Users/bob/developing/src/vim`). The test
does term dump comparison and the printout will overflow if the CWD is
too long. It does have a function to skip to test if it detects that but
it's off by one leading to this one situation where it will fail.

The reason why the logic didn't account for this is that Vim's message
printing will overflow the text if it prints a message at exactly the
width of the terminal. This could be considered a bug / quirk but that
will be another issue.

closes: vim/vim#16517

3acfbb4b54

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-01-25 23:03:43 +08:00
zeertzjq
fb1740521a
Merge pull request #32204 from zeertzjq/vim-9.1.1049
vim-patch:9.1.{1049,1053}: 'completeopt' "nosort"
2025-01-25 22:57:59 +08:00
zeertzjq
689c23b2ac vim-patch:9.1.1053: "nosort" enables fuzzy filtering even if "fuzzy" isn't in 'completeopt'
Problem:  "nosort" enables fuzzy filtering even if "fuzzy" isn't in
          'completeopt' (after v9.1.1049)
Solution: Only enable fuzzy filtering when "fuzzy" is in 'completeopt'.
          (zeertzjq)

closes: vim/vim#16510

d65aa1bbdb
2025-01-25 22:39:40 +08:00
zeertzjq
63aa167f94 vim-patch:9.1.1049: insert-completed items are always sorted
Problem:  insert-completed items are always sorted, although the LSP
          spec[1] standard defines sortText in the returned
          completionitem list. This means that the server has sorted the
          results. When fuzzy is enabled, this will break the server's
          sorting results.
Solution: disable sorting of candidates when "nosort" is set in
          'completeopt'

[1]
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem

closes: vim/vim#16501

f400a0cc41

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-25 22:39:37 +08:00
phanium
851137f679
fix(log): log unset $TMPDIR at "debug" level #32137 2025-01-24 20:05:47 -08:00
georgev93
931ee5591f
feat(extmarks): virtual text can be right-aligned, truncated #31921
Problem: Right aligned virtual text can cover up buffer text if virtual
text is too long

Solution: An additional option for `virt_text_pos` called
`eol_right_align` has been added to truncate virtual text if it would
have otherwise covered up buffer text. This ensures the virtual text
extends no further left than EOL.
2025-01-24 19:57:45 -08:00
Luuk van Baal
c6d2cbf8f5 fix(lua): pop retval for fast context LuaRef
Problem:  nlua_call_ref_ctx() does not pop the return value in fast
          context that did not error.
Solution: Fall through to end; calling nlua_call_pop_retval().
2025-01-24 11:57:51 +01:00
Luuk van Baal
d98827b634 fix(messages): avoid empty msg_showmode with 'noshowmode' 2025-01-24 11:39:39 +01:00
Christian Clason
0fd4ef5da7 ci(tests): remove build-types jobs
Problem: Some CI jobs are redundant: `RelWithDebInfo` is already tested
on Linux-Arm64; `MinSizeRel` and Ninja Multi Config are not sufficiently
relevant in practice to spend CI cycles on.

Solution: Remove `build-types` job.
2025-01-24 10:34:18 +01:00
Christian Clason
3702bcb139 ci(tests): add arm64 runner
Problem: Linux `aarch64`/`arm64` builds are not tested.

Solution: Add `ubuntu-arm` runners to test matrix (using
`RelWithDebInfo` build).
2025-01-24 10:34:18 +01:00
zeertzjq
2470db02c5
vim-patch:partial:9.1.1050: too many strlen() calls in os_unix.c (#32188)
Problem:  too many strlen() calls in os_unix.c
Solution: refactor os_unix.c and remove calls to strlen()
          (John Marriott)

closes: vim/vim#16496

efc41a5958

Omit os_expand_wildcards() change: Nvim's code is more complicated and
harder to refactor.

Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-01-24 00:52:55 +00:00
luukvbaal
8bc28978b6
fix(column): apply custom highlight to last 'statuscolumn' segment (#32182) 2025-01-24 07:42:24 +08:00
Luuk van Baal
2cd72258f6 fix(mouse): 'statuscolumn' fold and popopmenu handling
Problem:  A right-click on the 'statuscolumn' does not open the
          popupmenu, even if a cell without a clickdef is clicked.
          Clicking the %C fold item does not open/close the fold.
Solution: Open the popupmenu when there is no clickdef like right-clicking
          the sign/numbercolumn does. Fill "linebuf_vcol" when drawing the
          'statuscolumn' to handle foldcolumn item clicks.
2025-01-23 17:26:10 +01:00
Evgeni Chasnovski
a450fda4ed fix(lsp): prefer on_list over loclist in default handler
Problem: setting `loclist = true` makes `on_list` being ignored. This
  was not a problem before, but with `vim.lsp.buf.document_symbol` using
  `loclist = true` as default it is needed to explicitly pass `loclist =
  false` in order to use custom `on_list`.

Solution: prefer `on_list` over `loclist` and document the latter as
  taking effect only in the default handler.
2025-01-23 17:04:23 +01:00
Luuk van Baal
34d808b73c feat(api): combined highlights in nvim_eval_statusline()
Problem:  Combined highlighting was not applied to nvim_eval_statusline(),
          and 'statuscolumn' sign segment/numhl highlights.
Solution: Add an additional `groups` element to the return value of
          `nvim_eval_statusline()->highlights`. This is an array of stacked
          highlight groups (highest priority last). Also resolve combined
          highlights for the 'statuscolumn' sign segment/numhl highlights.
          Expose/synchronize some drawline.c logic that is now mimicked in
          three different places.
2025-01-23 10:56:25 +01:00
Christian Clason
8634bd46b2 vim-patch:9.1.1042: filetype: just files are not recognized
Problem:  filetype: just files are not recognized
Solution: adjust filetype detection pattern, detect just shebang line,
          include just ftplugin, indent and syntax plugin
          (Peter Benjamin)

closes: vim/vim#16466

72755b3c8e

Co-authored-by: Peter Benjamin <petermbenjamin@gmail.com>
2025-01-23 09:42:20 +01:00
zeertzjq
28998e1f8a
vim-patch:9.1.1045: filetype: N-Tripels and TriG files are not recognized (#32170)
Problem:  filetype: N-Tripels and TriG files are not recognized
Solution: detect '*.nt' files as ntriples filetype and '*.trig' files
          as trig filetype (Gordian Dziwis)

closes: vim/vim#16493

c04334c33f

Co-authored-by: Gordian Dziwis <gordian@dziw.is>
2025-01-23 16:33:41 +08:00
phanium
4c9f3689a1 fix(checkhealth): failed if 'lua' in plugin name 2025-01-23 07:46:40 +00:00
zeertzjq
a9c12d4c29
vim-patch:9.1.1048: crash after scrolling and pasting in silent Ex mode (#32168)
Problem:  Crash after scrolling and pasting in silent Ex mode.
          (fizz-is-on-the-way)
Solution: Don't move cursor to line 0 when scrolling.
          (zeertzjq)

closes: vim/vim#16506

df098fedbc
2025-01-23 08:12:10 +08:00
zeertzjq
fd55c7df6f
test(lua/hl_spec): set timeout for transient state (#32169) 2025-01-23 08:11:53 +08:00
Siddhant Agarwal
af0ef2ac9d
feat(lua): vim.hl.range() "timeout" #32012
Problem:
`vim.hl.on_yank()` has a "timeout" behavior but this is not available for
`vim.hl.range()`.

Solution:
Add `timeout` arg to `vim.hl.range()`.
2025-01-22 07:46:24 -08:00
luukvbaal
34344b939c
fix(editor): avoid scrolling :substitute confirm message #32149
Regression from 48e2a73.
2025-01-22 07:36:57 -08:00
jdrouhard
22fd52325b
fix(inspector): update semantic token namespace (#32157)
This updates the extmark namespace to search for when filtering out
semantic tokens to match the new namespace style recently introduced.
2025-01-22 21:02:30 +08:00
zeertzjq
d46ebd2a74
fix(startup): avoid crash with completion from -l script (#32160)
Related #27764
2025-01-22 17:10:29 +08:00
zeertzjq
a66f6add29
vim-patch:9.1.1046: fuzzymatching doesn't prefer matching camelcase (#32155)
Problem:  fuzzymatching doesn't prefer matching camelcase
          (Tomasz N)
Solution: Add extra score when case matches (glepnir)

fixes: vim/vim#16434
closes: vim/vim#16439

9dfc7e5e61

Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-22 10:55:41 +08:00
zeertzjq
a8b6fa07c4
fix(search): avoid quadratic time complexity when computing fuzzy score (#32153) 2025-01-22 09:28:27 +08:00
zeertzjq
3a25995f30
Merge pull request #32144 from zeertzjq/termkey-x1-x2
feat(tui/terminal): support X1 and X2 mouse events
2025-01-21 22:50:39 +08:00
zeertzjq
06a1f82f1c feat(terminal): forward X1 and X2 mouse events
Ref:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
2025-01-21 22:21:05 +08:00
zeertzjq
44dbfcfba4 feat(tui): recognize X1 and X2 mouse events
Ref:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Other-buttons
2025-01-21 21:01:46 +08:00
bfredl
d7aba51d39
Merge pull request #32098 from bfredl/multihl_group
feat(extmark): stack multiple highlight groups in `hl_group`
2025-01-21 12:32:20 +01:00
bfredl
4cced601c8 feat(extmark): stack multiple highlight groups in hl_group
This has been possible in the "backend" for a while but
API was missing.

Followup: we will need a `details2=true` mode for `nvim_get_hl_id_by_name`
to return information in a way forward compatible with even further
enhancements.
2025-01-21 12:00:24 +01:00
zeertzjq
05435bf105
vim-patch:c273f1a: runtime(vim): Update base-syntax, match ternary and falsy operators (#32132)
fixes: vim/vim#14423
fixes: vim/vim#16227
closes: vim/vim#16484

c273f1ac77

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-21 00:10:14 +00:00
Christian Clason
855a2a75e6 vim-patch:4335fcf: runtime(kconfig): updated ftplugin and syntax script
4335fcfed1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-21 00:16:24 +01:00
Konrad Malik
f50f86b9ff fix(treesitter): compute folds on_changedtree only if not nil 2025-01-20 22:32:45 +00:00
dundargoc
0bc75ac78e ci(news): treat deprecated.txt as part of news.txt
This is because we reference to deprecated.txt from news.txt, so
deprecation news updates are made only in deprecated.txt.
2025-01-20 20:39:08 +01:00
bfredl
20e16c1c49
Merge pull request #32099 from bfredl/no_bufhl
feat(api): deprecate nvim_buf_add_highlight()
2025-01-20 15:42:56 +01:00
Donatas
5b1136a99c
feat(inccommand): preview 'nomodifiable' buffers #32034
Problem:
Incremental preview is not allowed on 'nomodifiable' buffers.

Solution:
- Allow preview on 'nomodifiable' buffers.
- Restore the 'modifiable' option in case the preview function changes it.
2025-01-20 06:40:26 -08:00
Luuk van Baal
92556be33d fix(messages): compute msg_col after last newline in ext_messages
Problem:  We want to keep track of the current message column, which is
          done very rudimentary for ext_messages; only checking if the
          message ends in a newline to reset the column, while computing
          the entire cellwidth of the message, which may contain
          (multiple) newlines not necessarily at the end (since 21718c6).
          This introduced a noticeable delay for large messages (e.g. :=vim).
Solution: Calculate the cellwidth of the message after the last newline.
          Use it to keep track of the current message column. This might
          not be a functional change currently, since it only affects
          messages with (multiple) newlines not at the end of a message,
          which I don't think we emit internally, and msg_col is reset for
          a new kind. It does fix the performance problem.
2025-01-20 15:11:33 +01:00
Konrad Malik
ded15ca8c2
fix: completion.enable(false,...) deletes invalid augroup #32121
Problem:

    vim.lsp.completion.enable(true, client.id, bufnr)
    vim.lsp.completion.enable(false, client.id, bufnr)

    Error detected while processing LspDetach Autocommands for "*":
    Error executing lua callback: …/lsp/completion.lua:701: Vim:E367: No such group: "vim/lsp/completion-22"
    stack traceback:
            [C]: in function 'nvim_del_augroup_by_name'
            …/lsp/completion.lua:701: in function 'disable_completions'
            …/lsp/completion.lua:724: in function 'enable'

Solution:
Delete the correct augroup.
2025-01-20 06:10:00 -08:00
Guilherme Soares
8a236c242a
fix(lsp): set floating window filetype after setup #32112
Problem:
The filetype for the floating window buffer is being set before its context is fully initialized.
This results in `FileType` events not receiving the correct context.

Solution:
Set the filetype after the floating preview window and its buffer variables are
fully configured to ensure proper context is provided.
2025-01-20 05:00:13 -08:00
bfredl
19b25f3fea feat(api): deprecate nvim_buf_add_highlight()
This was kept for a while as it was a useful short hand and initially
matched what highlights what actually properly implemented. But now
|vim.hl.range()| is a better high-level shorthand with full support for
native multi-line ranges.
2025-01-20 13:59:29 +01:00
Jaehwang Jung
27c8806953
docs(treesitter): expose LanguageTree:parent() #32108
Plugins may want to climb up the LanguageTree.

Also add missing type annotations for other methods.
2025-01-20 04:17:36 -08:00
bfredl
71922cd1dc
Merge pull request #31597 from bfredl/deletionism
fix(wininfo): when freeing windows, free the lowest priority wininfo
2025-01-20 11:02:58 +01:00
Christian Clason
5b025b499e vim-patch:9.1.1030: filetype: setting bash filetype is backwards incompatible
Problem:  filetype: setting bash filetype is backwards incompatible
Solution: revert patch v9.1.0965, detect bash scripts again as sh
          filetype

This reverts commit b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721.

related: vim/vim#16309

727c567a09

Co-authored-by: Christian Brabandt <cb@256bit.org>

vim-patch:9.1.1033: tests: shaderslang was removed from test_filetype erroneously

Problem:  tests: shaderslang was removed from test_filetype erroneously
          (Christian Clason, after v9.1.1030)
Solution: restore the test

1d2867df0c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-20 08:20:36 +01:00
Christian Clason
b172dd57fa vim-patch:2cb8246: runtime(tex): add texEmphStyle to texMatchGroup in syntax script
fixes: vim/vim#16228

2cb8246eb9

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Github User JordL
2025-01-20 08:20:24 +01:00
Christian Clason
4dc2e016da vim-patch:d402ba8: runtime(netrw): upstream snapshot of v175
Relevant commits:
- release: netrw v175
- fix: prevent netrw to load into the built-in terminal
- fix: restore correctly cpo settings
- fix(docs): mispelled original authors name
- chore: move viml files to new formatting standard

fixes: vim/vim#16463
closes: vim/vim#16465

d402ba81e2

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-20 08:20:11 +01:00
Christian Clason
de83cc5842 fix(netrw): re-add missing comment marker in syntax file 2025-01-20 08:20:11 +01:00
Mathias Fussenegger
5f527f24f0 fix(lsp): don't use completion filterText if prefix is empty
Follow up to https://github.com/neovim/neovim/pull/32072

If there is no prefix (e.g. at the start of word boundary or a line), it
always used the `filterText` because the `match` function always
returned false.
2025-01-19 22:11:20 +01:00
Yochem van Rosmalen
d56ba71af1
fix(lsp): document_symbol uses loclist by default #32070
Problem: Not able to open document symbols for different buffers

Solution: Use the location list as default.

To switch back to previous behavior (qflist):

  vim.lsp.buf.document_symbol({ loclist = false })

Fixes: #31832
2025-01-19 13:08:10 -08:00