mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 07:16:25 +08:00
Highlight incorrect use of command or exec
This commit is contained in:
parent
e3ea953ff4
commit
6aebeca1d0
@ -1035,7 +1035,7 @@ static void tokenize(const wchar_t * const buff, std::vector<int> &color, const
|
|||||||
bool is_cmd = false;
|
bool is_cmd = false;
|
||||||
int is_subcommand = 0;
|
int is_subcommand = 0;
|
||||||
int mark = tok_get_pos(&tok);
|
int mark = tok_get_pos(&tok);
|
||||||
color.at(tok_get_pos(&tok)) = HIGHLIGHT_COMMAND;
|
color.at(tok_get_pos(&tok)) = use_builtin ? HIGHLIGHT_COMMAND : HIGHLIGHT_ERROR;
|
||||||
|
|
||||||
if (parser_keywords_is_subcommand(cmd))
|
if (parser_keywords_is_subcommand(cmd))
|
||||||
{
|
{
|
||||||
@ -1048,7 +1048,7 @@ static void tokenize(const wchar_t * const buff, std::vector<int> &color, const
|
|||||||
use_command = 0;
|
use_command = 0;
|
||||||
use_builtin = 1;
|
use_builtin = 1;
|
||||||
}
|
}
|
||||||
else if (cmd == L"command")
|
else if (cmd == L"command" || cmd == L"exec")
|
||||||
{
|
{
|
||||||
use_command = 1;
|
use_command = 1;
|
||||||
use_function = 0;
|
use_function = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user