From 8a13f1cb75259d4f54e395c39471e84eb185b1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Gamb=C3=B6ck?= Date: Sun, 2 Jul 2017 16:08:28 +0200 Subject: [PATCH] Check for command with directory in PWD Even if there is a directory in the current working directory with the same name as a command, the directory must not be completed. So, if we want to complete "true" and there is a directory "true" in the current working directory, the completion list has to be just {"true"}, not {"true", "true/"}, or anything else! --- spec/awful/completion_spec.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/awful/completion_spec.lua b/spec/awful/completion_spec.lua index 79816223..5d06cc31 100644 --- a/spec/awful/completion_spec.lua +++ b/spec/awful/completion_spec.lua @@ -146,6 +146,20 @@ describe("awful.completion.shell", function() assert.same(shell('ls l', 5, 1, 'zsh'), {'ls localcommand', 16, {'localcommand'}}) end) end + + if has_bash then + it("completes command regardless of local directory (bash)", function() + assert.same(shell('true', 5, 1, 'bash'), {'true', 5, {'true'}}) + end) + end + if has_zsh then + it("completes command regardless of local directory (zsh)", function() + assert.same(shell('true', 5, 1, 'zsh'), {'true', 5, {'true'}}) + end) + end + it("completes command regardless of local directory (nil)", function() + assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}}) + end) end) describe("awful.completion.shell handles $SHELL", function()