47
47
--- Check if the given path has no listed buffer
48
48
--- @param path string Absolute path
49
49
--- @param bufinfo table vim.fn.getbufinfo { buflisted = 1 }
50
- --- @param unloaded_bufnr number optional bufnr recently unloaded via BufUnload event
51
50
--- @return boolean
52
- local function buf (path , bufinfo , unloaded_bufnr )
51
+ local function buf (path , bufinfo )
53
52
if not M .config .filter_no_buffer or type (bufinfo ) ~= " table" then
54
53
return false
55
54
end
56
55
57
56
-- filter files with no open buffer and directories containing no open buffers
58
57
for _ , b in ipairs (bufinfo ) do
59
- if b .name == path or b .name :find (path .. " /" , 1 , true ) and b . bufnr ~= unloaded_bufnr then
58
+ if b .name == path or b .name :find (path .. " /" , 1 , true ) then
60
59
return false
61
60
end
62
61
end
@@ -105,16 +104,13 @@ end
105
104
106
105
--- Prepare arguments for should_filter. This is done prior to should_filter for efficiency reasons.
107
106
--- @param git_status table | nil optional results of git.load_project_status (... )
108
- --- @param unloaded_bufnr number | nil optional bufnr recently unloaded via BufUnload event
109
107
--- @return table
110
108
--- git_status: reference
111
- --- unloaded_bufnr: copy
112
109
--- bufinfo: empty unless no_buffer set: vim.fn.getbufinfo { buflisted = 1 }
113
110
--- bookmarks: absolute paths to boolean
114
- function M .prepare (git_status , unloaded_bufnr )
111
+ function M .prepare (git_status )
115
112
local status = {
116
113
git_status = git_status or {},
117
- unloaded_bufnr = unloaded_bufnr ,
118
114
bufinfo = {},
119
115
bookmarks = {},
120
116
}
@@ -140,11 +136,7 @@ function M.should_filter(path, status)
140
136
return false
141
137
end
142
138
143
- return git (path , status .git_status )
144
- or buf (path , status .bufinfo , status .unloaded_bufnr )
145
- or dotfile (path )
146
- or custom (path )
147
- or bookmark (path , status .bookmarks )
139
+ return git (path , status .git_status ) or buf (path , status .bufinfo ) or dotfile (path ) or custom (path ) or bookmark (path , status .bookmarks )
148
140
end
149
141
150
142
function M .setup (opts )
0 commit comments