aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
| * vim-patch:9.1.0778: filetype: lf config files are not recognizedChristian Clason2024-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: lf config files are not recognized Solution: detect lfrc files as lf filetype, include a syntax script for lf files (Andis Spriņķis). References: - https://github.com/gokcehan/lf closes: vim/vim#15859 https://github.com/vim/vim/commit/0f146b7925178a5bdfdc8e07642976f0b76d9612 Co-authored-by: Andis Spriņķis <spr.andis@protonmail.com>
| * docs: update autotrigger description of vim.lsp.compleiton.BufferOpts (#30796)glepnir2024-10-13
| | | | | | Currently the behavior of autotrigger is not well documented.
| * vim-patch:9.1.0777: filetype: Some upstream php files are not recognizedChristian Clason2024-10-13
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: Some upstream php files are not recognized Solution: Detect more config files from the PHP source distribution as filetype ini (nisbet-hubbard). closes: vim/vim#15840 https://github.com/vim/vim/commit/367499c5c39057bca267716d9aad20554d4d83fd Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
| * docs(lua): clarify when on_key "typed" will be empty (#30774)zeertzjq2024-10-12
| |
| * fix(lua): avoid recursive vim.on_key() callback (#30753)zeertzjq2024-10-12
| |
| * feat(defaults): map gri to vim.lsp.buf.implementation() (#30764)Gregory Anders2024-10-11
| | | | | | | | Continuing the default LSP maps under the "gr" prefix. Mnemonic: "i" for "implementation".
| * fix(treesitter): remove duplicate symbol names in language.inspect()Riley Bruins2024-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Problems:** - `vim.treesitter.language.inspect()` returns duplicate symbol names, sometimes up to 6 of one kind in the case of `markdown` - The list-like `symbols` table can have holes and is thus not even a valid msgpack table anyway, mentioned in a test **Solution:** Return symbols as a map, rather than a list, where field names are the names of the symbol. The boolean value associated with the field encodes whether or not the symbol is named. Note that anonymous nodes are surrounded with double quotes (`"`) to prevent potential collisions with named counterparts that have the same identifier.
| * feat(treesitter): introduce child_with_descendant()Riley Bruins2024-10-11
| | | | | | | | | | | | This commit also marks `child_containing_descendant()` as deprecated (per upstream's documentation), and uses `child_with_descendant()` in its place. Minimum required tree-sitter version will now be `0.24`.
| * fix(lsp): set 'smoothscroll' in docs hover #30748Justin M. Keyes2024-10-11
| |
| * vim-patch:9.1.0773: filetype: some Apache files are not recognizedChristian Clason2024-10-11
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: some Apache files are not recognized Solution: Detect more config files from the Apache source distribution as filetype apache (nisbet-hubbard) closes: vim/vim#15810 https://github.com/vim/vim/commit/e58e9015cc431b79d88af4daec838519a8e296d6 Co-authored-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
| * vim-patch:9.1.0774: "shellcmdline" doesn't work with getcompletion() (#30750)zeertzjq2024-10-10
| | | | | | | | | | | | | | | | Problem: "shellcmdline" doesn't work with getcompletion(). Solution: Use set_context_for_wildcard_arg() (zeertzjq). closes: vim/vim#15834 https://github.com/vim/vim/commit/85f36d61e09b12d6f1c60201129823371daa4a84
| * fix(lsp): fix cursor position after snippet expansion (#30659)Tomasz N2024-10-10
| | | | | | | | | | | | | | | | | | | | | | | | Problem: on `CompleteDone` cursor can jump to the end of line instead of the end of the completed word. Solution: remove only inserted word for snippet expansion instead of everything until eol. Fixes #30656 Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
| * vim-patch:9.1.0771: completion attribute hl_group is confusingzeertzjq2024-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Currently completion attribute hl_group is combined with all items, which is redundant and confusing with kind_hlgroup Solution: Renamed to abbr_hlgroup and combine it only with the abbr item (glepnir). closes: vim/vim#15818 https://github.com/vim/vim/commit/0fe17f8ffbd2588ecd2bf42dced556897bc64f89 Co-authored-by: glepnir <glephunter@gmail.com>
| * docs(lua): "vim.bo" is always equivalent to :setlocal (#30733)zeertzjq2024-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim.bo :lua vim.bo.textwidth = 80 :setglobal textwidth? textwidth=0 :setlocal :setlocal textwidth=80 :setglobal textwidth? textwidth=0 :set :set textwidth=80 :setglobal textwidth? textwidth=80
| * vim-patch:9.1.0769: filetype: MLIR files are not recognizedChristian Clason2024-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: MLIR files are not recognized Solution: Detect '*.mlir' files as mlir filetype, include a mlir filetype plugin (Wu, Zhenyu) closes: vim/vim#15826 https://github.com/vim/vim/commit/347d43bd33519ab537f77d1a8fa8ab8f9196bcb9 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
| * vim-patch:9.1.0770: current command line completion is a bit limited (#30728)zeertzjq2024-10-09
| | | | | | | | | | | | | | | | | | | | | | Problem: current command completion is a bit limited Solution: Add the shellcmdline completion type and getmdcomplpat() function (Ruslan Russkikh). closes: vim/vim#15823 https://github.com/vim/vim/commit/0407d621bbad020b840ffbbbd25ba023bbc05edd Co-authored-by: Ruslan Russkikh <dvrussk@yandex.ru>
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-19
|\|
| * docs: dev-arch, focusable windows #30510Justin M. Keyes2024-10-07
| | | | | | | | - 'statuscolumn' is no longer experimental - add tags for popular searches on neovim.io
| * fix(lsp): tagfunc fails in unusual buffer #30700Justin M. Keyes2024-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: tagfunc failed in a weird buffer (either a directory or some other non-file buffer, I don't remember): E987: Invalid return value from tagfunc E5108: Error executing lua …/runtime/lua/vim/lsp/util.lua:311: EISDIR: illegal operation on a directory stack traceback: at this line: local data = assert(uv.fs_read(fd, stat.size, 0)) Solution: Check for directory.
| * docs: generate params/returns in builtin.txt #30654Justin M. Keyes2024-10-07
| |
| * vim-patch:9.1.0762: 'cedit', 'termwinkey' and 'wildchar' may not be parsed ↵zeertzjq2024-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | correctly (#30704) Problem: 'cedit', 'termwinkey' and 'wildchar' may not be parsed correctly Solution: improve string_to_key() function in option.c (Milly) - Problem: `^@` raises an error. Solution: Store as `<Nul>`. - Problem: `<t_xx` does not raise an error. Solution: Raise an error if closing `>` is missing. - Problem: Single `<` or `^` raises an error. It is inconvenient for users. Solution: They are stored as a single character. closes: vim/vim#15811 https://github.com/vim/vim/commit/a9c6f90918d0012d1b8c8c5c1dccb77407f553fb Co-authored-by: Milly <milly.ca@gmail.com>
| * vim-patch:fd4e47e: runtime(doc): clarify the effect of 'startofline' option ↵zeertzjq2024-10-07
| | | | | | | | | | | | | | | | | | (#30701) fixes: vim/vim#15794 https://github.com/vim/vim/commit/fd4e47e06b77fa26cb38f057aba950449e1f47f6 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * feat(lsp): improve LSP doc hover rendering #30695Justin M. Keyes2024-10-06
| | | | | | | | | | | | | | | | | | | | | | | | Problem: - Some servers like LuaLS add unwanted blank lines after multiline `@param` description. - List items do not wrap nicely. Solution: - When rendering the LSP doc hover, remove blank lines in each `@param` or `@return`. - But ensure exactly one empty line before each. - Set 'breakindent'.
| * feat(docs): improve `@see` meta docstrings #30693Justin M. Keyes2024-10-06
| |
| * fix(runtime): fully port emoji_list to LuaChristian Clason2024-10-06
| | | | | | | | | | | | | | Problem: `runtime/tools/emoji_list.vim` is a Lua script masquerading as Vimscript, which is unnecessary now that `:source` works for Lua files. Solution: Remove Vimscript wrapper.
| * fix(docs): markdown instead of vimdoc in meta docstrings #30680Justin M. Keyes2024-10-06
| | | | | | | | | | LuaLS/meta docstrings expect markdown, not vimdoc. This matters for lists, codeblocks, etc. Also, line length doesn't matter for docstrings.
| * fix(docs): missing `@returns` desc in _meta/api.lua #30673Justin M. Keyes2024-10-05
| |
| * fix(defaults): use "range" instead of "count" for some mappings (#30642)Gregory Anders2024-10-04
| | | | | | | | | | | | | | Some commands don't accept "count" and only work with "range". It's not clear why. The issue is tracked at [1], but this is a workaround for now. [1]: https://github.com/neovim/neovim/issues/30641
| * docs: more `@since` annotations #30660Justin M. Keyes2024-10-04
| |
| * feat(lua): completion for vim.fn, vim.v, vim.o #30472Jongwook Choi2024-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Lua accessors for - global, local, and special variables (`vim.{g,t,w,b,v}.*`), and - options (`vim.{o,bo,wo,opt,opt_local,opt_global}.*`), do not have command-line completion, unlike their vimscript counterparts (e.g., `g:`, `b:`, `:set`, `:setlocal`, `:call <fn>`, etc.). Completion for vimscript functions (`vim.fn.*`) is incomplete and does not list all the available functions. Solution: Implement completion for vimscript function, variable and option accessors in `vim._expand_pat` through: - `getcompletion()` for variable and vimscript function accessors, and - `nvim_get_all_options_info()` for option accessors. Note/Remark: - Short names for options are yet to be implemented. - Completions for accessors with handles (e.g. `vim.b[0]`, `vim.wo[0]`) are also yet to be implemented, and are left as future work, which involves some refactoring of options. - For performance reasons, we may want to introduce caching for completing options, but this is not considered at this time since the number of the available options is not very big (only ~350) and Lua completion for option accessors appears to be pretty fast. - Can we have a more "general" framework for customizing completions? In the future, we may want to improve the implementation by moving the core logic for generating completion candidates to each accessor (or its metatable) or through some central interface, rather than writing all the accessor-specific completion implementations in a single function: `vim._expand_pat`.
| * fix(lsp): enable `additionalPropertiesSupport`Yi Ming2024-10-04
| |
| * docs: render `@since` versions, 0 means experimental #30649Justin M. Keyes2024-10-04
| | | | | | | | | | | | | | | | An implication of this current approach is that `NVIM_API_LEVEL` should be bumped when a new Lua function is added. TODO(future): add a lint check which requires `@since` on all new functions. ref #25416
| * docs(treesitter): generate TSNode, TSTree docs #30643Riley Bruins2024-10-03
| | | | | | | | | | | | | | | | | | | | | | | | **Problem:** The documentation for `TSNode` and `TSTree` methods is incomplete from the LSP perspective. This is because they are written directly to the vimdoc, rather than in Lua and generated to vimdoc. **Solution:** Migrate the docs to Lua and generate them into the vimdoc. This requires breaking up the `treesitter/_meta.lua` file into a directory with a few different modules. This commit also makes the vimdoc generator slightly more robust with regard to sections that have multiple help tags (e.g. `*one* *two*`)
| * docs: improve luacats support #30580James Trew2024-10-03
| | | | | | | | | | | | | | Some composite/compound types even as basic as `(string|number)[]` are not currently supported by the luacats LPEG grammar used by gen_vimdoc. It would be parsed & rendered as just `string|number`. Changeset adds better support for these types.
| * fix(defaults): properly pass count to quickfix commands (#30632)zeertzjq2024-10-03
| |
| * vim-patch:ae62fe5: runtime(doc): 'filetype', 'syntax' and 'keymap' only ↵zeertzjq2024-10-03
| | | | | | | | | | | | | | | | | | allow alphanumeric + some characters (#30630) closes: vim/vim#15783 https://github.com/vim/vim/commit/ae62fe5c289e148b92b1d0bb912dcce7ebe14602 Co-authored-by: Milly <milly.ca@gmail.com>
| * vim-patch:9.1.0754: fixed order of items in insert-mode completion menu (#30619)glepnir2024-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: fixed order of items in insert-mode completion menu Solution: Introduce the 'completeitemalign' option with default value "abbr,kind,menu" (glepnir). Adding an new option `completeitemalign` abbr is `cia` to custom the complete-item order in popupmenu. closes: vim/vim#14006 closes: vim/vim#15760 https://github.com/vim/vim/commit/6a89c94a9eeee53481ced1a1260a177bffde4c0f
| * fix(watch): ignore nonexistent paths (ENOENT)Justin M. Keyes2024-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The `_watch.watch()` strategy may fail if the given path does not exist: …/vim/_watch.lua:101: ENOENT: no such file or directory stack traceback: [C]: in function 'assert' …/vim/_watch.lua:101: in function <…/vim/_watch.lua:61> [string "<nvim>"]:5: in main chunk - `_watch.watch()` actively asserts any error returned by `handle:start()`. - whereas `_watch.watchdirs()` just ignores the result of `root_handle:start()`. Servers may send "client/registerCapability" with "workspace/didChangeWatchedFiles" item(s) (`baseUri`) which do not actually exist on the filesystem: https://github.com/neovim/neovim/issues/28058#issuecomment-2189929424 { method = "client/registerCapability", params = { registrations = { { method = "workspace/didChangeWatchedFiles", registerOptions = { watchers = { { globPattern = { baseUri = "file:///Users/does/not/exist", pattern = "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}" } }, ... } Solution: - Remove the assert in `_watch.watch()`. - Show a once-only message for both cases. - More detailed logging is blocked until we have `nvim_log` / `vim.log`. fix #28058
| * vim-patch:9.1.0752: can set 'cedit' to an invalid value (#30616)zeertzjq2024-10-01
| | | | | | | | | | | | | | | | | | | | | | Problem: can set cedit to an invalid value Solution: Check that the value is a valid key name (Milly) closes: vim/vim#15778 https://github.com/vim/vim/commit/25732435c56d762abb260499680939bd8882c708 Co-authored-by: Milly <milly.ca@gmail.com>
| * fix(treesitter): indent size for inspect_tree #28727Jongwook Choi2024-10-01
| | | | | | | | | | | | | | | | | | | | | | Problem: For :InspectTree, indent size (`&shiftwidth`) for the tree viewer may be incorrect. This is because the tree viewer buffer with the filetype `query` does not explicitly configures the tab size, which can mismatch with the default indent size (2) assumed by TSTreeView's implementation. Solution: Set shiftwidth to be the same as TSTreeViewOpts specifies, which defaults to 2.
| * feat(defaults): add default unimpaired style mappings (#28525)Gregory Anders2024-10-01
| |
| * vim-patch:9.1.0749: filetype: http files not recognizedChristian Clason2024-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: http files not recognized Solution: detect '*.http' as http filetype, include http filetype plugin (Riley Bruins) Based on the specification found [here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md) closes: vim/vim#15762 https://github.com/vim/vim/commit/de6c1d1182076b10212342fd2d441267fbe43a22 Co-authored-by: Riley Bruins <ribru17@hotmail.com>
| * test: refactor exec_lua in xdiff_specLewis Russell2024-09-30
| |
| * fix(diff): use mmfile_t in linematchLewis Russell2024-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Linematch used to use strchr to navigate a string, however strchr does not supoprt embedded NULs. Solution: Use `mmfile_t` instead of `char *` in linematch and introduce `strnchr()`. Also remove heap allocations from `matching_char_iwhite()` Fixes: #30505
| * feat(treesitter)!: use return values in `language.add()`Christian Clason2024-09-29
| | | | | | | | | | | | | | | | | | Problem: No clear way to check whether parsers are available for a given language. Solution: Make `language.add()` return `true` if a parser was successfully added and `nil` otherwise. Use explicit `assert` instead of relying on thrown errors.
| * feat(treesitter)!: add default fallback to `ft_to_lang` lookupsChristian Clason2024-09-29
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Language names are only registered for filetype<->language lookups when parsers are actually loaded; this means users cannot rely on `vim.treesitter.language.get_lang()` or `get_filetypes()` to return the correct value when language and filetype coincide and always need to add explicit fallbacks. Solution: Always return the language name as valid filetype in `get_filetypes()`, and default to the filetype in `get_lang()`. Document this behavior.
| * docs: misc (#30177)dundargoc2024-09-29
| | | | | | | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
| * vim-patch:9.1.0745: filetype: bun and deno history files not recognizedChristian Clason2024-09-29
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: bun and deno history files not recognized Solution: detect '.bun_repl_history' and 'deno_history.txt' as javascript filetype (Wu, Zhenyu) closes: vim/vim#15761 https://github.com/vim/vim/commit/8a2aea8a623ba183dc0703a47970463b105a9399 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
| * fix(treesitter): specify success status in edit_query return valueRiley Bruins2024-09-28
| |
| * fix(treesitter): suppress get_parser warnings via opts.errorRiley Bruins2024-09-28
| |