aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/ui.lua
Commit message (Collapse)AuthorAge
* ci(lua): enable annotation and style checksLewis Russell2026-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - annotation-usage-error and code-style-check are disabled. - vim.inspect relies on a dummy self-assignment for docgen, and its help omits parameter and option details. - LuaLS fallback types obscure iterator inference. - Docgen hardcodes public function names and appends separately sorted files, leaving shared helpers under the inspector heading. Solution: - Enable annotation-usage-error and code-style-check, and fix misplaced annotations. - Document vim.inspect's callable module directly, removing the dummy assignment. Describe its parameters, option defaults and process callback. - Remove LuaLS iterator fallbacks, correct iterator signatures and check values that the improved inference identifies as optional. - Parse callable modules, require bindings and parent module references. Derive public names and inherited function docs from these links, including missing help for vim.async.semaphore() and vim.version(). - Export vim.lsp.tagfunc directly with lazy loading and document its implementation instead of maintaining a wrapper. - Group files in section_order, replacing append_only and merge_files. Merge declarations before sorting each section, placing shared helpers in the main vim section and keeping vim.inspect in alphabetical order. - Add basic parser coverage for callable modules and module links. AI-assisted
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(ui): ui.open() modifies opts.cmd #41885Volodymyr Chernetskyi2026-09-24
| | | | | | | | Problem: ui.open() appends the path to the caller's opts.cmd, so reusing the opts opens previously supplied paths again. Solution: Copy opt.cmd before appending the path.
* fix(statusline): default 'statusline' improvements #41597Sébastien Hoffmann2026-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: there should be exactly one cell of padding between sections, and exactly one cell of minimum padding between the left and the right. - Spaces between sections waste space when a section is empty. According to a comment in #33036, this was the reason to avoid `%k` and implement the keymap section with a vim expression, but other sections still have this problem. - The diagnostics section wastes space because it is not entirely empty when there are diagnostics in another buffer. - The terminal exit code section can touch the right side, e.g. the ruler, even though it belongs to the left side. Solution: - Use auto-hiding item groups (`%(` without width fields) to get rid of unneeded spaces when a section shows no information. This simplifies the 'showcmd' and 'keymap' sections in particular. - As a slight simplification, `term_exitcode` is moved into the flags section since it is formatted with square brackets like a flag. - Count the diagnostics for the current buffer specifically. - Ensure at least one cell of padding between the left and the right side by adding a space next to the separator `%=`. Problem: some sections are implemented with `%{%`, even though reevaluation of the expression result is not needed. This leads to otherwise needless %-escaping in `progress_status`. Solution: use `%{` instead. Problem: `%{` and `%{%` (without items) replace spaces with fillchars. This looks out-of-place inside the terminal exit code section, and in contrast to all other sections, the 'busy' section is surrounded by fillchars, which looks inconsistent, and with some terminal-font combinations, ◐ overlaps the fillchar, e.g. Alacritty & JetBrains Mono. Solution: use non-breaking spaces U+202F to avoid fillchar substitution. Problem: sections that appear/disappear frequently can make otherwise more stable sections jump around a lot. Solution: sort the sections on the right roughly by volatility: 'showcmd' in first place, 'keymap' next to the ruler.
* fix(url): escape cmd.exe special chars in vim.ui.open() URL #41394Shubh2026-08-22
| | | | | | | | Problem: On Windows, vim.ui.open() passes URLs to `cmd.exe /c start`. cmd.exe treats `&` as a command separator, so query strings are truncated. Solution: Caret-escape `&|<>^%!` in URIs when the open handler is cmd.exe.
* refactor: introduce nvim_on internally #39883Justin M. Keyes2026-05-20
| | | | | | | | | Problem: `nvim_create_autocmd` is too verbose and its `callback` requires extra "nesting". Solution: Introduce `nvim_on`. Start using it internally. Then we can get a feel for how it should look before making it public.
* feat(ui): vim.ui.input(opts.scope) #39570Evgeni Chasnovski2026-05-17
| | | | | | | | | | | | | | | Problem: There is no way for a `vim.ui.input` caller to indicate for which scope the input is. As in "This input is for something at cursor scope". This information can be useful for `vim.ui.input` implementation to tweak its behavior and presentation: - Show different floating window depending on the scope. For example: - Near cursor for "cursor" scope. - At line start for "line" scope. - In window corner for "buffer" and "window" scopes. - In whole editor corner for "tabpage", "editor", "project" scopes. - Navigate through history only for inputs with the same scope. Solution: Document new `opts.scope` for `vim.ui.input`. Use it in the codebase.
* feat(ui): use vim.ui.select for :tselect, z= #39478Justin M. Keyes2026-04-28
| | | | | | | | | | | | | | | | | | | | | Problem: `:tselect` and `z=` (spell suggest) have their own bespoke select menus. Solution: - Delegate to `vim.ui.select` instead. - Bonus: - `:tselect` gains mouse support. `print_tag_list` didn't suport mouseclick. This causes some minor regressions, which are not blockers: - `z=` no longer draws the list right-left if 'rightleft' is set. - TODO: can/should `vim.ui.select` / `vim.fn.inputlist()` handle that? - `:tselect` - No "column" headings (`# pri kind tag file`). - No highlighting: (HLF_T: tag name, HLF_D: file, HLF_CM: extra fields). - TODO: can `vim.ui.select()` support highlighted chunks (`[[text, hl_id], ...]`) ? fix https://github.com/neovim/neovim/issues/25814 fix https://github.com/neovim/neovim/issues/31987
* feat(ui): vim.ui.img api #37914Chip Senkbeil2026-04-26
| | | | | | | Problem: No builtin api to load and display images. Solution: Introduce vim.ui.img. Only supports kitty graphics protocol, currently.
* docs: vim.ui.select, miscJustin M. Keyes2026-04-26
|
* docs: lsp.CodeActionContext, nested `@inlinedoc`Justin M. Keyes2026-04-26
| | | | | - fix https://github.com/neovim/neovim/issues/39208 - fix generation of neste `@inlinedoc` classes
* docs(vim.ui): "preview" interface for vim.ui.select() #37360Evgeni Chasnovski2026-04-25
| | | | | | | | | | | | | | | Problem: Plugins may want to have a way to show more details about items when using `vim.ui.select`. This is a fairly common problem that prompts plugin authors to implement dedicated sources/pickers for fuzzy picker plugins that are popular at the moment. Solution: Document a way for `vim.ui.select` to provide preview: - `vim.ui.select` users can provide `opts.preview_item` function that creates/uses a buffer and its contents at certain position to show more details about an item. - `vim.ui.select` implementations may use `opts.preview_item` in the way they see fit (like show the buffer in a separate/same window interactively/on-demand or do nothing) if they have a way to show more information about an item.
* docs: misc #39045Justin M. Keyes2026-04-18
|
* docs: misc #38584Justin M. Keyes2026-04-01
|
* docs: news #38464Justin M. Keyes2026-03-28
|
* refactor(progress): simplify progress-status format #38491Shadman2026-03-26
| | | | | | | | | | | | Problem: Currently we are using if 1 item then {title}: {percent}% else Progress: {AVG}%({N}) dropping {title} and Progress text saves up space in statusline plus makes the format consistent, less jumping around. Solution: Use `{AVG}%({N})` for all cases.
* fix(progress): show progress-status only in curwin #38458Shadman2026-03-24
| | | | | | | | | | | | | | | | Problem: Currently same progress stat get's displayed on statusline of all windows. This is repeatitive and noisy. Solultion: Only display progress-status on the focused window Problem: Currently, when multiple progress are on going we show it as Progress: {N} items {percent}% format. It can be simplified sinnce items doesn't really add enough value for the valuable space it takes in statusline Solution: Change format to Progress: {percent}%({N})
* docs: miscJustin M. Keyes2026-03-20
|
* feat(progress): status api, 'statusline' integration #35428Shadman2026-03-20
| | | | | | | | | | | | | | Problem: Default statusline doesn't show progress status. Solution: - Provide `vim.ui.progress_status()`. - Include it in the default 'statusline'. How it works: Status text summarizes "running" progress messages. - If none: returns empty string - If one running item: "title: percent%" - If multiple running items: "Progress: N items avg-percent%"
* fix(defaults): silent `gx` if no `textDocument/documentLink` support #37969Evgeni Chasnovski2026-02-19
| | | | | | | | Problem: If buffer has attached LSP servers and none of them supports `textDocument/documentLink` method, typing `gx` results in a warning about that. Solution: Explicitly check that at least one server supports the target method before making the LSP request.
* feat(lsp): support `textDocument/documentLink` (#37644)Maria Solano2026-02-16
|
* feat(health): check `vim.ui.open()` tool #37569skewb1k2026-01-27
| | | | | | | | | Problem: `:checkhealth` does not report when no `vim.ui.open()` handler is available. Solution: Factor command resolution into `_get_open_cmd()` and reuse it from `:checkhealth` to detect missing handlers.
* fix(ui.open): use "start" instead of deprecated "rundll32" #36731ymich99632025-11-30
| | | | | | | | Problem: The rundll32 utility is a leftover from Windows 95, and it has been deprecated since at least Windows Vista. Solution: Use the start command through Command Prompt instead.
* docs(ui): type annotations for options #33983Yi Ming2025-06-18
|
* fix(docs): callback annotation for `vim.ui.input` #34507Maria José Solano2025-06-17
|
* docs(Open): add reference in documentation (#32678)Luca Saccarola2025-02-28
|
* fix: another round of type annotation fixesLewis Russell2024-10-31
|
* fix(lsp): support multiple clients in typehierarchyLewis Russell2024-10-22
|
* feat(vim.validate): improve fast form and deprecate spec formLewis Russell2024-10-21
| | | | | | | | | | | | | | Problem: `vim.validate()` takes two forms when it only needs one. Solution: - Teach the fast form all the features of the spec form. - Deprecate the spec form. - General optimizations for both forms. - Add a `message` argument which can be used alongside or in place of the `optional` argument.
* feat(vim.ui.open): support lemonade #30845Uthman Mohamed2024-10-18
|
* perf(validate): use lighter versionLewis Russell2024-10-17
| | | | | - Also fix `vim.validate()` for PUC Lua when showing errors for values that aren't string or number.
* feat(vim.ui): configurable "gx" / vim.ui.open() toolMatěj Cepl2024-09-16
| | | | | | | | | | | | | | Problem: User cannot configure the tool used by `vim.ui.open` (or `gx`). With netrw this was supported by `g:netrw_browsex_viewer`. Solution: Introduce `opts.cmd`. Users that want to set this globally can monkey-patch `vim.ui.open` in the same way described at `:help vim.paste()`. Fixes https://github.com/neovim/neovim/issues/29488 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(vim.ui.open): prefer xdg-open on WSL #30302Yi Ming2024-09-07
| | | | xdg-open is usually not installed in WSL. But if the user deliberately installs it, presumably they want to prioritize it.
* feat(treesitter)!: default to correct behavior for quantified captures (#30193)Gregory Anders2024-09-01
| | | | | | | | | | | | For context, see https://github.com/neovim/neovim/pull/24738. Before that PR, Nvim did not correctly handle captures with quantifiers. That PR made the correct behavior opt-in to minimize breaking changes, with the intention that the correct behavior would eventually become the default. Users can still opt-in to the old (incorrect) behavior for now, but this option will eventually be removed completely. BREAKING CHANGE: Any plugin which uses `Query:iter_matches()` must update their call sites to expect an array of nodes in the `match` table, rather than a single node.
* fix(ui): correctly pass metadata to get_node_text #30222Gregory Anders2024-09-01
| | | Fixes: #30220
* feat(ui): gx: use url extmark attribute and tree-sitter directive (#30192)Gregory Anders2024-08-31
| | | | | Use the "url" extmark attribute as well as the "url" tree-sitter metadata key to determine if the cursor is over something Nvim considers a URL.
* fix(lua): ignore stdout and stderr for xdg-openAaron2024-08-12
| | | | Ref #19724 Fix #29932
* fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583)zeertzjq2024-07-09
| | | Unlike vim.fn.expand(), vim.fs.normalize() doesn't expand wildcards.
* refactor: use `vim._with` where possibledundargoc2024-06-28
| | | | | This mostly means replacing `nvim_buf_call` and `nvim_win_call` with `vim._with`.
* fix(gx): allow `@` in urldundargoc2024-06-03
| | | | | This will make `gx` work for links for the form https://hachyderm.io/@neovim.
* feat: allow gx to function for markdown linksdundargoc2024-05-24
| | | | | | | In other words, `gx` works regardless of where it was used in `[...](https://...)`. This only works on markdown buffers. Co-authored-by: ribru17 <ribru17@gmail.com>
* fix(vim.ui)!: change open() to return `result|nil, errmsg|nil` #28612Justin M. Keyes2024-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverts e0d92b9cc20b58179599f53dfa74ca821935a539 #28502 Problem: `vim.ui.open()` has a `pcall()` like signature, under the assumption that this is the Lua idiom for returning result-or-error. However, the `result|nil, errmsg|nil` pattern: - has precedent in: - `io.open` - `vim.uv` (`:help luv-error-handling`) - has these advantages: - Can be used with `assert()`: ``` local result, err = assert(foobar()) ``` - Allows LuaLS to infer the type of `result`: ``` local result, err = foobar() if err then ... elseif result then ... end ``` Solution: - Revert to the `result|nil, errmsg|nil` pattern. - Document the pattern in our guidelines.
* fix(vim.ui)!: change open() to return pcall-like values #28502Justin M. Keyes2024-04-25
| | | | | | | | | Problem: `vim.ui.open` unnecessarily invents a different success/failure convention. Its return type was changed in 57adf8c6e01d, so we might as well change it to have a more conventional form. Solution: Change the signature to use the `pcall` convention of `status, result`.
* fix(vim.ui.open): try wslview before explorer.exe #28424Justin M. Keyes2024-04-20
| | | | | | | | | Problem: explorer.exe is unreliable on WSL. Solution: Try wslview before explorer.exe. fix #28410
* fix(vim.ui): open() may wait indefinitely #28325Justin M. Keyes2024-04-15
| | | | | | | | | | | | Problem: vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986 Solution: - Change `vim.ui.open()`: - Do not call `wait()`. - Return a `SystemObj`. The caller can decide if it wants to `wait()`. - Change `gx` to `wait()` only a short time. - Allows `gx` to show a message if the command fails, without the risk of waiting forever.
* refactor(types): fix miscellaneous type warningsMaria José Solano2024-02-25
|
* fix(vim.ui.open): use explorer.exe instead of wslview #26947Vu Nhat Chuong2024-02-20
| | | | | | | | | Problem: `vim.ui.open` uses `wslview`, which is slow and require a package from external PPA: https://wslutiliti.es/wslu/install.html#ubuntu Solution: Use `explorer.exe` instead. WSL supports it by default: https://learn.microsoft.com/en-us/windows/wsl/filesystems#view-your-current-directory-in-windows-file-explorer
* refactor: fix luals warningsdundargoc2023-12-30
|
* docs: replace <pre> with ``` (#25136)Gregory Anders2023-09-14
|
* refactor(vim.system): factor out on_exit handlingLewis Russell2023-09-05
|