aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* feat(pack): vim.pack.get() gets VCS info #35631Evgeni Chasnovski2025-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Force resolve `spec.version` overrides the information about whether a user supplied `version` or not. Knowing it might be useful in some use cases (like comparing to previously set `spec` to detect if it has changed). Solution: Do not resolve `spec.version`. This also improves speed when triggering events and calling `get()`. - Place default branch first when listing all branches. - Use correct terminology in `get_hash` helper. - Do not return `{ '' }` if there are no tags. Problem: There is no way to get more information about installed plugins, like current revision or default branch (necessary if resolving default `spec.version` manually). As computing Git data migth take some time, also allow `get()` to limit output to only necessary set of plugins. Solution: - introduce arguments to `get(names, opts)`, which follows other `vim.pack` functions. Plugin extra info is returned by default and should be opt-out via `opts.info = false`. - Examples: - Get current revision: `get({ 'plug-name' })[1].rev` - Get default branch: `get({ 'plug_name' })[1].branches[1]` - `update()` and `del()` act on plugins in the same order their names are supplied. This is less surprising. - default `opts.info` to `true` since this simplifies logic for the common user, while still leaving the door open for a faster `get()` if needed.
* docs(lsp): tweak `inline_completion.get` code snippet #35657Maria José Solano2025-09-06
| | | | `replace_keycodes` is true if `expr` is set, and "Accept" is a better term to describe the keymap.
* fix(types): nvim_get_win_config return type #35639Lewis Russell2025-09-06
|
* docs: `details` dict in nvim_buf_get_extmark() #35289Phạm Bình An2025-09-06
| | | | | | | | | Problem: The document of nvim_buf_get_extmark currently lacks the following: - "details" directory: nvim_buf_get_extmarks() allows an option details to get a "details" directory in result, but it doesn't mention where that "details" directory is, what fields does it have. Solution: Add docs for "details" directory in nvim_buf_get_extmarks()
* feat(pack): use `nvim_echo{kind=progress}` to report progress #35625Evgeni Chasnovski2025-09-05
| | | | | | | | | Problem: Progress reports use plain `nvim_echo()` with manually constructed messages and populate history on every call. Solution: Use `nvim_echo()` with newly added `kind=progress` which (at least for now) is meant to be a unified interface for showing progress report. Also save in history only first and last progress report messages.
* vim-patch:9.1.1732: filetype: .inc file detection can be improved (#35635)zeertzjq2025-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: .inc file detection can be improved Solution: Update filetype detection for Pascal and BitBake code (Martin Schwan). Fix the detection of .inc files containing Pascal and BitBake code: - the concatenated string, merged from three lines, only contains one beginning and the pattern "^" would not match as expected. Use a range() loop to iterate each line string individually. This way, the pattern "^" works for beginning of lines. - improve BitBake include file detection by also matching forward-slashes "/" in variable names and assignment operators with a dot ".=" and "=.". Valid examples, which should match, are: PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" MACHINEOVERRIDES =. "qemuall:" BBPATH .= ":${LAYERDIR}" - parse twenty instead of just three lines, to accommodate for potential comments at the beginning of files closes: vim/vim#18202 https://github.com/vim/vim/commit/9fd1a657d2efae5cff278eb5acaa380623a50cf6 Co-authored-by: Martin Schwan <m.schwan@phytec.de>
* docs: lsp, miscJustin M. Keyes2025-09-03
| | | | | | | | | - Problem: It's not clear for new plugin developers that `:help` uses a help-tags file for searching the docs, generated by `:helptags`. - Solution: Hint to the |:helptags| docs for regenerating the tags file for their freshly written documentation. Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
* vim-patch:9.1.1730: filetype: vivado journal/log files are not recognized ↵zeertzjq2025-09-04
| | | | | | | | | | | | | | (#35613) Problem: filetype: vivado journal/log files are not recognized Solution: Detect vivado*.{jou,log} as tcl filetype (Wu Zhenyu). closes: vim/vim#18191 https://github.com/vim/vim/commit/9a6cafdc1ca51653cc37ab896a27db70d6cb1b15 Also fix missing anchor in the pattern from the port of patch 9.1.1602. Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* docs(treesitter): fix language-injection url #35592Yochem van Rosmalen2025-09-01
|
* feat(lua): vim.wait() returns callback results #35588Justin M. Keyes2025-09-01
| | | | | | | | | | | | | | | | | | Problem: The callback passed to `vim.wait` cannot return results directly, it must set upvalues or globals. local rv1, rv2, rv3 local ok = vim.wait(200, function() rv1, rv2, rv3 = 'a', 42, { ok = { 'yes' } } return true end) Solution: Let the callback return values after the first "status" result. local ok, rv1, rv2, rv3 = vim.wait(200, function() return true, 'a', 42, { ok = { 'yes' } } end)
* feat(lsp): vim.lsp.inline_completion on_accept #35507Yi Ming2025-09-01
|
* vim-patch:9.1.1718: filetype: kubectl config file is not recognized #35583Volodymyr Chernetskyi2025-09-01
| | | | | | | | | | | | Problem: filetype: kubectl config file is not recognized Solution: Detect .kube/kubectl as yaml filetype (Volodymyr Chernetskyi). References: - https://kubernetes.io/docs/reference/kubectl/kuberc/ closes: vim/vim#18169 https://github.com/vim/vim/commit/6cd6857cbe671ff8bc4e057b528d37795e1b5c2a
* vim-patch:9.1.1717: filetype: AWS cli alias file is not recognized #35581Volodymyr Chernetskyi2025-09-01
| | | | | | | | | | | | Problem: filetype: AWS cli alias file is not recognized Solution: Detect .aws/cli/alias as confini filetype (Volodymyr Chernetskyi). References: - https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-alias.html related: vim/vim#18169 https://github.com/vim/vim/commit/be0589f1d21f543cedbcd243152721b74d7317dc
* feat(lsp): support `textDocument/onTypeFormatting` (#34637)Riley Bruins2025-08-31
| | | | | | | | | | Implements [on-type formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting) using a `vim.on_key()` approach to listen to typed keys. It will listen to keys on the *left hand side* of mappings. The `on_key` callback is cleared when detaching the last on-type formatting client. This feature is disabled by default. Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* fix(health): update advice for Python #35564Michael Henry2025-08-31
| | | | | Problem: `:checkhealth` advice for Python is out-of-date. Solution: Update the advice to point to `:help provider-python`.
* vim-patch:9.1.1709: filetype: kyaml files are not recognizedVolodymyr Chernetskyi2025-08-30
| | | | | | | | | | | | | | | Problem: filetype: kyaml files are not recognized Solution: Detect *.kyml files as yaml filetype (Volodymyr Chernetskyi) References: - https://kubernetes.io/blog/2025/08/27/kubernetes-v1-34-release/#alpha-support-for-kyaml-a-kubernetes-dialect-of-yaml closes: vim/vim#18158 https://github.com/vim/vim/commit/d5c89cc6bb6aa105abbd6ac07e4265e7da32d606 Co-authored-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
* vim-patch:9.1.1713: filetype: fvwm2m4 files are no longer detectedzeertzjq2025-08-30
| | | | | | | | | | | | Problem: filetype: fvwm2m4 files are no longer recognized (after 9.1.1687). Solution: Add a special case in m4 filetype detection (zeertzjq). closes: vim/vim#18146 https://github.com/vim/vim/commit/5355e81868ea9e6a14eeba4b9140aa1bf239fb65 Co-authored-by: Damien Lejay <damien@lejay.be>
* vim-patch:9.1.1687: filetype: autoconf filetype not always correctzeertzjq2025-08-30
| | | | | | | | | | | | Problem: filetype: autoconf filetype not always correct Solution: Detect aclocal.m4 as config filetype, detect configure.ac as config filetype, fall back to POSIX m4 (Damien Lejay). closes: vim/vim#18065 https://github.com/vim/vim/commit/2b55474f0a78bd252290578a5774316dc5f60180 Co-authored-by: Damien Lejay <damien@lejay.be>
* Merge pull request #31400 from vanaigr/decor-provider-rangebfredl2025-08-29
|\ | | | | feat(decor): add range-based highlighting
| * perf: add on_range in treesitter highlightingvanaigr2025-08-28
| |
* | fix(server): serverlist({peer=true}) does not find peer servers #35506Siddhant Agarwal2025-08-28
|/
* refactor(lua): consistent use of local aliasesChristian Clason2025-08-28
|
* fix(health): accept TERM=tmux-direct #35511Meriel Luna Mittelbach2025-08-27
| | | | | tmux-direct is functionally the same as tmux-256color, except it directly reports 24-bit color and how to set them (setaf/setab) via ncurses 6.x's extended terminfo format.
* fix(lsp): don't treat MarkedString[] with language id as empty #35518Robert Muir2025-08-27
| | | | | | | | | Problem: Hover response of MarkedString[] where the first element contains a language identifier treated as empty. Solution: Fix empty check to handle case of MarkedString[] where the first element is a pair of a language and value.
* Merge #35505 from ofseed/lsp-fix-autocompleteJustin M. Keyes2025-08-27
|\
| * fix(lsp): update completion items on `TextChangedP`Yi Ming2025-08-27
| |
| * fix(lsp): update on `CursorHoldI` cause users unable to `select()`Yi Ming2025-08-27
| |
| * fix(lsp): `opts.wrap` always `true`Yi Ming2025-08-27
| |
* | fix(extui): error on :call input('') (#35515)phanium2025-08-27
| | | | | | | | Problem: Error on empty string prompt. Solution: (prompt .. '\n'):gmatch('(.-)\n').
* | vim-patch:9.1.1694: filetype: Buck eXtension Lang files are not recognized ↵zeertzjq2025-08-27
|/ | | | | | | | | | | | | | | | (#35504) Problem: filetype: Buck eXtension Lang files are not recognized Solution: Detect *.bxl files as bzl filetype. (Jade Lovelace) References: - https://buck2.build/docs/bxl/ closes: vim/vim#18130 https://github.com/vim/vim/commit/3aea867b276360ab8eb675fc4a9af5be774323e4 Co-authored-by: Jade Lovelace <jadel@mercury.com>
* feat(api): nvim_echo can emit Progress messages/events #34846Shadman2025-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim does not have a core concept for indicating "progress" of long-running tasks. The LspProgress event is specific to LSP. Solution: - `nvim_echo` can emit `kind="progress"` messages. - Emits a `Progress` event. - Includes new fields (id, status, percent) in the `msg_show` ui-event. - The UI is expected to overwrite any message having the same id. - Messages have a globally unique ID. - `nvim_echo` returns the message ID. - `nvim_echo(… {id=…})` updates existing messages. Example: local grp = vim.api.nvim_create_augroup("Msg", {clear = true}) vim.api.nvim_create_autocmd('Progress', { pattern={"term"}, group = grp, callback = function(ev) print(string.format('event fired: %s', vim.inspect(ev))..'\n') end }) -- require('vim._extui').enable({enable=true, msg={target='msg', timeout=1000}}) vim.api.nvim_echo({{'searching'}}, true, {kind='progress', percent=80, status='running', title="terminal(ripgrep)"}) local id = vim.api.nvim_echo({{'searching'}}, true, {kind='progress', status='running', percent=10, title="terminal(ripgrep)"}) vim.api.nvim_echo({}, true, {id = id, kind='progress', percent=20, status = 'running', title='find tests'}) vim.api.nvim_echo({}, true, {id = id, kind='progress', status='running', percent=70}) vim.api.nvim_echo({{'complete'}}, true, {id = id, kind='progress', status='success', percent=100, title="find tests"}) Followups: - Integrate with 'statusline' by listening to the Progress autocmd event. - Integrate progress ui-event with `vim._extui`.
* Merge #33972 feat(lsp): textDocument/inlineCompletionJustin M. Keyes2025-08-24
|\
| * feat(lsp): support `textDocument/inlineCompletion`Yi Ming2025-08-25
| |
| * fix(lua): disable `strict_indexing` when converting LSP positionsYi Ming2025-08-24
| |
| * feat(lua): conversion between extmark positionsYi Ming2025-08-24
| |
| * feat(lua): conversion between cursor positionsYi Ming2025-08-24
| |
| * docs(lua): mark `vim.Pos.Optional` as optionalYi Ming2025-08-24
| |
* | fix(lsp): check whether buffer is valid when scheduled #35461Yi Ming2025-08-24
| |
* | docs: misc #35459Justin M. Keyes2025-08-24
| |
* | fix(lsp): treat nil inlay hint result as empty array (#35458)Maria José Solano2025-08-24
|/ | | | | | | `gopls` seems to send a nil result when there are no inlay hints for the buffer. [The protocol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlayHint) allows for the server to send an array or nil, and it isn't clear what nil should represent. I think it's reasonable to treat it as an empty array though.
* vim-patch:9.1.1672: completion: cannot add timeouts for 'cpt' sources (#35447)zeertzjq2025-08-24
| | | | | | | | | | | | | Problem: completion: cannot add timeouts for 'cpt' sources (Evgeni Chasnovski) Solution: Add the 'autocompletetimeout' and 'completetimeout' options (Girish Palya) fixes: vim/vim#17908 closes: vim/vim#17967 https://github.com/vim/vim/commit/69a337edc15a6c6eba6f16d2f3b7b223a149a938 Co-authored-by: Girish Palya <girishji@gmail.com>
* fix(treesitter): show capture-level priorities in :Inspect #35443Riley Bruins2025-08-23
|
* vim-patch:5ca1ea8: runtime(doc): Tweak documentation stylezeertzjq2025-08-23
| | | | | | | | closes: vim/vim#18078 https://github.com/vim/vim/commit/5ca1ea83ad79c8d1ebd25e61c91f1199c9bc4f09 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:9.1.1638: completion: not possible to delay the autcompletionzeertzjq2025-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: completion: not possible to delay the autcompletion Solution: add the 'autocompletedelay' option value (Girish Palya). This patch introduces a new global option 'autocompletedelay'/'acl' that specifies the delay, in milliseconds, before the autocomplete menu appears after typing. When set to a non-zero value, Vim waits for the specified time before showing the completion popup, allowing users to reduce distraction from rapid suggestion pop-ups or to fine-tune the responsiveness of completion. The default value is 0, which preserves the current immediate-popup behavior. closes: vim/vim#17960 https://github.com/vim/vim/commit/a09b1604d4fe7516d87fbcbf2ffd2dc484799b23 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <girishji@gmail.com>
* feat(tui): add nvim_ui_send (#35406)Gregory Anders2025-08-22
| | | | This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout.
* docs(pack): document `$XDG_DATA_HOME/nvim/site` presence in 'packpath'Evgeni Chasnovski2025-08-22
| | | | | | | | | | Problem: Some use cases might lead to `vim.pack.add()` failing to `:packadd` a plugin because of missing entry in 'packpath'. Like with `nvim --clean` or manually setting `$XDG_DATA_HOME` during startup. Solution: Document it. A more proactive approach can be ensuring correct 'packpath' entry, but it is currently somewhat verbose to do (due to having to adjust for Windows using `\` in 'packpath' entries).
* perf(pack): reduce number of 'opt/' directory computationsEvgeni Chasnovski2025-08-22
|
* fix(lsp): handle array with empty string when checking empty hover (#35423)Igor Lacerda2025-08-21
|
* feat(pack): support user-defined `data` in plugin spec #35360Birdee2025-08-21
| | | | | | | | | | | | | | | | | Problem: The load function in opts was difficult to use if you wished to customize based on the plugin being loaded. You could get the name, but without some way to mark a spec, that was of limited usefulness unless you wanted to hardcode a list of names in the function, or write a wrapper around the whole thing Solution: Allow users to provide an arbitrary data field in plugin specs so that they may receive info as to how to handle that plugin in load, get() and events, and act upon it Co-authored-by: BirdeeHub <birdee@localhost> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
* feat(extui): support paging in the dialog window (#35310)luukvbaal2025-08-21
| | | | | | | | | | | Problem: Unable to see e.g. `inputlist()` prompts that exceed the dialog window height. Multi-line prompts are not handled properly, and tracking is insufficient for messages in cmdline_block mode. Solution: Add vim.on_key handler while the dialog window is open that forwards paging keys to the window. Properly render multi-line prompts. Keep track of both the start and end of the current cmdline prompt. Append messages after the current prompt in cmdline_block mode.