mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Make line number view opaque if text is unwrapped
This commit is contained in:
parent
d39693afe1
commit
bcb4a8e19a
@ -13,6 +13,7 @@ Change Log
|
||||
### Improvements
|
||||
|
||||
- Avoid drawing variant sequence as invisible control characters.
|
||||
- Make line number view opaque if lines are unwrapped on macOS 10.14 to avoid drawing the editor's text over the line numbers.
|
||||
- [tirivial] Draw vertical tabs as general invisible control characters.
|
||||
|
||||
|
||||
|
@ -149,11 +149,21 @@ final class LineNumberView: NSRulerView {
|
||||
/// make background transparent
|
||||
override var isOpaque: Bool {
|
||||
|
||||
return self.textView?.isOpaque ?? true
|
||||
guard let textView = self.textView else { return true }
|
||||
|
||||
if textView.isOpaque { return true }
|
||||
|
||||
// avoid overlapping line numbers with the text in the text view
|
||||
// -> On macOS 10.14 (and later?), text view is drawn under the ruler view. (2018-11 macOS 10.14)
|
||||
if NSAppKitVersion.current > .macOS10_13_4 {
|
||||
return !textView.wrapsLines
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
/// just before view will be attached
|
||||
/// just before the receiver attaches to a superview
|
||||
override func viewWillMove(toSuperview newSuperview: NSView?) {
|
||||
|
||||
super.viewWillMove(toSuperview: newSuperview)
|
||||
|
Loading…
Reference in New Issue
Block a user