Gnome: highlight cursor line only while editing#132
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_linewas enabled unconditionally (in both thelanguagesetter andupdateStyle()). On wide layouts the highlight only became visible after hover triggered a redraw, matching the reported behavior.Fix (two parts)
editablesetter, thelanguagesetter andupdateStyle()— the editor keeps its highlight, read-only views never show one.:readonlyin the MDX were rendered read-only; the:copyableexample 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.