From 007cbd6684309f77e9c2b1047e654115e7fc78dd Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 4 Apr 2022 19:46:41 +0800 Subject: [PATCH] fix(notify): fix `win_is_open` function --- autoload/SpaceVim/api/notify.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/autoload/SpaceVim/api/notify.vim b/autoload/SpaceVim/api/notify.vim index f5177d4fc..c1e83b924 100644 --- a/autoload/SpaceVim/api/notify.vim +++ b/autoload/SpaceVim/api/notify.vim @@ -61,9 +61,15 @@ endfunction function! s:self.win_is_open() abort try - return self.winid >= 0 && self.border.winid >= 0 - \ && has_key(nvim_win_get_config(self.winid), 'col') - \ && has_key(nvim_win_get_config(self.border.winid), 'col') + if exists('*nvim_win_get_config') + return self.winid >= 0 && self.border.winid >= 0 + \ && has_key(nvim_win_get_config(self.winid), 'col') + \ && has_key(nvim_win_get_config(self.border.winid), 'col') + elseif exists('*popup_getoptions') + return self.winid >= 0 && self.border.winid >= 0 + \ && has_key(popup_getoptions(self.winid), 'col') + \ && has_key(popup_getoptions(self.border.winid), 'col') + endif catch return 0 endtry