aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
| * | feat(treesitter): support URLs (#27132)Gregory Anders2024-03-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tree-sitter queries can add URLs to a capture using the `#set!` directive, e.g. (inline_link (link_text) @text.reference (link_destination) @text.uri (#set! @text.reference "url" @text.uri)) The pattern above is included by default in the `markdown_inline` highlight query so that users with supporting terminals will see hyperlinks. For now, this creates a hyperlink for *all* Markdown URLs of the pattern [link text](link url), even if `link url` does not contain a valid protocol (e.g. if `link url` is a path to a file). We may wish to change this in the future to only linkify when the URL has a valid protocol scheme, but for now we delegate handling this to the terminal emulator. In order to support directives which reference other nodes, the highlighter must be updated to use `iter_matches` rather than `iter_captures`. The former provides the `match` table which maps capture IDs to nodes. However, this has its own challenges: - `iter_matches` does not guarantee the order in which patterns are iterated matches the order in the query file. So we must enforce ordering manually using "subpriorities" (#27131). The pattern index of each match dictates the extmark's subpriority. - When injections are used, the highlighter contains multiple trees. The pattern indices of each tree must be offset relative to the maximum pattern index from all previous trees to ensure that extmarks appear in the correct order. - The `iter_captures` implementation currently has a bug where the "match" table is only returned for the first capture within a pattern (see #27274). This bug means that `#set!` directives in a query apply only to the first capture within a pattern. Unfortunately, many queries in the wild have come to depend on this behavior. `iter_matches` does not share this flaw, so switching to `iter_matches` exposed bugs in existing highlight queries. These queries have been updated in this repo, but may still need to be updated by users. The `#set!` directive applies to the _entire_ query pattern when used without a capture argument. To make `#set!` apply only to a single capture, the capture must be given as an argument.
| * | fix: move fswatch linux check inside of vim.schedule (#27824)Tomas Slusny2024-03-12
| | | | | | | | | | | | | | | | | | Fixes issue reported in the original PR: https://github.com/neovim/neovim/pull/27810 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
| * | docs: small fixes (#27364)dundargoc2024-03-12
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Ynda Jas <yndajas@gmail.com> Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com> Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com> Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com> Co-authored-by: cuinix <915115094@qq.com>
| * | vim-patch:0049a495c8d4 (#27817)zeertzjq2024-03-12
| | | | | | | | | | | | | | | | | | | | | | | | runtime(doc): improve 'winfixbuf' docs (vim/vim#14180) - Make it not sound like a buffer option. - "!" is called a modifier, not an option. https://github.com/vim/vim/commit/0049a495c8d4a597773587f622d8cc8573c2eb75
| * | docs: adjust fswatch overflow message to mention docs with infoTomas Slusny2024-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Add :h fswatch-limitations that notifies user about default inotify limitations on linux and how to adjust them - Check for Event queue overflow message from fswatch and refer user to new documentation Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
| * | vim-patch:9.1.0147: Cannot keep a buffer focused in a windowColin Kennedy2024-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Cannot keep a buffer focused in a window (Amit Levy) Solution: Add the 'winfixbuf' window-local option (Colin Kennedy) fixes: vim/vim#6445 closes: vim/vim#13903 https://github.com/vim/vim/commit/215703563757a4464907ead6fb9edaeb7f430bea N/A patch: vim-patch:58f1e5c0893a
| * | docs(editorconfig): move to sourceLewis Russell2024-03-10
| | |
| * | docs: more accurate typing for vim.tbl_extendRiley Bruins2024-03-10
| | |
| * | fix(fswatch): --latency is locale dependentOscar Creator2024-03-10
| | |
| * | Merge pull request #27330 from seandewar/win_set_config-fixesSean Dewar2024-03-09
| |\ \ | | | | | | | | | | | | | | | | fix(api): various window-related function fixes This is a big one!
| | * | vim-patch:partial:9.1.0117: Stop split-moving from firing WinNew and ↵Sean Dewar2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WinNewPre autocommands Problem: win_splitmove fires WinNewPre and possibly WinNew when moving windows, even though no new windows are created. Solution: don't fire WinNew and WinNewPre when inserting an existing window, even if it isn't the current window. Improve the accuracy of related documentation. (Sean Dewar) https://github.com/vim/vim/commit/96cc4aef3d47d0fd70e68908af3d48a0dce8ea70 Partial as WinNewPre has not been ported yet (it currently has problems anyway).
| | * | fix(api): make open_win block only enter/leave events if !enter && !noautocmdSean Dewar2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: nvim_open_win blocking all win_set_buf autocommands when !enter && !noautocmd is too aggressive. Solution: temporarily block WinEnter/Leave and BufEnter/Leave events when setting the buffer. Delegate the firing of BufWinEnter back to win_set_buf, which also has the advantage of keeping the timing consistent (e.g: before the epilogue in enter_buffer, which also handles restoring the cursor position if autocommands didn't change it, among other things). Reword the documentation for noautocmd a bit. I pondered modifying do_buffer and callees to allow for BufEnter/Leave being conditionally disabled, but it seems too invasive (and potentially error-prone, especially if new code paths to BufEnter/Leave are added in the future). Unfortunately, doing this has the drawback of blocking ALL such events for the duration, which also means blocking unrelated such events; like if window switching occurs in a ++nested autocmd fired by win_set_buf. If this turns out to be a problem in practice, a different solution specialized for nvim_open_win could be considered. :-)
| | * | fix(api): make win_set_config with "win" for splits need "split/vertical"Sean Dewar2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: currently, for splits, nvim_win_set_config accepts win without any of split or vertical set, which has little effect and seems error-prone. Solution: require at least one of split or vertical to also be set for splits. Also, update nvim_win_set_config docs, as it's no longer limited to just floating and external windows.
* | | | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2024-03-09
|\| | |
| * | | docs: support inline markdownLewis Russell2024-03-09
| | | | | | | | | | | | | | | | | | | | | | | | - Tags are now created with `[tag]()` - References are now created with `[tag]` - Code spans are no longer wrapped
| * | | feat!: remove deprecated functionsdundargoc2024-03-09
| |/ /
| * | vim-patch:9.1.0154: shm=F not respected when reloading buffer with 'autoread'zeertzjq2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: shm=F not respected when reloading buffer with 'autoread' Solution: Check SHM_FILEINFO in buf_check_timestamp() (Shougo Matsushita) closes: vim/vim#14144 https://github.com/vim/vim/commit/9db39b0ec90600bb41faec3a12b934b17c298b1f Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
| * | vim-patch:9.1.0157: Duplicate assignment in f_getregion() (#27766)zeertzjq2024-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Duplicate assignment in f_getregion(). Solution: Remove the duplicate assignment. Also improve getregion() docs wording and fix an unrelated typo (zeertzjq) closes: vim/vim#14154 https://github.com/vim/vim/commit/0df8f93bdaea77a1afb9f4eca94fe67ec73e6df2
| * | fix(type): remove incorrect arguments from vim.rpc*altermo2024-03-07
| | |
| * | feat(lua): deprecate vim.tbl_add_reverse_lookupMaria José Solano2024-03-07
| | |
| * | vim-patch:9.1.0155: can only get getregion() from current buffer (#27757)zeertzjq2024-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: can only call getregion() for current buffer Solution: Allow to retrieve selections from different buffers (Shougo Matsushita) closes: vim/vim#14131 https://github.com/vim/vim/commit/84bf6e658da51126bdd2e50af1f40cabd149343f Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
| * | fix(fs): use generics for better typingaltermo2024-03-06
| | |
| * | docs(lsp): nits and typos in client.luaMaria José Solano2024-03-06
| | |
| * | fix(types): move type annotation for `IterMod`Will Hopkins2024-03-06
| | |
| * | refactor(types): more fixes (2)Lewis Russell2024-03-06
| | |
| * | docs(treesitter): fix ambiguous parameter description about `lang`Yi Ming2024-03-06
| | |
| * | fix(lsp): actually send diagnostic-tags back to the serverLewis Russell2024-03-06
| | | | | | | | | | | | Fixes #27318
| * | feat(lsp): report fswatch errorsLewis Russell2024-03-06
| | | | | | | | | | | | | | | | | | Resolves #27713 Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
| * | refactor(lua): more efficient vim.tbl_islistLewis Russell2024-03-06
| | | | | | | | | | | | | | | No need to run a full iteration of the table. Simply return false when the next key isn't what we expect.
| * | refactor(types): more fixesLewis Russell2024-03-06
| | |
| * | docs(lua): improvements for LSP and DiagnosticLewis Russell2024-03-05
| | |
| * | docs(lua): clarify when `vim.bo`/`vim.wo` acts like `:setlocal` (#27708)Luna Saphie Mittelbach2024-03-04
| | |
| * | fix(lsp): directly rename the existing buffers when renaming (#27690)Jaehwang Jung2024-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: `vim.lsp.util.rename()` deletes the buffers that are affected by renaming. This has undesireable side effects. For example, when renaming a directory, all buffers under that directory are deleted and windows displaying those buffers are closed. Also, buffer options may change after renaming. Solution: Rename the buffers with :saveas. An alternative approach is to record all the relevant states and restore it after renaming, but that seems to be more complex. In fact, the older version was attempting to restore the states but only partially and incorrectly.
| * | fix(lsp): defer writing error msgs (#27688)Jaehwang Jung2024-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context: Nvim catches errors from the user's `on_exit` and rpc handler callbacks and prints the error message. Problem: Printing the error message uses Nvim api functions. But callbacks mentioned above run in `:h lua-loop-callbacks` where most of `vim.api` is not allowed, so Nvim itself raises error. Solution: `vim.schedule()` the error reporting when necessary.
| * | Merge pull request #27347 from lewis6991/fswatchLewis Russell2024-03-01
| |\ \ | | | | | | | | feat(lsp): add fswatch watchfunc backend
| | * | feat(lsp): add fswatch watchfunc backendLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: vim._watch.watchdirs has terrible performance. Solution: - On linux use fswatch as a watcher backend if available. - Add File watcher section to health:vim.lsp. Warn if watchfunc is libuv-poll.
| | * | fix(lsp): cancel watchers when closing a clientLewis Russell2024-03-01
| | | |
| | * | refactor(watch): simplify filechanges processingLewis Russell2024-03-01
| | | |
| | * | refactor(watch): general tidy upLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | | | - Rename watch.poll to watch.watchdirs - Unify how include and exclude is applied - Improve type hints
| * | | docs: improve/add documentation of Lua typesLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added `@inlinedoc` so single use Lua types can be inlined into the functions docs. E.g. ```lua --- @class myopts --- @inlinedoc --- --- Documentation for some field --- @field somefield integer --- @param opts myOpts function foo(opts) end ``` Will be rendered as ``` foo(opts) Parameters: - {opts} (table) Object with the fields: - somefield (integer) Documentation for some field ``` - Marked many classes with with `@nodoc` or `(private)`. We can eventually introduce these when we want to.
| * | | fix(types): rename win_get_config return type to win_configWill Hopkins2024-03-02
| | | | | | | | | | | | Follow-up to #27397
| * | | vim-patch:87410ab3f556 (#27696)zeertzjq2024-03-02
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | runtime(doc): some improvements to getregion() docs (vim/vim#14122) - Mention the default selection behavior - Remove useless sentence - Correct description about space padding https://github.com/vim/vim/commit/87410ab3f556121dfb3b30515f40c5f079edd004
| * | fix(lsp): rename undofile when renaming (#27684)Jaehwang Jung2024-03-01
| | | | | | | | | | | | | | | | | | | | | Problem: After `rename()`, the undo information for the renamed file(s) are lost. Solution: Rename the undofile as well.
| * | docs(eval): getline and indent function support string typeglepnir2024-02-29
| | | | | | | | | | | | | | | | | | Problem: getline and indent function missing string type in param. Solution: add string type in eval gen.
| * | fix(lsp): use plain loop for non-list-like table of protocol valuesChristian Clason2024-02-29
| |/ | | | | | | | | | | Fixup for #27628 Closes #27669
| * refactor(defaults): use getregion() for Visual mode gx (#27663)zeertzjq2024-02-29
| | | | | | Also make it work better on a multiline selection.
| * vim-patch:9.1.0142: getregion() can be improved (#27662)zeertzjq2024-02-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: getregion() can be improved (after v9.1.120) Solution: change getregion() implementation to use pos as lists and one optional {opt} dictionary (Shougo Matsushita) Note: The following is a breaking change! Currently, the getregion() function (included as of patch v9.1.120) takes 3 arguments: the first 2 arguments are strings, describing a position, arg3 is the type string. However, that is slightly inflexible, there is no way to specify additional arguments. So let's instead change the function signature to: getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists. This is slightly cleaner, and gives us the flexibility to specify additional arguments as key/value pairs to the optional Dict arg. Now it supports the "type" key to specify the selection type (characterwise, blockwise or linewise) and now in addition one can also define the selection type, independently of what the 'selection' option actually is. Technically, this is a breaking change, but since the getregion() Vimscript function is still quite new, this should be fine. closes: vim/vim#14090 https://github.com/vim/vim/commit/19b718828d8d5fab52d94c6cdba694641879ab38 Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
| * docs(lpeg): remove double backticks from meta (#27659)Maria José Solano2024-02-29
| |
| * fix(lsp): handle reverse lookup in capabilitiesMaria José Solano2024-02-28
| |
| * refactor(lsp): remove outdated commentMaria José Solano2024-02-28
| |