Properly colorize multi-part suggestions in the same line

Fix #108547.
This commit is contained in:
Esteban Küber
2023-03-01 22:33:57 +00:00
parent 5423745db8
commit 6fd175185e
4 changed files with 71 additions and 6 deletions

View File

@@ -331,7 +331,7 @@ impl CodeSuggestion {
});
buf.push_str(&part.snippet);
let cur_hi = sm.lookup_char_pos(part.span.hi());
if prev_hi.line == cur_lo.line && cur_hi.line == cur_lo.line {
if cur_hi.line == cur_lo.line {
// Account for the difference between the width of the current code and the
// snippet being suggested, so that the *later* suggestions are correctly
// aligned on the screen.