mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 13:01:21 -03:00
Correct highlighting of executed invalid commands
If you expand an abbreviation by executing the command, fish uses a synchronous mode of syntax highlighting that performs no I/O, because we want to highlight the abbreviation but don't know if it's valid or not without doing I/O. However we were doing this too aggressively, after every command regardless of whether it contained an abbreviation. Only do this for commands with abbreviations.
This commit is contained in:
@@ -3021,11 +3021,11 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
||||
bool abbreviation_expanded = expand_abbreviation_as_necessary(1);
|
||||
if (abbreviation_expanded && conf.syntax_check_ok) {
|
||||
command_test_result = reader_shell_test(parser(), el->text());
|
||||
// If the command is OK, then we're going to execute it. We still want to do
|
||||
// syntax highlighting on this newly changed command, but a synchronous variant
|
||||
// that performs no I/O, so as not to block the user.
|
||||
if (command_test_result == 0) super_highlight_me_plenty(true);
|
||||
}
|
||||
// If the command is OK, then we're going to execute it. We still want to do
|
||||
// syntax highlighting, but a synchronous variant that performs no I/O, so
|
||||
// as not to block the user.
|
||||
if (command_test_result == 0) super_highlight_me_plenty(true);
|
||||
}
|
||||
|
||||
if (command_test_result == 0) {
|
||||
|
||||
Reference in New Issue
Block a user