Skip to content

Completion panel width does not adapt to font size #1987

@deathaxe

Description

@deathaxe

Summary

The algorithm to calculate the required width to display all completions is somehow broken.

possibly related to #633

Expected behavior

Completion panel should correctly adapt to the longest item being displayed for all "font_size" and "dpi_scale" values.

Actual behavior

  1. The completion panel cuts off some completion labels, if the initial displayed ones are very short.
  2. The completion panel width is calculated without respect of active font_size. (didn't check dpi_scale)

font_size: 9 --> width: 303px

screenshot

font_size: 17 --> width: 303px

screenshot

Steps to reproduce

  1. Open a file which makes use of some *.sublime-completions
  2. Set font_size: 9
  3. Enter some text to trigger completions
  4. See completion panel showing enough space and remember its width
  5. Change font_size: 19 or higher
  6. Enter the same text as before to trigger completions again
  7. See completion panel being smaller and text being cut off. Hints are most likely not to be displayed at all.

Environment

  • Operating system and version:
    • Windows 10 x64 1703
  • Monitor:
    • Resolution 1900x1200
    • dpi_scale used in ST 1.0
  • Sublime Text:
    • Build 3143 ... 3147
    • 64 bit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions