Highlight %self as an operator

This commit is contained in:
ridiculousfish
2018-10-10 16:25:21 -07:00
parent d73c487d60
commit 5fa4e0d2ee
2 changed files with 15 additions and 3 deletions

View File

@@ -2472,7 +2472,6 @@ static void test_complete() {
do_test(completions.at(1).completion == L"zero");
do_test((completions.at(1).flags & COMPLETE_NO_SPACE) != 0);
// Test wraps.
do_test(comma_join(complete_get_wrap_targets(L"wrapper1")) == L"");
complete_add_wrapper(L"wrapper1", L"wrapper2");
@@ -4086,6 +4085,13 @@ static void test_highlighting() {
{L"end", highlight_spec_command},
});
highlight_tests.push_back({
{L"echo", highlight_spec_command},
{L"%self", highlight_spec_operator},
{L"not%self", highlight_spec_param},
{L"self%not", highlight_spec_param},
});
// Verify variables and wildcards in commands using /bin/cat.
env_set(L"VARIABLE_IN_COMMAND", ENV_LOCAL, {L"a"});
env_set(L"VARIABLE_IN_COMMAND2", ENV_LOCAL, {L"at"});