Skip to content

Conversation

@Perlence
Copy link
Contributor

@Perlence Perlence commented Jan 24, 2026

This PR fixes an issue with the cursor placement when the text fills the entire width. The cursor appears to be on the last character, but it's actually one character further. The solution is to reserve a column for the cursor and wrap the text one character early. When padding is set, allow the cursor to be displayed in the padding, which also makes the rendering logic simpler.

Here's the demonstration of the issue and the solution:

Screen.Recording.2026-01-24.at.17.12.44.mov

I also explored another option, which was to add a new line and put the cursor there, but it was a bit janky. Pressing Up in that state didn't move the cursor up to the second-to-last line, and the new line would disappear if you moved the cursor left. So, I didn't pursue it. You could probably make it work with enough determination, but I thought that was a bit too much.

@Perlence Perlence force-pushed the fix/reserve-col-for-cursor branch from 3170f67 to b5ab90f Compare January 24, 2026 13:47
@badlogic badlogic merged commit 4ab9b76 into badlogic:main Jan 24, 2026
1 check passed
@badlogic
Copy link
Owner

Thank you for your continued improvements of my sloppy editor implementation. Much appreciated!

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