@@ -89,16 +89,27 @@ local function pick_win_id()
89
89
90
90
if laststatus == 3 then
91
91
for _ , win_id in ipairs (not_selectable ) do
92
- local ok_status , statusline = pcall (vim .api .nvim_win_get_option , win_id , " statusline" )
93
- local ok_hl , winhl = pcall (vim .api .nvim_win_get_option , win_id , " winhl" )
92
+ local ok_status , statusline , ok_hl , winhl
93
+
94
+ if vim .fn .has " nvim-0.10" == 1 then
95
+ ok_status , statusline = pcall (vim .api .nvim_get_option_value , " statusline" , { win = win_id })
96
+ ok_hl , winhl = pcall (vim .api .nvim_get_option_value , " winhl" , { win = win_id })
97
+ else
98
+ ok_status , statusline = pcall (vim .api .nvim_win_get_option , win_id , " statusline" ) --- @diagnostic disable-line : deprecated
99
+ ok_hl , winhl = pcall (vim .api .nvim_win_get_option , win_id , " winhl" ) --- @diagnostic disable-line : deprecated
100
+ end
94
101
95
102
win_opts [win_id ] = {
96
103
statusline = ok_status and statusline or " " ,
97
104
winhl = ok_hl and winhl or " " ,
98
105
}
99
106
100
107
-- Clear statusline for windows not selectable
101
- vim .api .nvim_win_set_option (win_id , " statusline" , " " )
108
+ if vim .fn .has " nvim-0.10" == 1 then
109
+ vim .api .nvim_set_option_value (" statusline" , " " , { win = win_id })
110
+ else
111
+ vim .api .nvim_win_set_option (win_id , " statusline" , " " ) --- @diagnostic disable-line : deprecated
112
+ end
102
113
end
103
114
end
104
115
0 commit comments