aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* Merge #22736 from justinmk/gsplitJustin M. Keyes2023-03-22
|\ | | | | feat(vim.gsplit): gain features of vim.split
| * refactor(vim.gsplit): remove "keepsep"Justin M. Keyes2023-03-22
| | | | | | | | string.gmatch() is superior, use that instead.
| * fix(vim.version): prerelease compareJustin M. Keyes2023-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: semver specifies that digit sequences in a prerelease string should be compared as numbers, not lexically: https://semver.org/#spec-item-11 > Precedence for two pre-release versions with the same major, minor, > and patch version MUST be determined by comparing each dot separated > identifier from left to right until a difference is found as follows: > 1. Identifiers consisting of only digits are compared numerically. > 2. Identifiers with letters or hyphens are compared lexically in ASCII sort order. > 3. Numeric identifiers always have lower precedence than non-numeric identifiers. > 4. A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal. Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0. Solution: cmp_prerel() treats all digit sequences in a prerelease string as numbers. This doesn't _exactly_ match the spec, which specifies that only dot-delimited digit sequences should be treated as numbers...
| * feat(vim.gsplit): gain features of vim.splitJustin M. Keyes2023-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - vim.split has more features than vim.gsplit. - Cannot inspect the "separator" segments of vim.split or vim.gsplit. Solution: - Move common implementation from vim.split into vim.gsplit. - TODO: deprecate vim.split in favor of vim.totable(vim.gsplit())? - Introduce `keepsep` parameter. Related: 84f66909e4008a57da947f1640bfc24da5e41a72
* | fix(api): vim.filetype.get_option() (#22753)Lewis Russell2023-03-22
|/ | | | - Fix a bug in the cache - Set some buffer options on the dummy buffer
* vim-patch:9.0.{1419,1421,1422,1423}: some files are not recognized (#22749)Amaan Qureshi2023-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:9.0.1419: Lean files are not recognized Problem: Lean files are not recognized. Solution: Add a pattern for Lean files. (Amaan Qureshi, closes vim/vim#12177) https://github.com/vim/vim/commit/4a5c39fc52a73d46ac77cf574f765a465befc3c0 vim-patch:9.0.1421: Nu files are not recognized Problem: Nu files are not recognized. Solution: Add a pattern for Nu files. (Amaan Qureshi, closes vim/vim#12172) https://github.com/vim/vim/commit/8aa2a37f8983a7863afa32d9ffbe64b2f2bc70be vim-patch:9.0.1422: Sage files are not recognized Problem: Sage files are not recognized. Solution: Add a pattern for Sage files. (Amaan Qureshi, closes vim/vim#12176) https://github.com/vim/vim/commit/d0639d717ba7cf8b04b588aadd0b379ed43a5f1f vim-patch:9.0.1423: WebAssembly Interface Type files are not recognized Problem: WebAssembly Interface Type files are not recognized. Solution: Add a pattern for WIT files. (Amaan Qureshi, closes vim/vim#12173) https://github.com/vim/vim/commit/890c77203637626b1005db818667084d11e653e7
* vim-patch:9.0.1417: ESDL files are not recognizedChristian Clason2023-03-20
| | | | | | | | | Problem: ESDL files are not recognized. Solution: Add a pattern for ESDL files. (Amaan Qureshi, closes vim/vim#12174) https://github.com/vim/vim/commit/a1fa8b3ac2f7b54c7901ad3eb0ba8b8290912509 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
* vim-patch:9.0.1415: Crystal files are not recognizedChristian Clason2023-03-20
| | | | | | | | | Problem: Crystal files are not recognized. Solution: Add a pattern for Crystal files. (Amaan Qureshi, closes vim/vim#12175) https://github.com/vim/vim/commit/7c4516fe93d865f4ef1877181f8156b8b9331856 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
* feat(vim.version): more coercion with strict=falseJustin M. Keyes2023-03-20
| | | | | | | | | | | | | Problem: "tmux 3.2a" (output from "tmux -V") is not parsed easily. Solution: With `strict=false`, discard everything before the first digit. - rename Semver => Version - rename vim.version.version() => vim.version._version() - rename matches() => has() - remove `opts` from cmp()
* refactor(vim.version): use lazy.nvim semver moduleJustin M. Keyes2023-03-20
| | | | | Now the Nvim version string "v0.9.0-dev-1233+g210120dde81e" parses correctly.
* refactor(vim.version): use lazy.nvim semver moduleJustin M. Keyes2023-03-20
| | | | | | | Use semver code from https://github.com/folke/lazy.nvim License: Apache License 2.0 Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
* feat: add `vim.filetype.get_option()`Lewis Russell2023-03-20
|
* vim-patch:9.0.1412: Pony files are not recognized (#22721)Amaan Qureshi2023-03-18
| | | | | | Problem: Pony files are not recognized. Solution: Add a pattern for Pony files. (Amaan Qureshi, closes vim/vim#12155) https://github.com/vim/vim/commit/6e377eca8de4c0c0d25808beb7de7676194ebf1d
* Merge pull request #22699 from clason/vim-9.0.1406Christian Clason2023-03-17
|\ | | | | vim-patch:9.0.{1406,1407,1408,1409}: some files are not recognized
| * vim-patch:9.0.1409: racket files are recognized as schemeChristian Clason2023-03-17
| | | | | | | | | | | | | | | | | | | | Problem: Racket files are recognized as scheme. Solution: Recognize rackets files separately. (Gabriel Kakizaki, closes vim/vim#12164, closes vim/vim#12162) https://github.com/vim/vim/commit/d11ac403db07b6eac43882485e98caeb5e83e2e5 Co-authored-by: Gabriel Kakizaki <gkakizaki@gmail.com>
| * vim-patch:9.0.1408: QMLdir files are not recognizedChristian Clason2023-03-17
| | | | | | | | | | | | | | | | | | Problem: QMLdir files are not recognized. Solution: Add a pattern for QMLdir files. (Amaan Qureshi, closes vim/vim#12161) https://github.com/vim/vim/commit/1505bef5c482a48e704644e6172be91c07ef1d12 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
| * vim-patch:9.0.1407: TableGen files are not recognizedChristian Clason2023-03-17
| | | | | | | | | | | | | | | | | | Problem: TableGen files are not recognized. Solution: Add a pattern for TableGen files. (Amaan Qureshi, closes vim/vim#12156) https://github.com/vim/vim/commit/b8ef029ee416fc2b402c3f321a55c9049b0ad2a9 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
| * vim-patch:9.0.1406: ILE RPG files are not recognizedChristian Clason2023-03-17
| | | | | | | | | | | | | | | | | | Problem: ILE RPG files are not recognized. Solution: Add patterns for ILE RPG files. (Andreas Louv, issue vim/vim#12152) https://github.com/vim/vim/commit/e202ec8a0c89e8ef47a3d38e668b7326fa68510a Co-authored-by: Andreas Louv <andreas@louv.dk>
* | fix(treesitter): InspectTree does not respect 'splitright' #22692Yochem van Rosmalen2023-03-17
| | | | | | | | | | | | | | | | | | | | Problem: vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'. Solution: - Change the default `command` from `topleft 60vnew` to `60vnew`. - Change :InspectTree to respect command mods (`:vertical`, count, etc.). Closes #22656
* | fix(lsp): avoid switching buffers on lsp attach (#22689)August Masquelier2023-03-17
|/
* fix(lua): vim.deprecate() shows ":help deprecated" #22677Justin M. Keyes2023-03-15
| | | | | | | | | | | Problem: vim.deprecate() shows ":help deprecated" for third-party plugins. ":help deprecated" only describes deprecations in Nvim, and is unrelated to any 3rd party deprecations. Solution: If `plugin` is specified, don't show ":help deprecated". fix #22235
* fix(lsp): kill buffers after renaming a directory #22618Ivan2023-03-14
| | | | | | | | | | | | | | | Problem: When LSP client renames a directory, opened buffers in the edfitor are not renamed or closed. Then `:wall` shows errors. https://github.com/neovim/neovim/blob/master/runtime/lua/vim/lsp/util.lua#L776 works correctly if you try to rename a single file, but doesn't delete old buffers with `old_fname` is a dir. Solution: Update the logic in runtime/lua/vim/lsp/util.lua:rename() Fixes #22617
* fix(lsp): vim.lsp.util.apply_text_edits cursor validation #22636hrsh7th2023-03-14
| | | | | | | | Problem Using wrong variable when checking the cursor position is valid or not in vim.lsp.util.apply_text_edits. Solution Use the correct variable.
* fix(lsp): remove_workspace_folders fails if client has no workspace_folders ↵Dan Strokirk2023-03-13
| | | | | | #22633 When a client has no workspace_folders, (e.g., copilot), `pairs` code would crash.
* Merge pull request #22627 from nullchilly/highlight-cleanupChristian Clason2023-03-13
|\ | | | | refactor!: remove deprecated functions
| * refactor(treesitter)!: remove deprecated show_tree funcnullchilly2023-03-11
| |
| * refactor(highlight)!: remove deprecated functionsnullchilly2023-03-11
| | | | | | | | vim.highlight.create/link
* | fix(treesitter): foldexpr (#22652)Lewis Russell2023-03-13
| | | | | | The ranges passed to foldinfo.remove_range were in the wrong order.
* | refactor!: rename vim.pretty_print => vim.printJustin M. Keyes2023-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The function name `vim.pretty_print`: 1. is verbose, which partially defeats its purpose as sugar 2. does not draw from existing precedent or any sort of convention (except external projects like penlight or python?), which reduces discoverability, and degrades signaling about best practices. Solution: - Rename to `vim.print`. - Change the behavior so that 1. strings are printed without quotes 2. each arg is printed on its own line 3. tables are indented with 2 instead of 4 spaces - Example: :lua ='a', 'b', 42, {a=3} a b 42 { a = 3 } Comparison of alternatives: - `vim.print`: - pro: consistent with Lua's `print()` - pro: aligns with potential `nvim_print` API function which will replace nvim_echo, nvim_notify, etc. - con: behaves differently than Lua's `print()`, slightly misleading? - `vim.echo`: - pro: `:echo` has similar "pretty print" behavior. - con: inconsistent with Lua idioms. - `vim.p`: - pro: very short, fits with `vim.o`, etc. - con: not as discoverable as "echo" - con: less opportunity for `local p = vim.p` because of potential shadowing.
* | fix(lsp): use line start/end for visual line selection (#22632)Mathias Fußenegger2023-03-12
| | | | | | Fixes https://github.com/neovim/neovim/issues/22629
* | Merge pull request #22613 from lewis6991/feat/tsqueryutilLewis Russell2023-03-11
|\ \
| * | refactor(treesitter): add Range type aliase for Range4|Range6Lewis Russell2023-03-11
| | |
| * | feat(treesitter)!: consolidate query util functionsLewis Russell2023-03-10
| | | | | | | | | | | | | | | | | | - And address more type errors. - Removed the `concat` option from `get_node_text` since it was applied inconsistently and made typing awkward.
* | | docs(lsp): more precise type annotations (#22621)Jaehwang Jung2023-03-11
| | |
* | | fix(lsp): send didClose on buffer rename (#22623)Mathias Fußenegger2023-03-11
| | | | | | | | | | | | | | | | | | | | | Subset of https://github.com/neovim/neovim/pull/22407 that was reverted in https://github.com/neovim/neovim/pull/22604 If a buffer is renamed sending `didClose` for the old buffer helps ensure the language server doesn't keep a stale document in memory.
* | | refactor(lsp): remove _resolve_capabilities_compat (#22628)Raphael2023-03-11
| |/ |/|
* | revert: "fix(lsp): use buffer scheme for files not stored on disk" (#22604)Mathias Fußenegger2023-03-11
| | | | | | | | | | | | | | | | | | | | | | Although using `buffer://` for unsaved file buffers fixes issues with language servers like eclipse.jdt.ls or ansible-language-server, it breaks completion and signature help for clangd. A regression is worse than a fix for something else, so this reverts commit 896d672736b32a8f4a4fa51844b44f266dcdcc6c. The spec change is also still in dicussion, see https://github.com/microsoft/language-server-protocol/pull/1679#discussion_r1130704886
* | feat!(treesitter): do not return changes from LanguageTree:parse() Lewis Russell2023-03-10
|/ | | | | | | | | Never return the changes an only notify them using the `on_changedtree` callback. It is not guaranteed for a plugin that it'll be the first one to call `tree:parse()` and thus get the changes. Closes #19915
* Merge pull request #22594 from lewis6991/perf/treefoldLewis Russell2023-03-10
|\
| * perf(treesitter): more efficient foldexprLewis Russell2023-03-10
| |
| * fix(treesitter): better lang handling of get_parser()Lewis Russell2023-03-10
| |
| * fix(treesitter): do not error on empty filetypeLewis Russell2023-03-10
| | | | | | | | Ignore instead
* | perf(lsp): better binary search mid calculation in semantic token (#22607)Null Chilly2023-03-10
|/ | | This commit replaces the usage of math.floor((lo + hi) / 2) with the faster and equivalent bit.rshift(lo + hi, 1) for calculating the midpoint in binary search.
* docs(lsp): type annotation for lsp.client (#22509)Jaehwang Jung2023-03-09
| | | | | | * Also fix newly found type mismatch. * Note that it generates new warnings about using @private client methods. A proper fix would be to revamp the lsp client documentation altogether.
* vim-patch:9.0.1393: Cairo files are not recognized (#22578)Amaan Qureshi2023-03-09
| | | | | | Problem: Cairo files are not recognized. Solution: Add a pattern for Cairo files. (Amaan Qureshi, closes vim/vim#12118) https://github.com/vim/vim/commit/ff226d49fed2d8fc668084324c7b0f00117c5e74
* refactor(treesitter): use byte ranges from treesitter (#22589)Lewis Russell2023-03-09
|
* feat(lsp): overwrite omnifunc/tagfunc set by ftplugin #22267Michal Liszcz2023-03-09
| | | | | | | | | | | | | | | | | Problem: Some built-in ftplugins set omnifunc/tagfunc/formatexpr which causes lsp.lua:set_defaults() to skip setup of defaults for those filetypes. For example the C++ ftplugin has: omnifunc=ccomplete#Complete Last set from /usr/share/nvim/runtime/ftplugin/c.vim line 30 so the changes done in #95c65a6b221fe6e1cf91e8322e7d7571dc511a71 will always be skipped for C++ files. Solution: Overwrite omnifunc/tagfunc/formatexpr options that were set by stock ftplugin. Fixes #21001
* fix(treesitter): is_in_node_range (#22582)Lewis Russell2023-03-08
| | | | TS ranges are end column exclusive, so fix is_in_node_range to account for that.
* vim-patch:9.0.1395: Odin files are not recognized (#22580)Amaan Qureshi2023-03-09
| | | | | | Problem: Odin files are not recognized. Solution: Add a pattern for Odin files. (Amaan Qureshi, closes vim/vim#12122) https://github.com/vim/vim/commit/638388b8ef37684e36a7f5d9286bab2d31c28f36
* vim-patch:9.0.1394: Unx Tal files are not recognized (#22579)Amaan Qureshi2023-03-09
| | | | | | Problem: Unx Tal files are not recognized. Solution: Add a pattern for Unx Tal files. (Amaan Qureshi, closes vim/vim#12117) https://github.com/vim/vim/commit/cde1f8714ed2c046aa770c46229e781380122bd7