Don't complete variables when single quoted. Fixes #1023

This commit is contained in:
ridiculousfish
2014-02-09 15:27:04 -08:00
parent 414530c9c2
commit 5ea7f52df2
2 changed files with 65 additions and 18 deletions

View File

@@ -1535,7 +1535,14 @@ static void test_complete(void)
complete(L"foobarbaz ", completions, COMPLETION_REQUEST_DEFAULT);
do_test(completions.size() == 1);
do_test(completions.at(0).completion == L"qux");
/* Don't complete variable names in single quotes (#1023) */
completions.clear();
complete(L"echo '$Foo", completions, COMPLETION_REQUEST_DEFAULT);
do_test(completions.empty());
completions.clear();
complete(L"echo \\$Foo", completions, COMPLETION_REQUEST_DEFAULT);
do_test(completions.empty());
complete_set_variable_names(NULL);
}