Skip to content

Commit

Permalink
Fix missing ellipsis at specific cases
Browse files Browse the repository at this point in the history
  • Loading branch information
bivashy committed Sep 15, 2024
1 parent 9755ed2 commit 5c86172
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/inlay_hint.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def format_inlay_hint_label(inlay_hint: InlayHint, session: Session, phantom_uui
})
result += f'<a href="{inlay_hint_click_command}">'
instruction_text = '\nDouble-click to insert' if has_text_edits else ""
truncated_label = label[:truncate_limit] + '...' if len(label) > truncate_limit else label
truncated_label = label[:truncate_limit] + '...' if len(label) >= truncate_limit else label
result += f'<span title="{(tooltip + instruction_text).strip()}">{html.escape(truncated_label)}</span>'
if is_clickable:
result += "</a>"
Expand All @@ -167,7 +167,7 @@ def format_inlay_hint_label(inlay_hint: InlayHint, session: Session, phantom_uui
})
value += f'<a href="{inlay_hint_click_command}">'
raw_label = label_part['value']
truncated_label = raw_label[:truncate_limit] + '...' if len(raw_label) > truncate_limit else raw_label
truncated_label = raw_label[:truncate_limit] + '...' if len(raw_label) >= truncate_limit else raw_label
truncate_limit -= len(raw_label)
value += html.escape(truncated_label)
if has_command:
Expand Down

0 comments on commit 5c86172

Please sign in to comment.