================
@@ -521,8 +518,41 @@ static void selectInterestingSourceRegion(std::string
&SourceLine,
if (BackColumnsRemoved > Columns(BackEllipse.size()))
SourceLine.replace(SourceEnd.V, std::string::npos, BackEllipse);
+ // Since we've modified the SourceLine, we also need to adjust the line's
+ // highlighting information. In particular, if we've removed
+ // from the front of the line, we need to move the style ranges to the
+ // left and remove unneeded ranges.
+ Columns FrontDiff = FrontColumnsRemoved > FrontEllipse.size()
+ ? FrontColumnsRemoved - FrontEllipse.size()
+ : 0;
+ Columns CodeStart = FrontColumnsRemoved > FrontEllipse.size()
+ ? FrontEllipse.size()
+ : FrontColumnsRemoved;
----------------
Sirraide wrote:
I think we should be able to use `std::min`/`std::max` for these.
https://github.com/llvm/llvm-project/pull/164941
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits