Skip to content

Route macOS editor navigation through sequenced input commands - #6027

Open
shai-almog wants to merge 2 commits into
masterfrom
mac-editor-navigation
Open

shai-almog wants to merge 2 commits into
masterfrom
mac-editor-navigation

Conversation

@shai-almog

@shai-almog shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

AppKit word/page navigation was swallowed for TextInputClient editors, and line commands used newline boundaries instead of the editor's visual layout. Reversed Java selections also collapsed when copied into AppKit, so later native character movement or typing could target the wrong range.

Route word movement/deletion, visual line/paragraph/document boundaries, and page/scroll-page selectors through the existing sequenced editor-command dispatcher. Preserve anchor/focus direction alongside AppKit's ordered range, including transitions between semantic word movement and native character movement. Handle AppKit paragraph selectors and the forward/backward steps in its Option-Up/Down key bindings. Update EditorView paragraph/document boundaries and word-deletion handling and document the contract in the developer guide. Legacy TextArea command handling remains on its existing path.

Validation:

  • 16 focused editor input/session tests pass against current master with Java 8; Maven verify including static analysis passes.
  • Local core verification on the application's merged framework baseline ran 7,814 tests: one analytics test timed out during setup. Its complete eight-test class passed on rerun; the subsequent Maven verify, including static analysis, passed. The original full-suite failure is retained rather than reported as a clean full-suite pass.
  • Local Maven/ParparVM ARM64 macOS app build passes. The changed runtime sources match this branch byte-for-byte. The first build passed twelve native keyboard checks covering reversed selection/replacement, mixed word/character commands, deletion/undo, document and wrapped-line boundaries, preferred column, and Page Up/Down/selection. The paragraph follow-up build passes twelve paragraph-selection/typing-undo/paste checks and twenty comparison/Mailings regressions, with the original document restored exactly.
  • Guide structure, API names, cross-references and Vale pass. No native CI job was dispatched or added.

These checks do not certify every input method, bidi/grapheme behavior, or all application workflows.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@github-actions

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

@shai-almog

shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 170 screenshots: 170 matched.

Native Android coverage

  • 📊 Line coverage: 16.01% (26002/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122147/850229), branch 9.91% (8466/85441), complexity 7.81% (6525/83503), method 11.59% (4648/40094), class 19.78% (960/4853)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 16.01% (26002/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122147/850229), branch 9.91% (8466/85441), complexity 7.81% (6525/83503), method 11.59% (4648/40094), class 19.78% (960/4853)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 201ms / native 193ms = 1.0x speedup
SIMD float-mul (64K x300) java 134ms / native 99ms = 1.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 89.000 ms
Base64 CN1 decode 87.000 ms
Base64 native encode 527.000 ms
Base64 encode ratio (CN1/native) 0.169x (83.1% faster)
Base64 native decode 313.000 ms
Base64 decode ratio (CN1/native) 0.278x (72.2% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ✅ ByteCodeTranslator: 0 findings (no issues)
    • ✅ android: 0 findings (no issues)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ project-model: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port (x64 / Intel-AMD): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, SSE2 SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 43ms / native 3ms = 14.3x speedup
SIMD float-mul (64K x300) java 52ms / native 2ms = 26.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 60.000 ms
Base64 CN1 decode 73.000 ms
Base64 SIMD encode 91.000 ms
Base64 encode ratio (SIMD/CN1) 1.517x (51.7% slower)
Base64 SIMD decode 82.000 ms
Base64 decode ratio (SIMD/CN1) 1.123x (12.3% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 21.000 ms
Image applyMask (SIMD on) 22.000 ms
Image applyMask ratio (SIMD on/off) 1.048x (4.8% slower)
Image modifyAlpha (SIMD off) 27.000 ms
Image modifyAlpha (SIMD on) 20.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.741x (25.9% faster)
Image modifyAlpha removeColor (SIMD off) 36.000 ms
Image modifyAlpha removeColor (SIMD on) 22.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.611x (38.9% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: AMD64 Family 25 Model 17 Stepping 1, AuthenticAMD (baseline windows-x64@amd64-family-25-model-17-authenticamd)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.32x (base 1.38x, -3.8%) 0.72x (base 0.83x, -13.1%) ok
translator (self) 4 0.80x (base 0.78x, +3.1%) 0.54x (base 0.55x, -2.8%) ok
intArithmetic 4 1.10x (base 1.10x, +0.4%) 0.05x (base 0.06x, -2.7%) ok
longArithmetic 4 1.08x (base 1.08x, +0.0%) 0.05x (base 0.06x, -0.7%) ok
mathTranscendental 4 0.84x (base 0.85x, -0.8%) 0.06x (base 0.06x, -1.6%) ok
arraySequential 4 1.72x (base 1.72x, +0.4%) 0.38x (base 0.38x, +0.2%) ok
arrayRandom 4 1.03x (base 1.01x, +1.5%) 0.23x (base 0.23x, +0.2%) ok
objectAllocation 4 1.26x (base 1.25x, +0.4%) 0.27x (base 0.29x, -7.4%) ok
valueEscape 4 0.10x (base 0.10x, -1.4%) 0.05x (base 0.04x, +1.5%) ok
hashMapChurn 4 1.33x (base 1.39x, -4.1%) 0.10x (base 0.10x, -1.1%) ok
stringBuilding 4 1.39x (base 1.36x, +2.3%) 0.27x (base 0.28x, -4.3%) ok
recursion 4 1.38x (base 1.43x, -3.5%) 0.06x (base 0.06x, +0.9%) ok
quicksort 4 1.11x (base 1.11x, -0.3%) 0.12x (base 0.12x, -0.2%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Windows port (arm64 / Apple Silicon - Arm): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, NEON SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 48ms / native 3ms = 16.0x speedup
SIMD float-mul (64K x300) java 48ms / native 3ms = 16.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 61.000 ms
Base64 CN1 decode 70.000 ms
Base64 SIMD encode 78.000 ms
Base64 encode ratio (SIMD/CN1) 1.279x (27.9% slower)
Base64 SIMD decode 70.000 ms
Base64 decode ratio (SIMD/CN1) 1.000x (0.0% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 6.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 21.000 ms
Image applyMask (SIMD on) 20.000 ms
Image applyMask ratio (SIMD on/off) 0.952x (4.8% faster)
Image modifyAlpha (SIMD off) 17.000 ms
Image modifyAlpha (SIMD on) 14.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.824x (17.6% faster)
Image modifyAlpha removeColor (SIMD off) 21.000 ms
Image modifyAlpha removeColor (SIMD on) 14.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.667x (33.3% faster)

ParparVM vs HotSpot (JDK 25): Windows arm64

Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline windows-arm64@armv8-64-bit-family-8-model-d49-microsoft-corporation)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.10x (base 1.11x, -0.4%) 1.19x (base 0.97x, +22.3%) ok
translator (self) 4 0.84x (base 0.84x, +0.3%) 0.50x (base 0.51x, -2.3%) ok
intArithmetic 4 1.04x (base 1.04x, +0.0%) 0.06x (base 0.06x, +1.6%) ok
longArithmetic 4 0.79x (base 0.80x, -0.3%) 0.06x (base 0.06x, +1.9%) ok
mathTranscendental 4 0.71x (base 0.72x, -1.0%) 0.06x (base 0.06x, +0.3%) ok
arraySequential 4 0.36x (base 0.46x, -21.0%) 0.39x (base 0.39x, +0.0%) ok
arrayRandom 4 0.94x (base 0.94x, +0.8%) 0.23x (base 0.23x, +0.1%) ok
objectAllocation 4 1.80x (base 2.81x, -35.8%) 0.33x (base 0.43x, -24.2%) ok
valueEscape 4 0.76x (base 0.76x, +0.0%) 0.05x (base 0.05x, +2.3%) ok
hashMapChurn 4 0.99x (base 0.98x, +0.4%) 0.12x (base 0.12x, +0.1%) ok
stringBuilding 4 1.53x (base 1.43x, +7.0%) 0.27x (base 0.27x, -0.5%) ok
recursion 4 1.44x (base 1.46x, -1.7%) 0.06x (base 0.07x, -0.2%) ok
quicksort 4 1.01x (base 1.00x, +1.3%) 0.12x (base 0.12x, +0.0%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Linux port (x64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub x64 runner. Baseline: scripts/linux/screenshots.

ParparVM vs HotSpot (JDK 25): Linux x64

Runner CPU: AMD EPYC 9V45 96-Core Processor (baseline linux-x64@amd-epyc-9v45-96-core-processor)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 1.02x (base 0.95x, +7.4%) 0.93x (base 0.86x, +8.0%) ok
translator (self) 4 0.68x (base 0.64x, +5.6%) 0.46x (base 0.45x, +2.0%) ok
intArithmetic 4 1.00x (base 1.00x, +0.0%) 0.05x (base 0.07x, -27.2%) ok
longArithmetic 4 0.99x (base 0.99x, -0.0%) 0.05x (base 0.07x, -26.8%) ok
mathTranscendental 4 1.19x (base 1.19x, +0.1%) 0.08x (base 0.08x, +1.4%) ok
arraySequential 4 2.84x (base 3.38x, -16.1%) 0.37x (base 0.36x, +5.1%) ok
arrayRandom 4 1.03x (base 1.02x, +1.0%) 0.21x (base 0.21x, -0.0%) ok
objectAllocation 4 1.58x (base 1.61x, -1.7%) 0.30x (base 0.24x, +24.3%) ok
valueEscape 4 0.10x (base 0.10x, +0.5%) 0.04x (base 0.04x, +2.6%) ok
hashMapChurn 4 1.36x (base 1.21x, +12.8%) 0.09x (base 0.09x, +0.2%) ok
stringBuilding 4 1.61x (base 1.56x, +3.1%) 0.22x (base 0.26x, -16.4%) ok
recursion 4 1.35x (base 1.35x, +0.1%) 0.06x (base 0.07x, -25.4%) ok
quicksort 4 1.06x (base 1.06x, +0.1%) 0.11x (base 0.11x, +0.8%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 matched.
Native Linux port (arm64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub arm64 runner. Baseline: scripts/linux/screenshots-arm.

ParparVM vs HotSpot (JDK 25): Linux arm64

Runner CPU: Neoverse-N2 (baseline linux-arm64@neoverse-n2)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 1.01x (base 0.93x, +8.8%) 0.94x (base 0.87x, +8.5%) ok
translator (self) 4 0.74x (base 0.70x, +5.7%) 0.47x (base 0.45x, +5.5%) ok
intArithmetic 4 1.04x (base 1.04x, -0.1%) 0.03x (base 0.03x, -1.6%) ok
longArithmetic 4 0.79x (base 0.79x, -0.1%) 0.03x (base 0.03x, -2.3%) ok
mathTranscendental 4 1.10x (base 1.10x, -0.0%) 0.03x (base 0.03x, +0.8%) ok
arraySequential 4 0.36x (base 0.36x, -1.8%) 0.37x (base 0.37x, +0.3%) ok
arrayRandom 4 0.94x (base 0.94x, +0.4%) 0.20x (base 0.20x, -0.1%) ok
objectAllocation 4 1.91x (base 1.77x, +7.9%) 0.38x (base 0.38x, -0.0%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, -1.1%) ok
hashMapChurn 4 0.84x (base 0.84x, -0.3%) 0.12x (base 0.12x, +2.0%) ok
stringBuilding 4 1.47x (base 1.36x, +7.9%) 0.26x (base 0.26x, -0.1%) ok
recursion 4 1.42x (base 1.43x, -1.1%) 0.03x (base 0.04x, -2.1%) ok
quicksort 4 1.00x (base 0.99x, +0.9%) 0.09x (base 0.09x, +1.2%) ok

Result: no regression

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T06:48:02.664888Z 73d5950 Manual request
ℹ️ 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: 73d5950071

ℹ️ 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".

@Override
public TextInputState getEditingState() {
return new TextInputState(doc.getText(), getSelectionStart(), getSelectionEnd(), composingStart, composingEnd);
return new TextInputState(doc.getText(), anchor < 0 ? caret : anchor, caret, composingStart, composingEnd);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Normalize reversed selections in every input bridge

When a user creates a backward selection, this now publishes anchor/focus values such as (13, 0) to every platform, but only the macOS bridge was updated for that ordering. The JavaScript bridge writes these directly through setSelectionStart() and setSelectionEnd() (HTML5Implementation.java:4307-4310), which collapses a reversed DOM selection, while Android's deleteSurroundingText() forces the end to be at least the start (CN1TextInputConnection.java:136-140), so soft-keyboard deletion targets the wrong range or does nothing. Preserve the previous ordered state for those ports or update all consumers to normalize while retaining direction before globally emitting anchor/focus.

Useful? React with 👍 / 👎.

Comment on lines +2234 to +2237
} else if ([name isEqualToString:@"pageUp:"] || [name isEqualToString:@"scrollPageUp:"]) {
command = 7;
} else if ([name isEqualToString:@"pageDown:"] || [name isEqualToString:@"scrollPageDown:"]) {
command = 8;

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 Keep scroll-page selectors from moving the caret

When AppKit emits scrollPageUp: or scrollPageDown:, these branches translate it into KEY_PAGE_UP/DOWN, whose handler calls moveCaret() (EditorView.java:2021-2025) and therefore changes the insertion point and selection. AppKit defines the scrollPage* selectors as scrolling the content rather than editing the selection (Apple NSStandardKeyBindingResponding), so a plain Page Up/Down binding can unexpectedly relocate the caret and subsequent typing instead of only scrolling the viewport. Route these selectors to a scroll-only operation rather than grouping them with caret page commands.

Useful? React with 👍 / 👎.

Comment on lines +2028 to +2029
if (word && !hasSelection() && editable) {
replaceRange(wordLeft(), caret, "", true);

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 Use Unicode boundaries for routed word deletion

When Option-Backspace/Delete is used on non-ASCII prose, these new branches call wordLeft()/wordRight(), but isWordChar() at EditorView.java:1748-1749 recognizes only ASCII letters, digits, and underscore. For text containing only Greek, Arabic, or CJK words, whitespace and every letter are all classified identically as non-word characters, so one word-deletion command can consume everything to the document boundary instead of one word. Use Unicode-aware word boundaries before exposing these helpers through AppKit's deleteWord* selectors.

Useful? React with 👍 / 👎.

Comment on lines +2028 to +2029
if (word && !hasSelection() && editable) {
replaceRange(wordLeft(), caret, "", true);

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 Skip empty word deletions at document boundaries

When Option-Backspace is pressed at offset 0 (or Option-Delete at the document end), wordLeft()/wordRight() returns the current caret and this branch still calls replaceRange() with an empty range. That method unconditionally records an undo entry, clears the redo stack, invokes editorChanged(), and pushes input state even though no text changed, so a boundary keypress can discard valid redo history and leave the next Undo appearing to do nothing. Guard against equal range endpoints before invoking replaceRange().

Useful? React with 👍 / 👎.

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.

1 participant