Skip to content

Commit 8eeedcb

Browse files
committed
refactor(spec): Chnaged how :list messages are detected
1 parent 00a6f38 commit 8eeedcb

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

lua/ui/spec.lua

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,17 +1308,14 @@ spec.default = {
13081308
ls = {
13091309
---|fS
13101310

1311-
condition = function ()
1312-
local last_cmd = vim.fn.histget("cmd", -1);
1313-
require("ui.log").print(last_cmd, "HERE")
1314-
1315-
for _, patt in ipairs({ "^ls", "^buffers", "^files" }) do
1316-
if string.match(last_cmd, patt) then
1317-
return true;
1318-
end
1311+
condition = function (msg, lines)
1312+
if msg.kind ~= "list_cmd" then
1313+
return false;
1314+
elseif string.match(lines[2], '^%s*(%d+)%s*([u%%#ah%-=RF%?%+x]+)%s*"(.+)"%s*line (%d+)$') == nil then
1315+
return false;
13191316
end
13201317

1321-
return false;
1318+
return true;
13221319
end,
13231320

13241321
modifier = function (_, lines)

0 commit comments

Comments
 (0)