Fix Linux text input navigation - #8
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a746b70fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf4e7911e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85256367eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6d7d8f8df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d6d7d8f to
51b3678
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51b3678860
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b136ed79d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b99fc0250
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5b99fc0 to
22dc0d5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22dc0d58fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if line_runes.len == 0 { | ||
| ranges << TextAreaLineRange{ | ||
| start: source_offsets[cursor] | ||
| end: source_offsets[cursor] | ||
| } | ||
| continue |
There was a problem hiding this comment.
Advance source offsets for rendered blank lines
When a text area contains an explicit blank line, this branch records the current cursor without advancing past the preceding newline. For one\n\ntwo, the blank rendered line is mapped to [3,3] instead of caret offset 4, so focused_text_area_line_index classifies a caret on that blank line as belonging to two; pressing Home can consequently move the caret forward to offset 5, and vertical navigation targets the wrong line. Track each paragraph separator when emitting empty-line ranges so consecutive blank lines receive distinct source positions.
Useful? React with 👍 / 👎.
| column := clamp_int(editor.selection.caret - ranges[current].start, 0, | ||
| ranges[current].end - ranges[current].start) | ||
| editor.move_caret_to(ranges[next].start + clamp_int(column, 0, | ||
| ranges[next].end - ranges[next].start), extend) |
There was a problem hiding this comment.
Retain the preferred column across vertical moves
When repeated Up/Down navigation crosses a shorter line, recomputing the column from the newly clamped caret permanently loses the original target column. For example, from column 5 in abcdef\nx\nabcdef, two Down presses land at column 1 of the final line rather than returning to column 5. Preserve a preferred vertical-navigation column until a horizontal movement or edit resets it.
Useful? React with 👍 / 👎.
| if focused_text_area && (navigation_key == 'up' || navigation_key == 'down') { | ||
| if move_focused_text_area_caret(mut editor, if navigation_key == 'up' { -1 } else { 1 }, | ||
| modifiers & u32(gg.Modifier.shift) != 0) { | ||
| g_text_editors[g_focused_field] = editor | ||
| } | ||
| return |
There was a problem hiding this comment.
Honor Command with vertical arrows on macOS
In custom-rendered macOS text areas, this branch handles Up/Down and returns before considering that Command is the primary modifier. As a result, Command+Up/Down moves only one rendered line instead of navigating to the document beginning/end, unlike the platform behavior already implemented for Command with horizontal arrows. Handle the Command boundary shortcut before dispatching ordinary vertical movement.
Useful? React with 👍 / 👎.
Closes #5
Adds modifier-aware cursor navigation for the GG/Linux renderer:
Verification:
Focused runtime tests are included. Linux runtime execution requires EGL headers/runtime unavailable on this macOS host.