Skip to content

Commit

Permalink
Removes unnecessary padidng when rendering suggestion (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
dingfeli authored Nov 21, 2024
1 parent 7afa3ec commit e413706
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void render(final GC gc, final int currentCaretOffset) {
// educated guess:
int endPadding = gc.getAdvanceWidth(symbol) / 4;
y = (invocationLine + lineInSuggestion + 1) * lineHt - fontHt;
x = gc.textExtent(text).x + endPadding;
x = gc.textExtent(text).x;
if (lineInSuggestion == 0) {
x += widget.getLocationAtOffset(invocationOffset).x;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void render(final GC gc, final int currentCaretOffset) {
textToRender = text;
x = widget.getLeftMargin();
} else {
x = gc.textExtent(text.substring(0, idxInLine)).x + gc.textExtent(" ").x / 4;
x = gc.textExtent(text.substring(0, idxInLine)).x;
textToRender = text.substring(idxInLine);
}

Expand Down

0 comments on commit e413706

Please sign in to comment.