Skip to content

Fix Linux text input navigation - #8

Merged
medvednikov merged 8 commits into
masterfrom
fix/issue-5-input-navigation
Sep 10, 2026
Merged

Fix Linux text input navigation#8
medvednikov merged 8 commits into
masterfrom
fix/issue-5-input-navigation

Conversation

@medvednikov

Copy link
Copy Markdown
Member

Closes #5

Adds modifier-aware cursor navigation for the GG/Linux renderer:

  • Shift+arrows, Home/End, and Page keys extend selections
  • Ctrl+Left/Right use Unicode-aware word boundaries
  • Ctrl+A selects all
  • Page Up/Down move to field boundaries

Verification:

  • V shared Linux backend check passed
  • formatting and diff validation passed

Focused runtime tests are included. Linux runtime execution requires EGL headers/runtime unavailable on this macOS host.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T09:02:02.817286Z 22dc0d5 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/ui_immediate.c.v Outdated
Comment thread ui/text_editor.v

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/ui_immediate.c.v
Comment thread ui/text_editor.v

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/ui_immediate.c.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/ui_immediate.c.v
Comment thread ui/text_editor.v Outdated
@medvednikov
medvednikov force-pushed the fix/issue-5-input-navigation branch from d6d7d8f to 51b3678 Compare September 10, 2026 04:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/text_editor_test.v Outdated
Comment thread ui/ui_immediate.c.v Outdated
Comment thread ui/text_editor.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/ui_immediate.c.v
Comment thread ui/text_editor.v Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/ui_scroll_immediate.c.v Outdated
Comment thread ui/ui_immediate.c.v
Comment thread ui/text_editor.v
@medvednikov
medvednikov force-pushed the fix/issue-5-input-navigation branch from 5b99fc0 to 22dc0d5 Compare September 10, 2026 08:56

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +258 to +263
if line_runes.len == 0 {
ranges << TextAreaLineRange{
start: source_offsets[cursor]
end: source_offsets[cursor]
}
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +314 to +317
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread ui/ui_immediate.c.v
Comment on lines +1078 to +1083
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@medvednikov
medvednikov merged commit 229f689 into master Sep 10, 2026
0 of 10 checks passed
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.

Input field navigation on Linux

1 participant