Skip to content

Fix hints sometimes matching next line as part of URL#5450

Merged
kovidgoyal merged 1 commit into
kovidgoyal:masterfrom
trygveaa:fix/hints-next-line
Aug 31, 2022
Merged

Fix hints sometimes matching next line as part of URL#5450
kovidgoyal merged 1 commit into
kovidgoyal:masterfrom
trygveaa:fix/hints-next-line

Conversation

@trygveaa

Copy link
Copy Markdown
Contributor

For URLs where there's fewer characters left to the right edge of the
window than the number of escape characters in the line, the next line
would be included in the URL, as if the URL went all the way to the
right edge.

For example with a 40 chars wide terminal, if you run:

echo -e '\e[31m1\e[m https://github.com/kovidgoyal/kitty\ntest'

And launch the hints kitten, you'll see that test on the next line will
be included in the URL.

This happened because the calculation for filling the rest of the line
with NUL characters counted the escape characters as well as the visible
characters, so it filled in too few characters.

This is a regression introduced in commit 9196671.

For URLs where there's fewer characters left to the right edge of the
window than the number of escape characters in the line, the next line
would be included in the URL, as if the URL went all the way to the
right edge.

For example with a 40 chars wide terminal, if you run:

    echo -e '\e[31m1\e[m https://github.com/kovidgoyal/kitty\ntest'

And launch the hints kitten, you'll see that test on the next line will
be included in the URL.

This happened because the calculation for filling the rest of the line
with NUL characters counted the escape characters as well as the visible
characters, so it filled in too few characters.

This is a regression introduced in commit 9196671.
@kovidgoyal kovidgoyal merged commit b978ff8 into kovidgoyal:master Aug 31, 2022
@trygveaa trygveaa deleted the fix/hints-next-line branch August 31, 2022 08:20
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