1
0
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:
Shidong Wang 2020-10-05 20:19:24 +08:00
parent b8e591dd73
commit 3d87f8a642
2 changed files with 14 additions and 0 deletions

View File

@ -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)

View File

@ -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*