Skip to content
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

Text elements using strings that include newlines breaks the display #313

Open
FireIsGood opened this issue Nov 14, 2024 · 0 comments · May be fixed by #314
Open

Text elements using strings that include newlines breaks the display #313

FireIsGood opened this issue Nov 14, 2024 · 0 comments · May be fixed by #314

Comments

@FireIsGood
Copy link
Contributor

When using a layout element of type = "text" with the val of a string including a newline \n character, the display is broken.

Test cases with local copy on newest commit:

  {
    dir = "~/Documents/Programming/alpha-nvim",
    config = function()
      local dashboard = require("alpha.themes.dashboard")

      -- No newline
      -- dashboard.section.header.val = "The quick brown fox jumped over the lazy dog"

      -- With \n
      -- dashboard.section.header.val = "The quick brown fox\njumped over the lazy dog"

      -- With table of strings:
      -- dashboard.section.header.val = { "The quick brown fox", "jumped over the lazy dog" }

      require("alpha").setup(dashboard.config)
    end,
  }

Expected Behavior

Strings with newline characters \n should not break the display.

Fix as simulated via table of strings:

image
Noting wrong

Actual Behavior

Strings with the newline character break the display.

image
Broken highlights and cursor is offset

@FireIsGood FireIsGood linked a pull request Nov 14, 2024 that will close this issue
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 a pull request may close this issue.

1 participant