// If the end of the interesting region comes before we run out of
// space in the terminal, start at the beginning of the line.
- if (CaretEnd < Columns - 3)
+ if (Columns > 3 && CaretEnd < Columns - 3)
CaretStart = 0;
- unsigned TargetColumns = Columns - 8; // Give us extra room for the ellipses.
+ unsigned TargetColumns = Columns;
+ if (TargetColumns > 8)
+ TargetColumns -= 8; // Give us extra room for the ellipses.
unsigned SourceLength = SourceLine.size();
while ((CaretEnd - CaretStart) < TargetColumns) {
bool ExpandedRegion = false;
// FIXME: This diagnostic is getting truncated very poorly.
// RUN: grep -e '^ ...// some long comment text and a brace, eh {} ' %t.msg &&
// RUN: grep -e '^ \^' %t.msg &&
-
+// RUN: clang -fsyntax-only -fmessage-length=1 %s &&
// RUN: true
// Hack so we can check things better, force the file name and line.