mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 01:00:05 +08:00
docs(cmdlinemenu): add usage example
This commit is contained in:
parent
3e4683831b
commit
e64b332805
@ -54,6 +54,16 @@ endfunction
|
||||
" 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 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
|
||||
let cancelled = 0
|
||||
|
@ -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
|
||||
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*
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user