aboutsummaryrefslogtreecommitdiff
path: root/runtime
Commit message (Collapse)AuthorAge
...
| * 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.
| * vim-patch:f416a22: runtime(systemd): small fixes to &keywordprg in ftpluginChristian Clason2024-10-03
| | | | | | | | | | | | | | | | closes: vim/vim#15784 https://github.com/vim/vim/commit/f416a2220fbd457c3d3389fb0be59bee534a7491 Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
| * 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>
| * vim-patch:baee844: runtime(doc): add `usr` tag to usr_toc.txt (#30617)zeertzjq2024-10-01
| | | | | | | | | | | | | | | | | | | | | | When typing `:h usr` it redirects to usr_01.txt, but I'd argue usr_toc.txt is more useful as you can see an overview of all manuals. When I usr `:h usr` I personally always intend to go to `usr_toc`. closes: vim/vim#15779 https://github.com/vim/vim/commit/baee8448d1dc803d01ed61beff2a135827b1b8e3 Co-authored-by: dundargoc <gocdundar@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:85f054a: runtime(java): Recognise the CommonMark form (///) of ↵Christian Clason2024-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Javadoc comments Complement "g:java_ignore_javadoc" with "g:java_ignore_html" and "g:java_ignore_markdown" to allow selectively disabling the recognition of HTML and CommonMark respectively. (Note that this is not a preview feature.) ======================== LIMITATION ======================== According to the syntactical details of JEP 467: > Any leading whitespace and the three initial / characters > are removed from each line. > > The lines are shifted left, by removing leading whitespace > characters, until the non-blank line with the least > leading whitespace has no remaining leading whitespace. > > Additional leading whitespace and any trailing whitespace > in each line is preserved, because it may be significant. the following example: ------------------------------------------------------------ /// A summary sentence. /// A list: /// - Item A. /// - Item B. /// /// Some code span, starting here ` /// 1 + 2 ` and ending at the previous \`. ------------------------------------------------------------ should be interpreted as if it were written thus: ------------------------------------------------------------ ///A summary sentence. /// A list: /// - Item A. /// - Item B. /// /// Some code span, starting here ` /// 1 + 2 ` and ending at the previous \`. ------------------------------------------------------------ Since automatic line rewriting will not be pursued, parts of such comments having significant whitespace may be ‘wrongly’ highlighted. For convenience, a &fex function is defined to ‘correct’ it: g:javaformat#RemoveCommonMarkdownWhitespace() (:help ft-java-plugin). References: https://openjdk.org/jeps/467 https://spec.commonmark.org/0.31.2 closes: vim/vim#15740 https://github.com/vim/vim/commit/85f054aa3f0fb9530712d0897e3c8ba29946fad4 Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com> Co-authored-by: Tim Pope <code@tpope.net>
| * 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.
| * vim-patch:6db3fc5: runtime(doc): reformat gnat example (#30575)zeertzjq2024-09-29
| | | | | | | | | | | | | | closes: vim/vim#15758 https://github.com/vim/vim/commit/6db3fc5632c877062d759356c025fe06e9dc3630 Co-authored-by: hokorobi <hokorobi.hokorobi@gmail.com>
| * vim-patch:ee20fc8: runtime(indent): allow matching negative numbers for gnu ↵Christian Clason2024-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | indent config file Some gnu indent options take negative numbers (e.g. --indent-label). Add matching for an optional single '-' before the number. closes: vim/vim#15754 https://github.com/vim/vim/commit/ee20fc8062b43eb8e52014978ed8f200158a7efd Co-authored-by: John M Devin <john.m.devin@gmail.com>
| * 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>
| * vim-patch:c3989f1: runtime(doc): reformat ada_standard_types sectionzeertzjq2024-09-29
| | | | | | | | | | | | | | | | closes: vim/vim#15759 https://github.com/vim/vim/commit/c3989f184d4dd1ee817c06bb3c04d5471382dd04 Co-authored-by: hokorobi <hokorobi.hokorobi@gmail.com>
| * vim-patch:998f018: runtime(doc): include short form for :earlier/:laterzeertzjq2024-09-29
| | | | | | | | | | | | | | | | fixes: vim/vim#15757 https://github.com/vim/vim/commit/998f018df37088455bd68ad79da3d16bc4ad9bbe Co-authored-by: Christian Brabandt <cb@256bit.org>
| * 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
| |
| * feat(defaults): pretty :help headings #30544Justin M. Keyes2024-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Headings in :help do not stand out visually. Solution: Define a non-standard `@markup.heading.1.delimiter` group and special-case it in `highlight_group.c`. FUTURE: This is a cheap workaround until we have #25718 which will enable: - fully driven by `vimdoc/highlights.scm` instead of using highlight tricks (`guibg=bg guifg=bg guisp=fg`) - better support of "cterm" ('notermguicolors')
| * vim-patch:9.1.0744: filetype: notmuch configs are not recognised (#30535)zeertzjq2024-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: notmuch configs are not recognised Solution: Detect more notmuch profile configuration files as dosini filetype (Julio B) Reference: https://notmuchmail.org/doc/latest/man1/notmuch-config.html#configuration closes: vim/vim#15744 https://github.com/vim/vim/commit/1a2870b57aa832500d59c17c8225a64c2b4aa619 Co-authored-by: Julio B <julio.bacel@gmail.com>
| * fix(treesitter): EditQuery shows swapfile ATTENTION #30536Justin M. Keyes2024-09-27
| | | | | | | | | | | | | | | | Problem: EditQuery shows swapfile ATTENTION, but this buffer is not intended for preservation (and the dialog breaks the UX). Solution: Set 'noswapfile' on the buffer before renaming it.
| * vim-patch:2c41dad: runtime(doc): Fix typo in :help :command-modifierszeertzjq2024-09-27
| | | | | | | | | | | | | | | | closes: vim/vim#15734 https://github.com/vim/vim/commit/2c41dad3873e71cdd4076907cf35e985d0d7a0d1 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * vim-patch:d9af78b: runtime(docs): update `:set?` command behavior tablezeertzjq2024-09-27
| | | | | | | | | | | | | | | | closes: vim/vim#15746 https://github.com/vim/vim/commit/d9af78b9450362847b344f8dc0f68d015b428d03 Co-authored-by: Milly <milly.ca@gmail.com>
| * feat(health): highlight headings #30525Justin M. Keyes2024-09-26
| | | | | | | | | | | | | | | | | | | | Problem: checkhealth report sections are not visually separated. Solution: Highlight with "reverse". TODO: migrate checkhealth filetype to use treesitter. TODO: default :help should also highlight headings more boldy!
| * vim-patch:9.1.0741: No way to get prompt for input()/confirm()zeertzjq2024-09-26
| | | | | | | | | | | | | | | | | | | | | | | | Problem: No way to get prompt for input()/confirm() Solution: add getcmdprompt() function (Shougo Matsushita) (Shougo Matsushita) closes: vim/vim#15667 https://github.com/vim/vim/commit/6908428560a0d6ae27bf7af6fcb6dc362e31926c Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
| * perf(treesitter): use `child_containing_descendant()` in `is_ancestor()`Riley Bruins2024-09-25
| | | | | | | | | | | | | | | | **Problem:** `is_ancestor()` uses a slow, bottom-up parent lookup which has performance pitfalls detailed in #28512. **Solution:** Take `is_ancestor()` from $O(n^2)$ to $O(n)$ by incorporating the use of the `child_containing_descendant()` function
| * fix(diagnostic): correct `severity` type on `setqflist`, `setloclist` (#30506)Nathan Smith2024-09-25
| | | | | | fix(diagnostic): correct severity type on setqflist, setloclist
| * refactor(lua): vim.keymap.set tests, docs #30511Justin M. Keyes2024-09-25
| |
| * docs: render @see, @note items in _meta/api.lua #30494Justin M. Keyes2024-09-25
| |
| * docs: lua error patterns #30240Justin M. Keyes2024-09-24
| | | | | | | | Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net> Co-authored-by: Ananth Bhaskararaman <antsub@gmail.com>
| * vim-patch:a7229c8: runtime(rmd,rrst): 'fex' option not properly restoredChristian Clason2024-09-24
| | | | | | | | | | | | | | | | | | | | Add 'fex' to b:undo_ftplugin variable closes: vim/vim#15728 https://github.com/vim/vim/commit/a7229c8a99129608e9d651441cca6e6d3079ef56 Co-authored-by: John M Devin <john.m.devin@gmail.com>
| * feat(paste): unify cancel and error behavior (#30476)zeertzjq2024-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this PR, the behavior of nvim_paste is: - When vim.paste() returns false, return false to the client, but treat following chunks normally (i.e. rely on the client cancelling the paste as expected). - When vim.paste() throws an error, still return true to the client, but drain the following chunks in the stream without calling vim.paste(). There are two problems with such behavior: - When vim.paste() errors, the client is still supposed to send the remaining chunks of the stream, even though they do nothing. - Having different code paths for two uncommon but similar situations complicates maintenance. This PR makes both the cancel case and the error case return false to the client and drain the remaining chunks of the stream, which, apart from sharing the same code path, is beneficial whether the client checks the return value of nvim_paste or not: - If the client checks the return value, it can avoid sending the following chunks needlessly after an error. - If the client doesn't check the return value, chunks following a cancelled chunk won't be pasted on the server regardless, which leads to less confusing behavior.
| * fix(filetype): handle .in files with no filename (#30487)Tristan Knight2024-09-24
| | | | | | | | | | | | | | | | | | Problem: fnamemodify with the :r flag will not strip extensions if the filename starts with a ".". This means that files named ".in" could cause an infinite loop. Solution: Add early return if the filename was not changed
| * Merge #30435 refactor: rename "Dictionary" => "Dict"Justin M. Keyes2024-09-23
| |\
| | * refactor(api)!: rename Dictionary => DictJustin M. Keyes2024-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the api_info() output: :new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val') ... {'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1} The `ArrayOf(Integer, 2)` return type didn't break clients when we added it, which is evidence that clients don't use the `return_type` field, thus renaming Dictionary => Dict in api_info() is not (in practice) a breaking change.
| * | fix(vim.fs): dirname() returns "." on mingw/msys2 #30480Justin M. Keyes2024-09-23
| |/ | | | | | | | | | | | | | | | | | | Problem: `vim.fs.dirname([[C:\User\XXX\AppData\Local]])` returns "." on mingw/msys2. Solution: - Check for "mingw" when deciding `iswin`. - Use `has("win32")` where possible, it works in "fast" contexts since b02eeb6a7281df0561a021d7ae595c84be9a01be.
| * fix(runtime): treat b:undo_ftplugin consistently in Lua ftplugins (#30473)zeertzjq2024-09-23
| | | | | | | | - Don't assume b:undo_ftplugin is set when first modifying it. - Don't assume b:undo_ftplugin already contains some resetting.
| * vim-patch:be551da: runtime(netrw): remove extraneous closing bracketChristian Clason2024-09-23
| | | | | | | | | | | | | | | | | | fixes: vim/vim#15717 closes: vim/vim#15718 https://github.com/vim/vim/commit/be551dacb87a0542afd8b5c17b89e6749f2dc355 Co-authored-by: Peter Aronoff <peter@aronoff.org>
| * feat(fs.lua): add vim.fs.rm()Lewis Russell2024-09-22
| | | | | | | | Analogous to the shell `rm` command.
| * docs(api): nvim_get_runtime_file preserves 'runtimepath' order #30454Evgeni Chasnovski2024-09-22
| |
| * vim-patch:a0c14ef: runtime(filetype): tests: Test_filetype_detection() failszeertzjq2024-09-21
| | | | | | | | | | | | | | | | | | Problem: tests: Test_filetype_detection() fails (after 9.1.0738) Solution: Add missing filetype detect patterns for *.SYSx and *.MODx https://github.com/vim/vim/commit/a0c14ef310acac62276b4ee51930d3246b11772e Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:9.1.0738: filetype: rapid files are not recognizedzeertzjq2024-09-21
| | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: rapid files are not recognized Solution: detect '*.sysx' and '*.modx' as rapid filetype (KnoP-01) closes: vim/vim#15669 https://github.com/vim/vim/commit/fdcb08264d6e8525a07b29c14863adc6ead83913 Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>