mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:30:05 +08:00
Add winexists() api
This commit is contained in:
parent
b8e591dd73
commit
3d87f8a642
@ -29,6 +29,10 @@
|
||||
"
|
||||
" Check if the window is a floating windows, return `v:true` if the window
|
||||
" is a floating window.
|
||||
"
|
||||
" winexists({winid})
|
||||
"
|
||||
" Check if the window with {winid} exists in current tabpage.
|
||||
|
||||
let s:self = {}
|
||||
|
||||
@ -97,6 +101,12 @@ else
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! s:self.winexists(winid) abort
|
||||
if !exists('win_id2tabwin')
|
||||
return 0
|
||||
endif
|
||||
return win_id2tabwin(a:winid)[0] == tabpagenr()
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#api#vim#window#get() abort
|
||||
return deepcopy(s:self)
|
||||
|
@ -3720,6 +3720,10 @@ is_float({winnr})
|
||||
Check if the window is a floating windows, return `v:true` if the window
|
||||
is a floating window.
|
||||
|
||||
winexists({winid})
|
||||
|
||||
Check if the window with {winid} exists in current tabpage.
|
||||
|
||||
==============================================================================
|
||||
VIM#COMMAND *SpaceVim-api-vim-command*
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user