mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 05:30:07 +08:00
parent
7835efd261
commit
916312fa79
34
autoload/SpaceVim/api/neovim/gui.vim
Normal file
34
autoload/SpaceVim/api/neovim/gui.vim
Normal file
@ -0,0 +1,34 @@
|
||||
let s:self = {}
|
||||
|
||||
|
||||
function! s:self.gui_name() abort
|
||||
if !has('nvim-0.3')
|
||||
return ''
|
||||
endif
|
||||
|
||||
let uis = nvim_list_uis()
|
||||
if len(uis) == 0
|
||||
echoerr "No UIs are attached"
|
||||
return
|
||||
endif
|
||||
|
||||
" Use the last UI in the list
|
||||
let ui_chan = uis[-1].chan
|
||||
let info = nvim_get_chan_info(ui_chan)
|
||||
return get(info.client, 'name', '')
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:self.toggle_tabline(enable) abort
|
||||
call rpcnotify(0, 'Gui', 'Option', 'Tabline', a:enable)
|
||||
endfunction
|
||||
|
||||
function! s:self.toggle_popupmenu(enable) abort
|
||||
call rpcnotify(0, 'Gui', 'Option', 'Popupmenu', a:enable)
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#api#neovim#gui#get()
|
||||
|
||||
return deepcopy(s:self)
|
||||
|
||||
endfunction
|
Loading…
Reference in New Issue
Block a user