diff --git a/plugin/inlay_hint.py b/plugin/inlay_hint.py index 24834edc1..65ff4fbe2 100644 --- a/plugin/inlay_hint.py +++ b/plugin/inlay_hint.py @@ -143,7 +143,7 @@ def format_inlay_hint_label(inlay_hint: InlayHint, session: Session, phantom_uui }) result += f'' 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'{html.escape(truncated_label)}' if is_clickable: result += "" @@ -167,7 +167,7 @@ def format_inlay_hint_label(inlay_hint: InlayHint, session: Session, phantom_uui }) value += f'' 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: