Commit Graph
3029 Commits
Author SHA1 Message Date
Justin M. Keyes 5135a23219 Merge #31900 from luukvbaal/nvim_echo 2025-01-09 06:36:29 -08:00
Luuk van Baal 5c92b40b4b feat(api): deprecate nvim_out/err_write(ln) 2025-01-09 13:35:42 +01:00
Luuk van Baal ead5683ff9 feat(api): add err field to nvim_echo() opts
Problem:  We want to deprecate `nvim_err_write(ln)()` but there is no
          obvious replacement (from Lua). Meanwhile we already have
          `nvim_echo()` with an `opts` argument.
Solution: Add `err` argument to `nvim_echo()` that directly maps to
          `:echoerr`.
2025-01-09 13:35:40 +01:00
zeertzjqandWu, Zhenyu 3f0adf90de vim-patch:9.1.0998: filetype: TI assembly files are not recognized (#31929)
Problem:  filetype: TI assembly files are not recognized
Solution: inspect '*.sa' and assembly files and detect TI assembly
          files, include filetype plugin and syntax script for TI
          assembly files (Wu, Zhenyu)

closes: vim/vim#15827

https://github.com/vim/vim/commit/4f73c07abff420bad9fa5befc2c284c00b984993

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-01-09 17:30:26 +08:00
notomo 5b9518b436 fix(api): nvim_set_decoration_provider callback return type #31912
Problem: incorrect return type doc causes luals `Annotations specify that at most 0 return value(s) are required, found 1 returned here instead.` diagnosis

Solution: correct return type doc
2025-01-08 04:37:29 -08:00
Christian Clasonandmtvare6 561580aba5 vim-patch:9.1.0995: filetype: shaderslang files are not detected
Problem:  filetype: shaderslang files are not detected
Solution: detect '*.slang' files as shaderslang filetype,
          include a filetype and syntax script (mtvare6)

Reference:
https://shader-slang.com/

closes: vim/vim#16387

https://github.com/vim/vim/commit/616219f684744bcfad61a53c13166cda9b141dea

Co-authored-by: mtvare6 <mtvare6@proton.me>
2025-01-08 10:32:45 +01:00
glepnir b12b91c274 feat(health): show :checkhealth in floating window #31086
Problem: health can not shown in a floating window
Solution: add g:health variable
2025-01-07 08:09:01 -08:00
d9ee0d2984 perf(treesitter): don't fetch parser for each fold line
**Problem:** The treesitter `foldexpr` calls `get_parser()` for each
line in the buffer when calculating folds. This can be incredibly slow
for buffers where a parser cannot be found (because the result is not
cached), and exponentially more so when the user has many
`runtimepath`s.

**Solution:** Only fetch the parser when it is needed; that is, only
when initializing fold data for a buffer.

Co-authored-by: Jongwook Choi <wookayin@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2025-01-07 16:43:45 +01:00
zeertzjq 8fa4306eb9 vim-patch:9.1.0991: v:stacktrace has wrong type in Vim9 script
Problem:  v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any.  Fix grammar in docs.
          (zeertzjq)

closes: vim/vim#16390

https://github.com/vim/vim/commit/6655bef33047b826e0ccb8c686f3f57e47161b1c
2025-01-07 09:15:10 +08:00
d5308637bf vim-patch:9.1.0984: exception handling can be improved
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: vim/vim#16360

https://github.com/vim/vim/commit/663d18d6102f40d14e36096ec590445e61026ed6

Co-authored-by: ichizok <gclient.gaap@gmail.com>
Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
2025-01-07 09:15:10 +08:00
Riley Bruins 30de00687b refactor(treesitter): simplify condition #31889 2025-01-06 16:56:53 -08:00
Justin M. Keyes 3d9fb975b9 Merge #31625 perf(decor): improve iter_captures() cache 2025-01-06 07:09:34 -08:00
luukvbaal 86770108e2 fix(lsp): open_floating_preview() zindex relative to current window #31886
Problem:  open_floating_preview() may be hidden behind current window if
          that is floating and has a higher zindex.
Solution: Open floating preview with zindex higher than current window.
2025-01-06 06:05:50 -08:00
vanaigr dd234135ad refactor: split predicates and directives 2025-01-06 00:35:19 -06:00
vanaigr 8d2ee542a8 perf(decor): join predicates and matches cache 2025-01-06 00:34:48 -06:00
Justin M. Keyes 570a8da01b fix(health): "q" should not close last window #31876 2025-01-05 11:31:39 -08:00
Maria José Solano 548f19ccc3 feat(health): close checkhealth buffers with q #31870 2025-01-05 09:51:51 -08:00
Riley Bruins b61051ccb4 feat(func): allow manual cache invalidation for _memoize
This commit also adds some tests for the existing memoization
functionality.
2025-01-05 12:28:01 +01:00
Maria José Solano 5e90406487 fix(health): set nomodifiable in checkhealth buffers 2025-01-05 09:43:59 +01:00
dundargoc a8ace2c58a fix(vim.fs.normalize): normalize case for windows drive letter
Also add tests for the current path casing behavior so it doesn't get
accidentally changed.
2025-01-04 21:48:45 +01:00
Justin M. Keyes b52531a9cb docs: misc #31822
* docs: drop "lua-" prefix from most treesitter tags
* docs: move mouse section from tui.txt to gui.txt
* docs: misc
2025-01-03 08:29:36 -08:00
Christian ClasonandZoe Roux fa298fd2f4 vim-patch:9.1.0987: filetype: cake files are not recognized
Problem:  filetype: cake files are not recognized
Solution: detect '*.cake' files as cs filetype
          (Zoe Roux)

References:
https://cakebuild.net/

closes: vim/vim#16367

https://github.com/vim/vim/commit/a407573f30a978b3aa61532bbd9b0ae94a87dc32

Co-authored-by: Zoe Roux <zoe.roux@zoriya.dev>
2025-01-03 11:45:21 +01:00
Christian ClasonandGregory Anders b365036ab3 vim-patch:9.1.0986: filetype: 'jj' filetype is a bit imprecise
Problem:  filetype: 'jj' filetype is a bit imprecise
Solution: rename 'jj' filetype to 'jjdescription'
          (Gregory Anders)

closes: vim/vim#16364

https://github.com/vim/vim/commit/58c44e8833365e1a777330491c2799ae324ed893

Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-01-03 11:45:10 +01:00
luukvbaal 48e2a73610 feat(ui)!: emit prompt "messages" as cmdline events #31525
Problem:  Prompts are emitted as messages events, where cmdline events
          are more appropriate. The user input is also emitted as
          message events in fast context, so cannot be displayed with
          vim.ui_attach().
Solution: Prompt for user input through cmdline prompts.
2025-01-02 05:51:03 -08:00
Jaehwang Jung 9d9ee3476e fix(lsp): ensure watcher cancel
* Cancel watcher in the "force" case.
* Cancel watcher outside the async callback. It seems nvim doesn't wait
  async jobs on quitting, leaving detached inotifywait processes.
* Clean up cancelling callbacks.
2025-01-02 10:23:06 +00:00
dundargoc 6dc0eb9f41 fix(vim.fs.abspath): correctly handle UNC paths 2025-01-01 23:42:42 +01:00
Justin M. Keyes dc692f553a docs: misc #31479 2025-01-01 12:29:51 -08:00
Gustav Eikaas 0bef3b911c fix(vim.fs): joinpath() does not normalize slashes on Windows #31782 2024-12-31 07:40:05 -08:00
Mathias Fussenegger e00cd1ab40 feat(lsp): return resolved config for vim.lsp.config[name]
Allows to retrieve the configuration as it will be used by `lsp.enable`
- including the parts merged from `*` and rtp.

This is useful for explicit startup control
(`vim.lsp.start(vim.lsp.config[name])`)

Closes https://github.com/neovim/neovim/issues/31640
2024-12-31 13:18:05 +01:00
Christian ClasonandWu, Zhenyu 1877cd5fcd vim-patch:9.1.0982: TI linker files are not recognized
Problem:  TI linker files are not recognized
Solution: inspect '*.cmd' files and detect TI linker files
          as 'lnk' filetype, include a lnk ftplugin and syntax
          script (Wu, Zhenyu)

closes: vim/vim#16320

https://github.com/vim/vim/commit/39a4eb0b2ca901b59800fad086550053556e59dc

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-31 12:29:35 +01:00
glepnir bdc0b5f505 vim-patch:9.1.0983: not able to get the displayed items in complete_i… (#31796)
vim-patch:9.1.0983: not able to get the displayed items in complete_info()

Problem:  not able to get the displayed items in complete_info()
          (Evgeni Chasnovski)
Solution: return the visible items via the "matches" key for
          complete_info() (glepnir)

fixes: vim/vim#10007
closes: vim/vim#16307

https://github.com/vim/vim/commit/d4088edae21659e14ab5f763c820f4eab9d36981
2024-12-31 19:12:50 +08:00
Christian ClasonandGustavEikaas 7b739248a1 vim-patch:9.1.0977: filetype: msbuild filetypes are not recognized
Problem:  filetype: msbuild filetypes are not recognized
Solution: detect msbuild files as xml filetype
          (Gustav Eikaas)

closes: vim/vim#16339

https://github.com/vim/vim/commit/32b7e3a8c99d369b02154df74cbe42a37c7c7e68

Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
2024-12-30 12:01:26 +01:00
Igor e4bc8b5967 fix(treesitter.foldexpr): only refresh valid buffers
Problem: autocmd to refresh folds always uses the current buffer if the
option type is local. However, the current buffer may not have a parser,
and thus the assert that checks for a parser could fail.

Solution: check if the foldinfo contains the buffer, and only refresh if
so.
2024-12-29 16:24:19 +00:00
Maria José Solano 02097e43c8 fix(lsp): check if sig_help window is focusable when configuring cycle keymap 2024-12-29 16:23:23 +00:00
Christian ClasonandWu, Zhenyu 0e880b5612 vim-patch:9.1.0972: filetype: TI linker map files are not recognized
Problem:  filetype: TI linker map files are not recognized
Solution: detect TI linker map files as lnkmap filetype
          (Wu, Zhenyu)

References:
https://downloads.ti.com/docs/esd/SPRUI03A/Content/SPRUI03A_HTML/linker_description.html

closes: vim/vim#16324

https://github.com/vim/vim/commit/5113831d16c05f3a8b47da0c6f95a641d5fc7b2e

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-29 16:15:00 +01:00
Christian ClasonandGustavEikaas 493b6899ee vim-patch:9.1.0971: filetype: SLNX files are not recognized
Problem:  filetype: SLNX files are not recognized
Solution: detect '*.slnx' files as xml filetype
          (Gustav Eikaas)

References:
https://blog.ndepend.com/slnx-the-new-net-solution-xml-file-format/
https://blog.jetbrains.com/dotnet/2024/10/04/support-for-slnx-solution-files/

closes: vim/vim#16334

https://github.com/vim/vim/commit/3b3318b64043dcf29d6f06322739f695a5cc257e

Co-authored-by: GustavEikaas <gustav.eikaas@gmail.com>
2024-12-29 16:15:00 +01:00
Jaehwang Jung 48acbc4d64 fix(treesitter.foldexpr): refresh in the buffers affected by OptionSet 2024-12-29 07:35:39 +00:00
Luca Saccarola 2b07b14eac vim-patch:9.1.0965: filetype: sh filetype set when detecting the use of bash (#31749)
Problem:  filetype: sh filetype set when detecting the use of bash
Solution: when bash is detected, use 'bash' filetype instead
          (Luca Saccarola)

closes: vim/vim#16309

https://github.com/vim/vim/commit/b9b762c21f2b61e0e7d8fee43d4d3dc8ecffd721
2024-12-28 19:20:50 +08:00
Famiu Haque 5180707310 feat(lua): add vim.fs.abspath
Problem: There is currently no way to check if a given path is absolute or convert a relative path to an absolute path through the Lua stdlib. `vim.fs.joinpath` does not work when the path is absolute. There is also currently no way to resolve `C:foo\bar` style paths in Windows.

Solution: Add `vim.fs.abspath`, which allows converting any path to an absolute path. This also allows checking if current path is absolute by doing `vim.fs.abspath(path) == path`. It also has support for `C:foo\bar` style paths in Windows.
2024-12-28 11:40:39 +01:00
Gregory Anders 35247b00a4 feat(lsp): support function for client root_dir (#31630)
If root_dir is a function it is evaluated when the client is created to
determine the root directory.

This enables dynamically determining the root directory based on e.g.
project or directory structure (example: finding a parent Cargo.toml
file that contains "[workspace]" in a Rust project).
2024-12-27 10:09:22 -06:00
Christian ClasonandAnton Kastritskii 69fbb58385 vim-patch:9.1.0962: filetype: bun.lock file is not recognized
Problem:  filetype: bun.lock file is not recognized
Solution: detect 'bun.lock' file as jsonc filetype
          (Anton Kastritskii)

closes: vim/vim#16308

https://github.com/vim/vim/commit/f07ae5b3bdb7331ee0e65adcb74402eef74f0a2b

Co-authored-by: Anton Kastritskii <halloy52@gmail.com>
2024-12-27 11:40:38 +01:00
Christian ClasonandWu, Zhenyu 7567f7d322 vim-patch:9.1.0961: filetype: TI gel files are not recognized
Problem:  filetype: TI gel files are not recognized
Solution: detect '*.gel' files as gel filetype, include
          get filetype and syntax plugins
          (Wu, Zhenyu)

References:
https://downloads.ti.com/ccs/esd/documents/users_guide/ccs_debug-gel.html

closes: vim/vim#16226

https://github.com/vim/vim/commit/9360de9027aa286e802363ede59c9e97025ae123

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-25 13:38:45 +01:00
Christian ClasonandWu, Zhenyu 01e1598072 vim-patch:9.1.0960: filetype: hy history files are not recognized
Problem:  filetype: hy history files are not recognized
Solution: detect '*.hy', '.hy-history' files as hy filetype,
          detect '.lips_repl_history' files are scheme filetype
          (Wu, Zhenyu)

closes: vim/vim#16298

https://github.com/vim/vim/commit/a32daed55933df49a7aed571cc6e400ae01c7976

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-25 13:38:45 +01:00
Shihua Zeng b51110f4a1 docs(api): return type of nvim_get_keymap() #31708 2024-12-24 09:56:10 -08:00
Christian ClasonandWu, Zhenyu 14ee1de7e5 vim-patch:9.1.0958: filetype: supertux2 config files detected as lisp
Problem:  filetype: supertux2 config files detected as lisp
Solution: detect supertux2 config files as scheme instead
          (Wu, Zhenyu)

References:
https://github.com/SuperTux/supertux/wiki/S-Expression

supertux uses #t and #f as bool type, which is same as scheme, not
common lisp

closes: vim/vim#16287

https://github.com/vim/vim/commit/e62d93ead10b4c5818e3c0b7551f1784d24bfe33

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2024-12-24 11:55:06 +01:00
Yorick Peterse 4cbeb6fa3c fix(diagnostic): silence :chistory #31701
vim.diagnostic.set_list() uses chistory to restore the actively selected
entry whenever necessary. This however also results in it displaying
some output in the message bar, but this output isn't useful (and can
even be distracting) when opening the quickfix window. This fixes this
by silencing the chistory command.
2024-12-23 11:57:15 -08:00
Lukasz Piepiora 55c5d0de26 docs(api): vim.version.range():has() method #31622
Problem:
The :has() method of the vim.version.range() result is not documented
though it's mentioned in examples.

Solution:
Mention it in the range() result doc.
2024-12-23 05:08:20 -08:00
Christian ClasonandHugo Osvaldo Barrera' via vim_dev 665a0e85c4 vim-patch:9.1.0953: filetype: APKBUILD files not correctly detected
Problem:  filetype: APKBUILD files not correctly detected
Solution: detect 'APKBUILD' files as apkbuild filetype,
          include a apkbuild syntax script (which basically
          just sources the sh.vim syntax file)
          (Hugo Osvaldo Barrera)

Vim plugins (e.g.: ALE, nvim-lspconfig, etc) rely on filetype to
determine which integrations/helpers are applicable. They expect
filetype=apkbuild for APKBUILD files.

On the other hand, plugins also enable bash-specific linters and
functionality when filetype=bash, but APKBUILD files are POSIX sh, not
bash, so these often provide bogus results.

Change the filetype for APKBUILD to a 'apkbuild', so that tools and
ftplugin can properly target these files. This filetype will use the
existing `sh` syntax rules, since these are applicable for them.

https://github.com/vim/vim/commit/7cb24917a112ba473cb351bdcdc48b8adbd46793

Co-authored-by: Hugo Osvaldo Barrera' via vim_dev <vim_dev@googlegroups.com>
2024-12-22 18:05:07 +01:00
Christian ClasonandKonfekt c7a4197a5c vim-patch:9.1.0951: filetype: jshell files are not recognized
Problem:  filetype: jshell files are not recognized
Solution: detect '*.jsh' files as java filetype
          (Konfekt)

closes: vim/vim#16260

https://github.com/vim/vim/commit/62e3014ab1146d7f78694c97fc6974f1af2cc5af

Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
2024-12-22 11:58:51 +01:00
Gregory Anders 130b5fd85f feat(lsp): return table from lsp/ files on runtimepath (#31663)
Problem: LSP configs on the runtimepath must have the same name as the
LSP server and must also explicitly set the name in vim.lsp.config. This
is redundant and creates a footgun where a user may accidentally use the
wrong name when assigning to the vim.lsp.config table.

Solution: Return a table from lsp/ runtimepath files instead
2024-12-21 08:27:27 -06:00