aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* fix(diagnostic): vim.diagnostic.get(…,{lnum=…}) on multi-line diagnostic ↵Raphael2024-04-23
| | | | | | | | #28273 Problem: vim.diagnostic.get(…,{lnum=…}) does not match multi-line diagnostics. Solution: add end_lnum support.
* fix(diagnostic): open_float on multi-line diagnostics #28301Raphael2024-04-23
| | | | | Problem: when diagnostic have a range of line, open_float not work. Solution: filter diagnostic by line number range.
* vim-patch:9.1.0366: filetype: ondir files are not recognizedChristian Clason2024-04-23
| | | | | | | | | | | | Problem: filetype: ondir files are not recognized Solution: Detect '.ondirrc' as ondir filetype (Jon Parise) closes: vim/vim#14604 https://github.com/vim/vim/commit/ea999037a41292b3d3e00700a87a82fe5d2c12b2 Co-authored-by: Jon Parise <jon@indelible.org>
* fix(lsp): avoid assertion when `client_hints` do not exist (#28461)Yi Ming2024-04-22
|
* refactor(lua): deprecate tbl_flatten #28457Justin M. Keyes2024-04-22
| | | forgot some changes in 9912a4c81b0856200f44a38e99d38eae44cef5c9
* fix: unreliable "checkhealth completions" testJustin M. Keyes2024-04-22
| | | | | | | | | | | | | | ref https://github.com/neovim/neovim/issues/19596 FAILED test/functional/plugin/health_spec.lua @ 37: :checkhealth completions can be listed via getcompletion() test/functional/plugin/health_spec.lua:40: Expected objects to be the same. Passed in: (string) 'provider.node' Expected: (string) 'provider.clipboard' stack traceback: test/functional/plugin/health_spec.lua:40: in function <test/functional/plugin/health_spec.lua:37>
* refactor(lua): deprecate tbl_flattenJustin M. Keyes2024-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Besides being redundant with vim.iter():flatten(), `tbl_flatten` has these problems: - Has `tbl_` prefix but only accepts lists. - Discards some results! Compare the following: - iter.flatten(): ``` vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable() ``` - tbl_flatten: ``` vim.tbl_flatten({1, { { a = 2 } }, { 3 } }) ``` Solution: Deprecate tbl_flatten. Note: iter:flatten() currently fails ("flatten() requires a list-like table") on this code from gen_lsp.lua: local anonym = vim.iter({ -- remove nil anonymous_num > 1 and '' or nil, '---@class ' .. anonymous_classname, }):flatten():totable() Should we enhance :flatten() to work for arrays?
* refactor(lua): rename tbl_isarray => isarrayJustin M. Keyes2024-04-21
| | | | | | | tbl_isarray was not released yet, so it will not go through a deprecation cycle. ref #24572
* refactor(lua): rename tbl_islist => islistJustin M. Keyes2024-04-21
| | | | ref #24572
* refactor(treesitter): language loadingLewis Russell2024-04-21
|
* perf(treesitter): incremental foldupdateJaehwang Jung2024-04-21
| | | | | | | | | | | Problem: While the fold level computation is incremental, the evaluation of the foldexpr is done on the full buffer. Despite that the foldexpr reads from the cache, it can take tens of milliseconds for moderately big (10K lines) buffers. Solution: Track the range of lines on which the foldexpr should be evaluated.
* feat(treesitter): handle quantified fold capturesRiley Bruins2024-04-20
|
* feat(lsp): add vim.lsp.buf.subtypes(), vim.lsp.buf.supertypes() (#28388)Yinzuo Jiang2024-04-20
| | | | Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* fix(vim.ui.open): try wslview before explorer.exe #28424Justin M. Keyes2024-04-20
| | | | | | | | | Problem: explorer.exe is unreliable on WSL. Solution: Try wslview before explorer.exe. fix #28410
* vim-patch:9.1.0355: filetype: flake.lock files are not recognizedChristian Clason2024-04-19
| | | | | | | | | | | | Problem: filetype: flake.lock files are not recognized Solution: Detect 'flake.lock' as json filetype (Riley Bruins) closes: vim/vim#14589 https://github.com/vim/vim/commit/ce736033ae86e14e8b1a56a3e4843c7ab24e48d2 Co-authored-by: Riley Bruins <ribru17@hotmail.com>
* refactor(vim.iter)!: remove vim.iter.map/filter/totable #26138Justin M. Keyes2024-04-19
| | | | | | | | Problem: The use-case for the convenience functions vim.iter.map(), vim.iter.filter(), vim.iter.totable() is not clear. Solution: Drop them for now. We can revisit after 0.10 release.
* vim-patch:9.1.0354: runtime(uci): No support for uci file types (#28409)zeertzjq2024-04-19
| | | | | | | | | | | | | Problem: runtime(uci): No support for uci file types (Wu, Zhenyu) Solution: include basic uci ftplugin and syntax plugins (Colin Caine) closes: vim/vim#14575 https://github.com/vim/vim/commit/4b3fab14dbde971f15d8783e9ef125b19fdbc829 Co-authored-by: Colin Caine <complaints@cmcaine.co.uk> Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* fix(lsp): correct deprecation message #28403Maria José Solano2024-04-18
|
* feat(lua): enable(enable:boolean, filter:table) #28374Justin M. Keyes2024-04-18
| | | | | | | | | | | | | Problem: We need to establish a pattern for `enable()`. Solution: - First `enable()` parameter is always `enable:boolean`. - Update `vim.diagnostic.enable()` - Update `vim.lsp.inlay_hint.enable()`. - It was not released yet, so no deprecation is needed. But to help HEAD users, it will show an informative error. - vim.deprecate(): - Improve message when the "removal version" is a *current or older* version.
* refactor(lsp): merge rpc.domain_socket_connect into rpc.connect (#28398)Mathias Fußenegger2024-04-18
| | | See discussion in https://github.com/neovim/neovim/pull/26850
* feat(lua): vim.fs.normalize() resolves ".", ".." #28203Famiu Haque2024-04-16
| | | | | | | | | | | | | | | | | | | | | Problem: `vim.fs.normalize` does not resolve `.` and `..` components. This makes no sense as the entire point of normalization is to remove redundancy from the path. The path normalization functions in several other languages (Java, Python, C++, etc.) also resolve `.` and `..` components. Reference: - Python: https://docs.python.org/3/library/os.path.html#os.path.normpath - Java: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize-- - C++: https://en.cppreference.com/w/cpp/filesystem/path/lexically_normal Solution: Resolve "." and ".." in `vim.fs.normalize`. Before: "~/foo/bar/../baz/./" => "~/foo/bar/../baz/." After: "~/foo/bar/../baz/./" => "~/foo/baz"
* feat(defaults): use ripgrep (rg) for 'grepprg' if availableLuna Saphie Mittelbach2024-04-16
|
* fix: vim.validate() order is not deterministic #28377Justin M. Keyes2024-04-16
| | | | | | | | | | | | | Problem: The order of the validation performed by vim.validate() is unpredictable. - harder to write reliable tests. - confusing UX because validation result might return different errors randomly. Solution: Iterate the input using `vim.spairs()`. Future: Ideally, the caller could provide an "ordered dict".
* Merge #28227 feat(diagnostic): is_enabled, enable(…, enable:boolean)Justin M. Keyes2024-04-16
|\
| * feat(diagnostic): enable(…, opts)Justin M. Keyes2024-04-15
| | | | | | | | | | | | | | | | | | | | Problem: vim.diagnostic.enable() does not match the signature of vim.lsp.inlay_hint.enable() Solution: - Change the signature so that the first 2 args are (bufnr, enable). - Introduce a 3rd `opts` arg. - Currently it only supports `opts.ns_id`.
| * feat(diagnostic): is_enabled, enable(…, enable:boolean)Justin M. Keyes2024-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.diagnostic.is_disabled` and `vim.diagnostic.disable` are unnecessary and inconsistent with the "toggle" pattern (established starting with `vim.lsp.inlay_hint`, see https://github.com/neovim/neovim/pull/25512#pullrequestreview-1676750276 As a reminder, the rationale is: - we always need `enable()` - we always end up needing `is_enabled()` - "toggle" can be achieved via `enable(not is_enabled())` - therefore, - `toggle()` and `disable()` are redundant - `is_disabled()` is a needless inconsistency Solution: - Introduce `vim.diagnostic.is_enabled`, and `vim.diagnostic.enable(…, enable:boolean)` - Note: Future improvement would be to add an `enable()` overload `enable(enable:boolean, opts: table)`. - Deprecate `vim.diagnostic.is_disabled`, `vim.diagnostic.disable`
* | vim-patch:9.1.0326: filetype: some requirements files are not recognized ↵zeertzjq2024-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#28360) Problem: filetype: some requirements files are not recognized Solution: Detect '*-requirements.txt', 'constraints.txt', 'requirements.in', 'requirements/*.txt' and 'requires/*.txt' as requirements filetype, include pip compiler, include requirements filetype and syntax plugin (Wu, Zhenyu, @raimon49) closes: vim/vim#14379 https://github.com/vim/vim/commit/f9f5424d3e75bbdb35aa48fa6f9241d9479b35e8 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu> Co-authored-by: raimon <raimon49@hotmail.com>
* | vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)zeertzjq2024-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized Problem: filetype: CMakeCache.txt files not recognized Solution: Detect 'CMakeCache.txt' files as cmakecache filetype, include basic syntax script for cmakecache (Wu, Zhenyu, @bfrg) closes: vim/vim#14384 https://github.com/vim/vim/commit/62c09e032c6b2d49fffac726300d142381924b98 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu> Co-authored-by: bfrg <bfrg@users.noreply.github.com>
* | vim-patch:9.1.0324: filetype: some json files are not recognizedzeertzjq2024-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: some json files are not recognized Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype (Wu, Zhenyu) See: - https://github.com/microsoft/PowerToys/blob/main/.vsconfig - https://jscs-dev.github.io/ closes: vim/vim#14452 https://github.com/vim/vim/commit/c59a8648b2d8b3e17f12cd45f74a31b1aa385d2d Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* | vim-patch:9.1.0323: filetype: cabal config files may not be recognizedzeertzjq2024-04-16
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: cabal config files may not be recognized Solution: Change filetype pattern to '*/{,.}cabal/config' (Wu Zhenyu) closes: vim/vim#14498 https://github.com/vim/vim/commit/799dedec0e959d7a18df8a06d497770706d1627c Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* | vim-patch:9.1.0322: filetype: some mail tools not recognizedzeertzjq2024-04-16
|/ | | | | | | | | | | | | Problem: filetype: some mail tools not recognized Solution: Detect '.mbsncrc' as conf, '.msmtprc' as msmtp and '.notmuch-config' as ini filetype (Shane-XB-Qian) closes: vim/vim#14533 https://github.com/vim/vim/commit/a7a9a476cf388f89286216188b8c8ae10702d9e2 Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
* fix(vim.ui): open() may wait indefinitely #28325Justin M. Keyes2024-04-15
| | | | | | | | | | | | Problem: vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986 Solution: - Change `vim.ui.open()`: - Do not call `wait()`. - Return a `SystemObj`. The caller can decide if it wants to `wait()`. - Change `gx` to `wait()` only a short time. - Allows `gx` to show a message if the command fails, without the risk of waiting forever.
* vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)zeertzjq2024-04-15
| | | | | | | | | | | | | Problem: String interpolation fails for Dict type Solution: Support Dict data type properly, also support :put =Dict (without having to convert it to string() first) (Yegappan Lakshmanan) fixes: vim/vim#14529 closes: vim/vim#14541 https://github.com/vim/vim/commit/f01493c55062c01b1cdf9b1e946577f4d1bdddf3 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* feat(api)!: nvim_open_win: noautocmd blocks all autocmds #28192Sean Dewar2024-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: noautocmd is confusing; despite its name, it doesn't block all autocommands (instead it blocks only those related to setting the buffer), and is commonly used by plugins to open windows while producing minimal side-effects. Solution: be consistent and block all autocommands when noautocmd is set. This includes WinNew (again), plus autocommands from entering the window (if enter is set) like WinEnter, WinLeave, TabEnter, .etc. See the discussion at https://github.com/neovim/neovim/pull/14659#issuecomment-2040029517 for more information. Remove win_set_buf's noautocmd argument, as it's no longer needed. NOTE: pum_create_float_preview sets noautocmd for win_set_buf, but all its callers already use block_autocmds. Despite that, pum_create_float_preview doesn't actually properly handle autocommands (it has no checks for whether those from win_enter or nvim_create_buf free the window). For now, ensure autocommands are blocked within it for correctness (in case it's ever called outside of a block_autocmds context; the function seems to have been refactored in #26739 anyway).
* fix(defaults): only repeat macro for each selected line if linewise (#28289)zeertzjq2024-04-15
| | | | | | As mentioned in #28287, repeating a macro for each selected line doesn't really make sense in non-linewise Visual mode. Fix #28287
* vim-patch:9.1.0318: filetype: translate shell config files are not recognizedChristian Clason2024-04-14
| | | | | | | | | | | | | | Problem: filetype: translate shell config files are not recognized Solution: Detect 'init.trans', 'translate-shell' and '.trans' files as clojure (Wu, Zhenyu) See: https://github.com/soimort/translate-shell/wiki/Configuration closes: vim/vim#14499 https://github.com/vim/vim/commit/4b5cd7257ee99384940d5210cf50298ff925924e Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0317: filetype: matplotlibrc files are not recognizedChristian Clason2024-04-14
| | | | | | | | | | | | | | Problem: filetype: matplotlibrc files are not recognized Solution: Detect 'matplotlibrc' file as yaml filetype (Wu, Zhenyu) See: https://matplotlib.org/stable/users/explain/customizing.html#the-matplotlibrc-file closes: vim/vim#14501 https://github.com/vim/vim/commit/55d4f3c006689945599589a90036923b1752754f Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0316: filetype: some sh and confini files not recognizedChristian Clason2024-04-14
| | | | | | | | | | | | | | | | | Problem: filetype: some sh and confini files not recognized Solution: Detect neofetch, '.xprofile', XDG-User-Dirs files, paru and makepkg config files (Wu, Zhenyu) See: - https://github.com/dylanaraps/neofetch/wiki/Customizing-Info#config-file-location - https://www.freedesktop.org/wiki/Software/xdg-user-dirs/ closes: vim/vim#14505 https://github.com/vim/vim/commit/5a9f7e6750727f81d0638e7ce0ee6bcb01742570 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0315: filetype: a few more dosini files are not recognizedChristian Clason2024-04-14
| | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: a few more dosini files are not recognized Solution: Detect wakatime, reply config files, flatpak, nfs config files and a few more python tools as dosini (or toml) (Wu, Zhenyu) Refer: - https://packaging.python.org/en/latest/specifications/pypirc/ - https://jorisroovers.com/gitlint/latest/configuration/ - https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#command-line-options - https://docs.bpython-interpreter.org/en/latest/configuration.html - https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file - https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file - https://github.com/wakatime/wakatime-cli?tab=readme-ov-file#usage - https://metacpan.org/dist/Reply/view/bin/reply#-cfg-~/.replyrc close: vim/vim#14512 https://github.com/vim/vim/commit/0881329d129866fa49444e7fb6e622e54285a8ff Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* fix(defaults): auto-close terminal for &shell with args (#28276)Jaehwang Jung2024-04-13
| | | | | | | | | Problem: The `:terminal` auto-close logic does not support `&shell` that has arguments, e.g., `/bin/bash -O globstar`. Solution: Join `argv` and match `&shell`. This is not perfect since `&shell` may contain irregular spaces and quotes, but it seems to be good enough.
* vim-patch:9.1.0311: filetype: Some config files are not recognized (#28311)zeertzjq2024-04-13
| | | | | | | | | | | | | | | Problem: Some config files are not recognized Solution: Add some patterns for chktex, ripgreprc and ctags config files. See: https://www.nongnu.org/chktex/ See: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#configuration-file See: https://docs.ctags.io/en/latest/option-file.html#order-of-loading-option-files closes: vim/vim#14506 https://github.com/vim/vim/commit/a1dcd76ce791b5b8bd093765a99b71aa163300a5 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* revert: "feat(health): fold successful healthchecks #22866"dundargoc2024-04-13
| | | | | | | | | This reverts commit 4382d2ed564b80944345785d780cf1b19fb23ba8. The story for this feature was left in an incomplete state. It was never the intention to unilaterally fold all information, only the ones that did not contain relevant information. This feature does more harm than good in its incomplete state.
* vim-patch:9.1.0305: filetype: some history files are not recognized (#28300)zeertzjq2024-04-12
| | | | | | | | | | | Problem: filetype: some history files are not recognized Solution: Add some history patterns to filetype.vim (Wu, Zhenyu) closes: vim/vim#14513 https://github.com/vim/vim/commit/da70feabeab77581e48a7ca9c8d5f950c1c2814e Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0307: filetype: texdoc config files is not recognizedzeertzjq2024-04-12
| | | | | | | | | | | | | | Problem: filetype: texdoc config files is not recognized Solution: Detect 'texdoc.cnf' as conf filetype (Wu, Zhenyu) See: https://github.com/TeX-Live/texdoc/blob/master/texdoc.cnf closes: vim/vim#14507 https://github.com/vim/vim/commit/7fdbd1bb58192650bec067a0f224c1fa971c6782 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0306: filetype: x11vnc config file is not recognizedzeertzjq2024-04-12
| | | | | | | | | | | | | | Problem: filetype: x11vnc config file is not recognized Solution: Detect '.x11vncrc' as conf filetype (Wu, Zhenyu) See: https://linux.die.net/man/1/x11vnc closes: vim/vim#14511 https://github.com/vim/vim/commit/58ce78ad438deefec54fd6206166ca2794cd6efe Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0295: filetype: pip config files are not recognizedzeertzjq2024-04-12
| | | | | | | | | | | | Problem: filetype: pip config files are not recognized Solution: detect pip.conf as dosini filetype (Wu, Zhenyu) closes: vim/vim#14448 https://github.com/vim/vim/commit/d2b95b8446233e0021a8c0cd672f8fae748e3955 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0293: filetype: lxqt config files are not recognizedzeertzjq2024-04-12
| | | | | | | | | | | | | Problem: filetype: lxqt config files are not recognized Solution: Detect {lxqt,screengrab}/*.conf files as dosini, fix failing filetype test for */tex/latex/**.cfg (Wu, Zhenyu) closes: vim/vim#14450 https://github.com/vim/vim/commit/41208884b8c1a73b42ddb6c1e5f008dae6aa0a83 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0292: filetype: XDG mimeapps.list file is not recognizedzeertzjq2024-04-12
| | | | | | | | | | | | | | Problem: filetype: XDG mimeapps.list file is not recognized Solution: Detect mimeapps.list as dosini filetype (Wu, Zhenyu) Refer: https://wiki.archlinux.org/title/XDG_MIME_Applications#Format closes: vim/vim#14451 https://github.com/vim/vim/commit/efd752ec384980135c36b9fb673574e64c270c90 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0291: filetype: libreoffice config files are not recognizedzeertzjq2024-04-12
| | | | | | | | | | | | Problem: filetype: libreoffice config files are not recognized Solution: Detect Libreoffice config fils as xml/dosini (Wu, Zhenyu) closes: vim/vim#14453 https://github.com/vim/vim/commit/73c89bcf79df280b8698f77374afabd9494dc741 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0304: filetype: cgdb config file is not recognized (#28294)zeertzjq2024-04-12
| | | | | | | | | | | Problem: filetype: cgdb config file is not recognized Solution: Detect cgdbrc files as cgdbrc filetype (Wu, Zhenyu) closes: vim/vim#14458 https://github.com/vim/vim/commit/1492fe69037586b6c625d42205d77dd38ba51640 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>