Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>inputlist

๐Ÿ“š Standard module for denops.vim
Go to Latest
function inputlist
import { inputlist } from "https://deno.land/x/denops_std@v5.0.2/function/mod.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, if the mouse is enabled in the command line ('mouse' is "a" or includes "c"). 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>