CodeEditApp / CodeEditApp/CodeEditSourceEditor

✨ Allow configuring the line number font

未關閉 適合新手
#376 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Swift
星號
719
分支
160
PR 合併指標
30 天內沒有已合併 PR

描述

### 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:

```swift
controller.gutterView.font = font.rulerFont
```

A backward-compatible API could be:

```swift
public var lineNumberFont: NSFont?
```

The current behavior could remain the default:

```swift
controller.gutterView.font = lineNumberFont ?? font.rulerFont
```

### Alternatives Considered

- Making `GutterView.font` public. Keeping the option in `Appearance` seems preferable because it avoids exposing the view implementation.
- Always using `Appearance.font` for 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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

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.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
swift
領域
desktop-dev
Issue 類型
功能
難度
2/5
預估耗時
1-3 小時
活躍度
活躍
描述清晰度
描述清楚
新手友好度
76/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。