Skip to content

fix(tui): restore cursorUp line-start jump before history browsing#5789

Merged
vegarsti merged 1 commit into
earendil-works:mainfrom
4h9fbZ:fix/restore-cursorUp-start-of-line-jump
Jun 16, 2026
Merged

fix(tui): restore cursorUp line-start jump before history browsing#5789
vegarsti merged 1 commit into
earendil-works:mainfrom
4h9fbZ:fix/restore-cursorUp-start-of-line-jump

Conversation

@4h9fbZ

@4h9fbZ 4h9fbZ commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

PR #1050 added editor boundary behavior where pressing Up on the first visual line of non-empty input jumps to the start of the line instead of doing nothing. Commit e4907b3b fixed draft restoration for prompt-history browsing, but changed cursorUp to always enter history whenever history exists. That made the start-of-line jump path unreachable for non-empty input with history.

This keeps both behaviors:

  • If the editor is non-empty and the cursor is not at the start, Up jumps to the start of the current line.
  • If the editor is empty, already browsing history, or the cursor is already at column 0 on the first visual line, Up enters/navigates history.
  • Draft restoration from e4907b3b is preserved: after entering history from a draft, Down restores the draft state.

Tests were updated to cover the two-step non-empty flow: first Up jumps to the start of the draft, second Up enters history, and Down restores the draft.

@4h9fbZ 4h9fbZ force-pushed the fix/restore-cursorUp-start-of-line-jump branch from b62ec52 to 0d10cb6 Compare June 16, 2026 03:41
@4h9fbZ 4h9fbZ changed the title fix(tui): restore cursorUp start-of-line jump when input is non-empty fix(tui): restore cursorUp line-start jump before history browsing Jun 16, 2026
@vegarsti vegarsti merged commit 3039f3e into earendil-works:main Jun 16, 2026
1 check passed
@vegarsti

Copy link
Copy Markdown
Member

@4h9fbZ Thanks a lot! I agree that e4907b3 regressed the behaviour you added earlier in #1050, and I've confirmed the behavior is back with this change.

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