mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 07:47:09 +08:00
fix a regression involving parser error output
The code for reporting parser errors needs a major overhaul. But rather than do that I'm going to add another hack in the hope that this doesn't introduce yet another problem. Fixes #4221
This commit is contained in:
parent
ed38db3370
commit
5e2c14e7be
@ -29,9 +29,10 @@ static bool production_is_empty(const production_element_t *production) {
|
||||
/// Returns a string description of this parse error.
|
||||
wcstring parse_error_t::describe_with_prefix(const wcstring &src, const wcstring &prefix,
|
||||
bool is_interactive, bool skip_caret) const {
|
||||
if (skip_caret && this->text.empty()) return L"";
|
||||
|
||||
wcstring result = prefix;
|
||||
result.append(this->text);
|
||||
|
||||
if (skip_caret || source_start >= src.size() || source_start + source_length > src.size()) {
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user