File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,11 @@ statuscolumn.detach = function (window)
336
336
337
337
vim .schedule (function ()
338
338
if not window or vim .api .nvim_win_is_valid (window ) == false then
339
+ -- Invalid window.
340
+ return ;
341
+ elseif vim .wo [window ].statuscolumn ~= STC then
342
+ -- Do not attempt to modify window's statuscolumn
343
+ -- if the statuscolumn isn't the one we set.
339
344
return ;
340
345
end
341
346
Original file line number Diff line number Diff line change @@ -408,6 +408,11 @@ statusline.detach = function (window)
408
408
409
409
vim .schedule (function ()
410
410
if not window or vim .api .nvim_win_is_valid (window ) == false then
411
+ -- Invalid window.
412
+ return ;
413
+ elseif vim .wo [window ].statusline ~= STL then
414
+ -- Do not attempt to modify window's statusline
415
+ -- if the statusline isn't the one we set.
411
416
return ;
412
417
end
413
418
Original file line number Diff line number Diff line change @@ -726,6 +726,15 @@ winbar.detach = function (window)
726
726
--- | fS
727
727
728
728
vim .schedule (function ()
729
+ if not window or vim .api .nvim_win_is_valid (window ) == false then
730
+ -- Invalid window.
731
+ return ;
732
+ elseif vim .wo [window ].statuscolumn ~= WBR then
733
+ -- Do not attempt to modify window's winbar
734
+ -- if the winbar isn't the one we set.
735
+ return ;
736
+ end
737
+
729
738
pcall (function ()
730
739
vim .w [window ].__wbID = nil ;
731
740
You can’t perform that action at this time.
0 commit comments