Skip to content

fix(textinput): slicing outside cap#532

Merged
bashbunni merged 3 commits intocharmbracelet:masterfrom
MikaelFangel:fix-textinput
Dec 5, 2024
Merged

fix(textinput): slicing outside cap#532
bashbunni merged 3 commits intocharmbracelet:masterfrom
MikaelFangel:fix-textinput

Conversation

@MikaelFangel
Copy link
Copy Markdown
Contributor

@MikaelFangel MikaelFangel commented May 30, 2024

Fixes: #531
Fixes: charmbracelet/gum#591

Changes

  • Manually assigned p with the size of the Width + 1 because when you use var() to assign, the cap defaults to 32 and thus it is possible to get out of bounds errors.

@MikaelFangel MikaelFangel requested a review from meowgorithm as a code owner May 30, 2024 11:15
@caarlos0 caarlos0 changed the title textinput: fix slicing outside cap fix(textinput): slicing outside cap Aug 13, 2024
@caarlos0 caarlos0 added the bug Something isn't working label Aug 13, 2024
Copy link
Copy Markdown
Contributor

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! can you add a test for it?

@MikaelFangel
Copy link
Copy Markdown
Contributor Author

Sure, I've added a test now that fails without the fix applied.

@MikaelFangel
Copy link
Copy Markdown
Contributor Author

@caarlos0 - Do I need to do anything else before it can be merged? 😄

@bashbunni bashbunni merged commit 8624776 into charmbracelet:master Dec 5, 2024
@bashbunni
Copy link
Copy Markdown
Contributor

@MikaelFangel thank you so much for identifying this and fixing it!

@MikaelFangel MikaelFangel deleted the fix-textinput branch December 5, 2024 22:09
@bashbunni bashbunni added this to the v0.21.0 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

3 participants