Commit Graph

31818 Commits

Author SHA1 Message Date
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
deepsghimire
a6f219b06b
fix(log): unintuitive message for undefined $TMPDIR 2025-01-19 11:37:04 -08:00
Jaehwang Jung
6696ea7f10 fix(treesitter): clean up parsing queue 2025-01-19 15:53:17 +01:00
zeertzjq
ee54069d1d
vim-patch:8dec6c2: runtime(vim): Update base-syntax, fix is/isnot operator matching (#32100)
- Match is? and isnot? operators.
- Limit other comparison operators to one match modifier rather than
  two.

closes: vim/vim#16482

8dec6c2e6c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-19 22:14:52 +08:00
Devon Gardner
71507281fb
fix(coverity/530826): validate_opt_idx unchecked negative idx (#32081)
Problem:
opt_idx possible negative value used as index

Solution:
check opt_idx not less than zero (kOptInvalid)
2025-01-19 08:49:53 +08:00
林玮 (Jade Lin)
a5b1b83a26 fix(lua): prevent SIGSEGV when lua error is NULL in libuv_worker
Problem:
Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns
NULL in `nlua_luv_thread_common_cfpcall`.

Crash stack trace:
- `_platform_strlen` → `xstrdup` (memory.c:469)
- `nlua_luv_thread_common_cfpcall` (executor.c:281)

Solution:
Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
2025-01-18 19:08:50 +00:00
Gregory Anders
51ccd12b3d
fix(diagnostic)!: make virtual text handler opt-in (#32079)
Making this opt-out (on by default) was the wrong choice from the
beginning. It is too visually noisy to be enabled by default.

BREAKING CHANGE: Users must opt-in to the diagnostic virtual text
handler by adding

  vim.diagnostic.config({ virtual_text = true })

to their config.
2025-01-18 07:43:21 -06:00
Christian Clason
954d4969c9 vim-patch:e064051: runtime(c): add new constexpr keyword to syntax file (C23)
closes: vim/vim#16471

e06405181a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-01-18 11:54:53 +01:00
Christian Clason
7d04ebd43c vim-patch:54cb514: runtime(sh): update syntax script
- remove duplicated keywords
- add bash coproc and COPROC_PID keywords

54cb514c9a

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-01-18 11:48:35 +01:00
dundargoc
27da6f7757 refactor: simplify bump_deps.lua
Simplify usage and remove redundant flags and code.
2025-01-18 10:52:51 +01:00
Christian Clason
e962167245 vim-patch:9cfdabb: runtime(netrw): change netrw maintainer
Dr. Chip retired some time ago and is no longer maintaining the netrw
plugin. However as a runtime plugin distributed by Vim, it important to
maintain the netrw plugin in the future and fix bugs as they are
reported.

So, split out the netrw plugin as an additional package, however include
some stubs to make sure the plugin is still loaded by default and the
documentation is accessible as well.

closes: vim/vim#16368

9cfdabb074

Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
2025-01-18 09:49:35 +01:00
Christian Clason
136cb642a0 vim-patch:c2a967a: runtime(c): Update syntax and ftplugin files
- highlight more C keywords, including some from C23

Conditionally highlight C23 features:
- #embed, #elifdef and #elifndef preprocessor directives
- predefined macros
- UTF-8 character constants
- binary integer constants, _BitInt literals, and digit separators
- nullptr_t type and associated constant
- decimal real floating-point, bit precise and char types
- typeof operators

Matchit:
- update for new preprocessor directives

fixes: vim/vim#13667
fixes: vim/vim#13679
closes: vim/vim#12984

c2a967a1b9

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Albin Ahlbäck <albin.ahlback@gmail.com>
2025-01-18 08:45:43 +01:00