mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-10-26 19:10:11 +03:00
Fix line number display with markedText (fix #882)
This commit is contained in:
parent
ce19977137
commit
bcda6405a7
@ -2,6 +2,15 @@
|
||||
Change Log
|
||||
==========================
|
||||
|
||||
3.6.9 (unreleased)
|
||||
--------------------------
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where some of line numbers disappeared on macOS 10.13 (and earlier?) when Japanese text is being input.
|
||||
|
||||
|
||||
|
||||
3.6.8 (303)
|
||||
--------------------------
|
||||
|
||||
|
@ -52,8 +52,9 @@ extension NSTextView {
|
||||
let selectedLineRanges = self.selectedRanges.map { (self.string as NSString).lineRange(for: $0.rangeValue) }
|
||||
|
||||
// get glyph range of which line number should be drawn
|
||||
// -> Requires additionalLayout to obtain glyphRange for markedText. (2018-12 macOS 10.14 SDK)
|
||||
let layoutRect = rect.offset(by: -self.textContainerOrigin)
|
||||
let glyphRangeToDraw = layoutManager.glyphRange(forBoundingRectWithoutAdditionalLayout: layoutRect, in: textContainer)
|
||||
let glyphRangeToDraw = layoutManager.glyphRange(forBoundingRect: layoutRect, in: textContainer)
|
||||
|
||||
// count up lines until the interested area
|
||||
let firstIndex = layoutManager.characterIndexForGlyph(at: glyphRangeToDraw.location)
|
||||
|
Loading…
Reference in New Issue
Block a user