✨ Allow configuring the line number font
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- swift
- Domain
- desktop-dev
Research direction
Start at SourceEditorConfiguration.Appearance.font and its didSetOnController handling, then inspect GutterView.font to understand how the ruler font is assigned. Add the proposed optional lineNumberFont API while preserving font.rulerFont as the default, and verify that consumers can override the gutter font without changing existing appearance behavior.
Written by the indexing model from the issue text.
Description
Description
SourceEditorConfiguration.Appearance.font configures the editor text font, but the line-number gutter replaces it with font.rulerFont in didSetOnController. There is currently no public API for choosing the exact font and point size used by line numbers.
A use case is an editor configured with Monaco 12 pt that should also render its line numbers in Monaco 12 pt. At present, this requires maintaining a fork and changing:
controller.gutterView.font = font.rulerFont
A backward-compatible API could be:
public var lineNumberFont: NSFont?
The current behavior could remain the default:
controller.gutterView.font = lineNumberFont ?? font.rulerFont
Alternatives Considered
- Making
GutterView.fontpublic. Keeping the option inAppearanceseems preferable because it avoids exposing the view implementation. - Always using
Appearance.fontfor the gutter. This would change the existing default appearance, so an optional override is safer.
Additional Context
This request is different from #58 and #157: those issues addressed the default ruler font appearance and proportional scaling. This request is specifically about allowing API consumers to override that default.
Observed on current main at revision 1fa4d3c.
Screenshots
Not applicable.
- Dominant language
- Swift
- Stars
- 720
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CodeEditApp/CodeEditSourceEditor
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 comment ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in CodeEditApp/CodeEditSourceEditor
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·