1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 07:00:05 +08:00

docs(cmdlinemenu): add usage example

This commit is contained in:
wsdjeg 2022-03-23 22:38:24 +08:00
parent 3e4683831b
commit e64b332805
2 changed files with 17 additions and 0 deletions

View File

@ -54,6 +54,16 @@ endfunction
" Create a cmdline selection menu from a list of {items}, each item should be a " Create a cmdline selection menu from a list of {items}, each item should be a
" list of two value in it, first one is the description, and the next one " list of two value in it, first one is the description, and the next one
" should be a funcrc. " should be a funcrc.
"
" Example:
" >
" let menu = SpaceVim#api#import('cmdlinemenu')
" let ques = [
" \ ['basic mode', function('s:basic_mode')],
" \ ['dark powered mode', function('s:awesome_mode')],
" \ ]
" call menu.menu(ques)
" <
function! s:menu(items) abort function! s:menu(items) abort
let cancelled = 0 let cancelled = 0

View File

@ -5483,6 +5483,13 @@ Create a cmdline selection menu from a list of {items}, each item should be a
list of two value in it, first one is the description, and the next one should list of two value in it, first one is the description, and the next one should
be a funcrc. be a funcrc.
Example:
>
<
let menu = SpaceVim#api#import('cmdlinemenu') let ques = [ \ ['basic
mode', function('s:basic_mode')], \ ['dark powered mode',
function('s:awesome_mode')], \ ] call menu.menu(ques) <
============================================================================== ==============================================================================
DATA#DICT *SpaceVim-api-data-dict* DATA#DICT *SpaceVim-api-data-dict*