Skip to content

fix: handle gap for empty text #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 10, 2024
Merged

fix: handle gap for empty text #301

merged 2 commits into from
Nov 10, 2024

Conversation

lopi-py
Copy link
Contributor

@lopi-py lopi-py commented Nov 9, 2024

Problem:

If there is a component returning an empty string, the renderer will take it as non-empty and will add a gap:

windows = {
  autocomplete = {
    min_width = 1,
    draw = {
      columns = {
        { "label" },
        { "kind", "label_description", gap = 1 },
      },
    },
  },
}

In this case, label_description is empty but the renderer is adding a gap

image

Solution:

image
I have also removed the manual spacing within the kind and kind_icon components as it should be handled by the gap

lopi-py and others added 2 commits November 9, 2024 01:02
@Saghen Saghen merged commit 371ad28 into Saghen:main Nov 10, 2024
@Saghen
Copy link
Owner

Saghen commented Nov 10, 2024

Great work as always :)

@lopi-py lopi-py deleted the fix/gap-spacing branch November 11, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants