@@ -142,22 +142,22 @@ end
142
142
function M .slot_after_previous (win , open_windows , direction )
143
143
local key = slot_key (direction )
144
144
local cmp = is_increasing (direction ) and less or greater
145
- local exists , cur_win_conf = pcall ( vim . api . nvim_win_get_config , win )
145
+ local exists , cur_win_conf = util . get_win_config ( win )
146
146
if not exists then
147
147
return 0
148
148
end
149
149
150
- local cur_slot = cur_win_conf [key ][ false ]
150
+ local cur_slot = cur_win_conf [key ]
151
151
local win_confs = {}
152
152
for _ , w in ipairs (open_windows ) do
153
- local success , conf = pcall ( vim . api . nvim_win_get_config , w )
153
+ local success , conf = util . get_win_config ( w )
154
154
if success then
155
155
win_confs [w ] = conf
156
156
end
157
157
end
158
158
159
159
local preceding_wins = vim .tbl_filter (function (open_win )
160
- return win_confs [open_win ] and cmp (win_confs [open_win ][key ][ false ] , cur_slot )
160
+ return win_confs [open_win ] and cmp (win_confs [open_win ][key ], cur_slot )
161
161
end , open_windows )
162
162
163
163
if # preceding_wins == 0 then
@@ -173,7 +173,7 @@ function M.slot_after_previous(win, open_windows, direction)
173
173
end
174
174
175
175
table.sort (preceding_wins , function (a , b )
176
- return cmp (win_confs [a ][key ][ false ] , win_confs [b ][key ][ false ])
176
+ return cmp (win_confs [a ][key ], win_confs [b ][key ])
177
177
end )
178
178
179
179
local last_win = preceding_wins [# preceding_wins ]
@@ -182,13 +182,13 @@ function M.slot_after_previous(win, open_windows, direction)
182
182
if is_increasing (direction ) then
183
183
return move_slot (
184
184
direction ,
185
- last_win_conf [key ][ false ] ,
185
+ last_win_conf [key ],
186
186
last_win_conf [space_key (direction )] + border_padding (direction , last_win_conf )
187
187
)
188
188
else
189
189
return move_slot (
190
190
direction ,
191
- last_win_conf [key ][ false ] ,
191
+ last_win_conf [key ],
192
192
cur_win_conf [space_key (direction )] + border_padding (direction , cur_win_conf )
193
193
)
194
194
end
0 commit comments