Skip to content

Gnome: highlight cursor line only while editing#132

Merged
JumpLink merged 2 commits into
mainfrom
fix/130-readonly-line-highlight
Jun 12, 2026
Merged

Gnome: highlight cursor line only while editing#132
JumpLink merged 2 commits into
mainfrom
fix/130-readonly-line-highlight

Conversation

@JumpLink

@JumpLink JumpLink commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Fixes #130

Problem

The last line of every tutorial code block was highlighted like a selection — the idle text cursor sits at the buffer end and highlight_current_line was enabled unconditionally (in both the language setter and updateStyle()). On wide layouts the highlight only became visible after hover triggered a redraw, matching the reported behavior.

Fix (two parts)

  1. Gnome: the cursor-line highlight is now tied to the editable state via a single helper, called from the editable setter, the language setter and updateStyle() — the editor keeps its highlight, read-only views never show one.
  2. Learn: only blocks explicitly marked :readonly in the MDX were rendered read-only; the :copyable example blocks were silently editable (you could type into them), so part 1 alone did not cover them. MDX code blocks are documentation — they now always render read-only; the only editable SourceView is the editor itself.

Note: the Android renderer (ns-code) has the same editable-by-default behavior; whether it needs the same treatment is part of the broader Android RTL/tutorial follow-up.

Verification

Manually tested (Hebrew + German): no tutorial block shows a highlighted last line (also not after hover), tutorial blocks no longer accept text input, the editor keeps its cursor-line highlight, and copy-to-editor still works.

JumpLink added 2 commits June 11, 2026 18:20
highlight_current_line was enabled unconditionally, so read-only
tutorial code blocks showed their last line highlighted like a
selection (the idle cursor sits at the buffer end). Tie the
highlight to the editable state instead.

Fixes #130
Only blocks explicitly marked :readonly in the MDX were rendered
read-only; the :copyable example blocks were silently editable, so
the cursor-line fix did not apply to them and their last line still
looked selected. MDX code blocks are documentation — the only
editable SourceView is the editor itself.
@JumpLink JumpLink merged commit 8e3b755 into main Jun 12, 2026
3 checks passed
@JumpLink JumpLink deleted the fix/130-readonly-line-highlight branch June 12, 2026 07:02
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.

last line is highlighted

1 participant