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 @@ -123,6 +123,9 @@ require 'window-picker'.setup({
123
123
-- selection or not
124
124
include_current_win = false ,
125
125
126
+ -- whether to include windows marked as unfocusable
127
+ include_unfocusable_windows = false ,
128
+
126
129
-- filter using buffer options
127
130
bo = {
128
131
-- if the file type is one of following, the window will be ignored
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ local config = {
67
67
-- selection or not
68
68
include_current_win = false ,
69
69
70
+ -- whether to include windows marked as unfocusable
71
+ include_unfocusable_windows = false ,
72
+
70
73
-- filter using buffer options
71
74
bo = {
72
75
-- if the file type is one of following, the window will be ignored
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ function M:new()
20
20
o ._file_path_contains_filter ,
21
21
o ._file_path_contains_filter ,
22
22
o ._current_window_filter ,
23
+ o ._unfocusable_windows_filter ,
23
24
}
24
25
25
26
return o
@@ -31,6 +32,7 @@ function M:set_config(config)
31
32
self .file_name_contains = config .file_name_contains or {}
32
33
self .file_path_contains = config .file_path_contains or {}
33
34
self .include_current_win = config .include_current_win
35
+ self .include_unfocusable_windows = config .include_unfocusable_windows
34
36
end
35
37
36
38
function M :filter_windows (windows )
@@ -150,4 +152,15 @@ function M:_current_window_filter(windows)
150
152
end )
151
153
end
152
154
155
+ function M :_unfocusable_windows_filter (windows )
156
+ if self .include_unfocusable_windows then
157
+ return windows
158
+ end
159
+
160
+ return util .tbl_filter (windows , function (winid )
161
+ local cfg = vim .api .nvim_win_get_config (winid )
162
+ return cfg .focusable
163
+ end )
164
+ end
165
+
153
166
return M
You can’t perform that action at this time.
0 commit comments