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!
This commit is contained in:
parent
51e5381b67
commit
7ab57e1953
|
@ -182,6 +182,17 @@ describe("awful.completion.shell", function()
|
||||||
assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}})
|
assert.same(shell('true', 5, 1, nil), {'true', 5, {'true'}})
|
||||||
end)
|
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
|
if has_bash then
|
||||||
it("completes local directories starting with ./ (bash)", function()
|
it("completes local directories starting with ./ (bash)", function()
|
||||||
assert.same(shell('./just', 7, 1, 'bash'), {'./just_a_directory/', 20, {'./just_a_directory/'}})
|
assert.same(shell('./just', 7, 1, 'bash'), {'./just_a_directory/', 20, {'./just_a_directory/'}})
|
||||||
|
|
Loading…
Reference in New Issue