diff --git a/autoload/SpaceVim/api/cmdlinemenu.vim b/autoload/SpaceVim/api/cmdlinemenu.vim index b0d99e6d9..b20cb693f 100644 --- a/autoload/SpaceVim/api/cmdlinemenu.vim +++ b/autoload/SpaceVim/api/cmdlinemenu.vim @@ -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 diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index fe4e2bfa8..2aa0ae2b4 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -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*