mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +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
|
" Check if the window is a floating windows, return `v:true` if the window
|
||||||
" is a floating window.
|
" is a floating window.
|
||||||
|
"
|
||||||
|
" winexists({winid})
|
||||||
|
"
|
||||||
|
" Check if the window with {winid} exists in current tabpage.
|
||||||
|
|
||||||
let s:self = {}
|
let s:self = {}
|
||||||
|
|
||||||
@ -97,6 +101,12 @@ else
|
|||||||
endfunction
|
endfunction
|
||||||
endif
|
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
|
function! SpaceVim#api#vim#window#get() abort
|
||||||
return deepcopy(s:self)
|
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
|
Check if the window is a floating windows, return `v:true` if the window
|
||||||
is a floating window.
|
is a floating window.
|
||||||
|
|
||||||
|
winexists({winid})
|
||||||
|
|
||||||
|
Check if the window with {winid} exists in current tabpage.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
VIM#COMMAND *SpaceVim-api-vim-command*
|
VIM#COMMAND *SpaceVim-api-vim-command*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user