aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * fix(coverity/497355): shada_read_when_writing out of bounds read #30665Devon Gardner2024-10-05
| | | | | | | | | | | | | | | | | | | | Problem: There appears to be an intentional array out of bounds read when indexing global and numbered marks since they are adjacent in the struct that holds them. Solution: Explicitly index numeric marks array to avoid reading out of bounds from global marks array.
| * vim-patch:60310a4: runtime(java): Manage circularity for every :syn-included ↵Christian Clason2024-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syntax file With "g:markdown_fenced_languages" defined and "java" added to its list, a circular dependency between the Markdown and Java syntax files will be made. To break it, no Markdown documentation comments will be recognised in fenced blocks in Markdown files; in order to view Java source files, "java" must be removed from "g:markdown_fenced_languages", and this task can be automated as follows. 1) Add to "~/.after/ftplugin/java.vim": ------------------------------------------------------------ if exists("g:markdown_fenced_languages") && \ !(exists("g:java_ignore_javadoc") || \ exists("g:java_ignore_markdown")) let s:idx = index(g:markdown_fenced_languages, 'java') if s:idx > -1 call remove(g:markdown_fenced_languages, s:idx) endif unlet s:idx endif ------------------------------------------------------------ 2) Optionally add to "~/.after/ftplugin/markdown.vim": ------------------------------------------------------------ if exists("g:markdown_fenced_languages") && \ index(g:markdown_fenced_languages, 'java') < 0 call add(g:markdown_fenced_languages, 'java') endif ------------------------------------------------------------ (Make sure that the above snippets appear in the files under the "ftplugin" NOT "syntax" directory.) Finally, unless the new version of the syntax file is made available from "$VIMRUNTIME" (and from "~/.vim/syntax" if necessary), OTHER discoverable file versions will be used whose behaviour may interfere with this fix. related: vim/vim#15740 closes: vim/vim#15796 https://github.com/vim/vim/commit/60310a4b2630a4d3bb0b6da9bc03061ecfbac9ee Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
| * vim-patch:9.1.0758: it's possible to set an invalid key to 'wildcharm' (#30662)zeertzjq2024-10-05
| | | | | | | | | | | | | | | | | | | | | | Problem: it's possible to set an invalid key to 'wildcharm' Solution: error out, if the 'wildcharm' value is an invalid key (Milly) closes: vim/vim#15787 https://github.com/vim/vim/commit/40c6babc1789aceb241b23bab76eea16da37e33d Co-authored-by: Milly <milly.ca@gmail.com>
| * 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
| |
| * build(deps): bump tree-sitter to v0.24.1Christian Clason2024-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(mouse): indicate X1 and X2 button clicks on statusline (#30655)zeertzjq2024-10-04
| |
| * 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.
| * perf(treesitter): do not use tree cursors with a small lifetimeLewis Russell2024-10-03
| | | | | | | | | | | | | | | | | | Problem: Tree cursors can only be efficient when they are re-used. Short-lived cursors are very slow. Solution: Reimplement functions that use short-lived cursors.
| * vim-patch:9.1.0756: missing change from patch v9.1.0754 (#30636)glepnir2024-10-03
| | | | | | | | | | | | | | | | | | Problem: missing change from patch v9.1.0754 Solution: use correct width for the actual item in pum_redraw() (glepnir) closes: vim/vim#15786 https://github.com/vim/vim/commit/a6d9e3c4e07f73f6523699961d8b7b54bdb80cf6
| * vim-patch:9.1.0755: quickfix list does not handle hardlinks well (#30637)zeertzjq2024-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: quickfix list does not handle hardlinks well Solution: store original file name with quickfix entry (Austin Chang) Quickfix list shows entries with duplicate name if the file is opened with the path of hard links. The major cause is that qflist assumed that the filename passed into `qf_add_entry` matches the filename opened with the buffer. This patch handles this case by introduce a `qf_fname` into `qfline_S` structure. It stores the filename from `qf_add_entry` for each quickfix line. closes: vim/vim#15687 https://github.com/vim/vim/commit/29822996996550f68a781e85753ebd4d177f22da Co-authored-by: Austin Chang <austin880625@gmail.com>
| * fix(ui): ensure screen update before waiting for input #30576fredizzimo2024-10-03
| | | | | | | | | | | | | | | | | | | | | | Ensure the screen is fully updated before blocking for input. This did not always happen before, for example when setting `cursorline scrolloff=9999`, which lead to jerky movement when using some GUI applications. Because of the duality of redraw_later, this can't be done in command-line or when waiting for "Press ENTER". In many of those cases the redraw is expected AFTER the key press, while normally it should update the screen immediately. So, those special cases are excluded.
| * 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
| |
| * refactor: fix incorrect use of enum (#30631)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
| * Merge #30595 from justinmk/fixwatchJustin M. Keyes2024-10-02
| |\
| | * tests: skip watch.watchdirs test on macos 14 CIJustin M. Keyes2024-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Strange failure only in macos 14 CI FAILED test/functional/lua/watch_spec.lua @ 82: vim._watch watchdirs() detects file changes test/functional/lua/watch_spec.lua:149: Expected objects to be the same. Passed in: (table: 0x0116023758) { *[1] = { [change_type] = 3 *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/nvim_KFMvPbXk9a' } [2] = { [change_type] = 3 [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } } Expected: (table: 0x010d9d6548) { *[1] = { [change_type] = 1 *[path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } [2] = { [change_type] = 3 [path] = '/Users/runner/work/neovim/neovim/build/Xtest_tmpdir/nvim_KFMvPbXk9a/file' } } stack traceback: test/functional/lua/watch_spec.lua:149: in function <test/functional/lua/watch_spec.lua:82> Solution: Skip test for that exact version.
| | * 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
| * build(deps): bump luajit to HEAD - 97813fb92Christian Clason2024-10-02
| |
| * build(deps): bump luajit to HEAD - b2915e9abChristian Clason2024-10-02
| |
| * build(deps): bump tree-sitter to HEAD - c3d45a015 (#30589)Christian Clason2024-10-02
| |
| * build(deps): bump luajit to HEAD - 2240d8446Christian Clason2024-10-02
| |
| * 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>
| * vim-patch:9.1.0753: Wrong display when typing in diff mode with ↵zeertzjq2024-10-01
| | | | | | | | | | | | | | | | | | | | 'smoothscroll' (#30614) Problem: Wrong display when typing in diff mode with 'smoothscroll'. Solution: Use adjust_plines_for_skipcol() (zeertzjq). closes: vim/vim#15776 https://github.com/vim/vim/commit/47f8584a80006cd25e7dc6fa7fb1bfe2e768403c
| * 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
| |
| * fix(tabline): restore behavior of click after last tabpage (#30602)zeertzjq2024-10-01
| | | | | | Also correct the comments about tabpage labels in custom tabline.
| * docs(gen_help_html.lua): h4 pseudo-heading layoutJustin M. Keyes2024-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The <br> hack in a0c64fe816f8 causes weird layout if a "h4 pseudo-heading" is not the only tag on the line. For example in the help text below, the "*'buflisted'*" tag was treated as h4 and followed by <br>, which is obviously wrong: *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85* 'buflisted' 'bl' boolean (default on) Solution: Only treat a tag as "h4 pseudo-heading" if it is the only tag in the line. This is fragile, but in practice seems to get the right balance.
| * docs(gen_help_html.lua): h4 pseudo-heading layout #30609Justin M. Keyes2024-10-01
| | | | | | | | | | | | | | | | | | Problem: The right-aligned tag "pseudo-heading" layout mushes together with the left-aligned text. This is especially messy in a narrow viewport. Solution: Put a `<br>` on it. This is a hack until tree-sitter-vimdoc recognizes these pseudo-headings.
| * 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>
| * refactor: use ERROR_SET() to check for error (#30594)zeertzjq2024-10-01
| | | | | | Replaces the only two places where kErrorTypeNone is checked explicitly.
| * build(deps): bump luajit to HEAD - f5fd22203Christian Clason2024-09-30
| |
| * Merge pull request #30526 from lewis6991/fix/linematchnulLewis Russell2024-09-30
| |\
| | * 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
| * docs: graduate editorconfig.txt to "flow layout"Justin M. Keyes2024-09-30
| | | | | | | | fix #25401
| * 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>
| * fix(float): properly find last window of tabpage (#30571)zeertzjq2024-09-29
| |
| * 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>