Skip to main content
Module

x/denops_std/function/input.ts>inputlist

📚 Standard module for denops.vim
Go to Latest
function inputlist
import { inputlist } from "https://deno.land/x/denops_std@v3.11.3/function/input.ts";

{textlist} must be a |List| of strings. This |List| is displayed, one string per line. The user will be prompted to enter a number, which is returned. The user can also select an item by clicking on it with the mouse. For the first string 0 is returned. When clicking above the first item a negative number is returned. When clicking on the prompt one more than the length of {textlist} is returned. Make sure {textlist} has less than 'lines' entries, otherwise it won't work. It's a good idea to put the entry number at the start of the string. And put a prompt in the first item. Example: let color = inputlist(['Select color:', '1. red', \ '2. green', '3. blue']) Can also be used as a |method|: GetChoices()->inputlist()

Parameters

denops: Denops
textlist: string[]

Returns

Promise<number>