From 55ceb314ca96ac45418df00e3a1018e18e89dc9b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 28 Apr 2026 18:29:17 -0400 Subject: feat(ui): use vim.ui.select for :tselect, z= #39478 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 --- runtime/lua/vim/ui.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim/ui.lua') diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index 871a159346..665fd19e9e 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -26,11 +26,11 @@ local M = vim._defer_require('vim.ui', { ---@field kind? string --- Prompts the user to pick from a list of items, allowing arbitrary (potentially asynchronous) ---- work until `on_choice`. +--- work until `on_choice`. This is the standard "picker" interface, used by |z=|, |:tselect|, etc. --- ---- Plugins may override `vim.ui.select` to provide a custom "picker" interface; they are expected ---- to call the `format_item` and `preview_item` handlers (if any) provided by the caller. They may ---- also use the `kind` hint (if provided by the caller) to decide how to handle some items. +--- Plugins may override `vim.ui.select` to provide a custom picker; they are expected to call the +--- `format_item` and `preview_item` handlers (if any) provided by the caller. They may also use the +--- `kind` hint (if provided by the caller) to decide how to handle some items. --- --- Note: the default `vim.ui.select` currently doesn't support preview. --- -- cgit