1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:40:06 +08:00

docs(api): update :h SpaceVim-api-vim-message

This commit is contained in:
Shidong Wang 2021-11-03 21:31:08 +08:00
parent 689fafccf1
commit e6626bdd37
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848
2 changed files with 56 additions and 3 deletions

View File

@ -11,11 +11,37 @@
" @parentsection api
" `vim#message` API provide functions for generating colored message in vim's
" command line.
" >
" let s:MSG = SpaceVim#api#import('vim#message')
" call s:MSG.echo('WarningMsg', 'hello world!')
" <
" @subsection functions
"
" echo({hi}, {msg})
"
" print message with {hi} highlight group.
" print message with {hi} highlight group. The {msg} starts on a new line.
"
" echon({hi}, {msg})
"
" print message with {hi} highlight group. The {msg} will be displayed
" without anything added.
"
" echomsg({hi}, {msg})
"
" print message with {hi} highlight group. The {msg} starts on a new line.
" The {msg} also will be added to `:messages` history.
"
" error({msg})
"
" same as `echomsg('Error', {msg})`
"
" warn({msg})
"
" same as `echomsg('WarningMsg', {msg})`
"
" confirm({msg})
"
" promote a confirm message, accept user input `y/n`.
let s:self = {}

View File

@ -5319,10 +5319,37 @@ VIM#MESSAGE *SpaceVim-api-vim-message*
`vim#message` API provide functions for generating colored message in vim's
command line.
>
let s:MSG = SpaceVim#api#import('vim#message')
call s:MSG.echo('WarningMsg', 'hello world!')
<
FUNCTIONS
echo({hi}, {msg})
print message with {hi} highlight group.
print message with {hi} highlight group. The {msg} starts on a new line.
echon({hi}, {msg})
print message with {hi} highlight group. The {msg} will be displayed
without anything added.
echomsg({hi}, {msg})
print message with {hi} highlight group. The {msg} starts on a new line.
The {msg} also will be added to `:messages` history.
error({msg})
same as `echomsg('Error', {msg})`
warn({msg})
same as `echomsg('WarningMsg', {msg})`
confirm({msg})
promote a confirm message, accept user input `y/n`.
==============================================================================
VIM#WINDOW *SpaceVim-api-vim-window*