Skip to main content
Module

x/ddc_vim/deps.ts>fn.inputlist

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function fn.inputlist
import { fn } from "https://deno.land/x/ddc_vim@v2.3.0/deps.ts";
const { inputlist } = fn;

{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>