From 7ab57e1953f4fcf7d0ec03639f1b34c9dcb6f8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Gamb=C3=B6ck?= Date: Mon, 10 Jul 2017 20:48:17 +0200 Subject: [PATCH] Check for not completing lone directories Even if there is a sole directory with the name of the current completion item, if it does not start with `./` then do not complete it! --- spec/awful/completion_spec.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/awful/completion_spec.lua b/spec/awful/completion_spec.lua index 434582e6..4c4b246e 100644 --- a/spec/awful/completion_spec.lua +++ b/spec/awful/completion_spec.lua @@ -182,6 +182,17 @@ describe("awful.completion.shell", function() assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}}) end) + if has_bash then + it("does not complete local directory not starting with ./ (bash)", function() + assert.same(shell('just_a', 7, 1, 'bash'), {'just_a', 7}) + end) + end + if has_zsh then + it("does not complete local directory not starting with ./ (zsh)", function() + assert.same(shell('just_a', 7, 1, 'zsh'), {'just_a', 7}) + end) + end + if has_bash then it("completes local directories starting with ./ (bash)", function() assert.same(shell('./just', 7, 1, 'bash'), {'./just_a_directory/', 20, {'./just_a_directory/'}})