aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-16 16:52:23 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-16 16:52:23 -0800
commit3e9153d955aa2e908f1dd661c8b91556ca8e0ee8 (patch)
tree71e1d1c592d727181a9eaee53b9355ba7c6194e4 /parser.cpp
parent0e421ea31dd8293c64960912ab9651b2a3b2b07d (diff)
Clean up some error messages. Don't show the line in the error message
if it's the first line and we're interactive, since then it's obvious
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/parser.cpp b/parser.cpp
index ee6948a8..59d0f51b 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -2922,10 +2922,13 @@ void parser_t::get_backtrace(const wcstring &src, const parse_error_list_t &erro
}
else
{
- append_format(*output, L"fish: %ls:", _(L"Error:"));
+ output->append(L"fish: ");
}
- output->append(err.describe(src));
+ // Don't include the caret if we're interactive, this is the first line of text, and our source is at its beginning, because then it's obvious
+ bool skip_caret = (get_is_interactive() && which_line == 1 && err.source_start == 0);
+
+ output->append(err.describe(src, skip_caret));
output->push_back(L'\n');
this->stack_trace(current_block, *output);