mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
FIx failing showing scrollbar when unwrapped (fix #1037)
This commit is contained in:
parent
96c0187477
commit
c662f5bfe9
@ -11,6 +11,11 @@ Change Log
|
||||
- Update “Kotlin” syntax style.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where the horizontal scrollbar didn't appear by unwrapping lines if the document consists of a single very long line.
|
||||
|
||||
|
||||
|
||||
3.8.11 (398)
|
||||
--------------------------
|
||||
|
@ -199,6 +199,14 @@ extension NSTextView {
|
||||
let visibleRange = self.visibleRange
|
||||
let isVertical = (self.layoutOrientation == .vertical)
|
||||
|
||||
if isVertical {
|
||||
self.enclosingScrollView?.hasVerticalScroller = !newValue
|
||||
self.isVerticallyResizable = !newValue
|
||||
} else {
|
||||
self.enclosingScrollView?.hasHorizontalScroller = !newValue
|
||||
self.isHorizontallyResizable = !newValue
|
||||
}
|
||||
|
||||
if newValue {
|
||||
let width = self.visibleRect.width
|
||||
self.frame.size[keyPath: isVertical ? \NSSize.height : \NSSize.width] = width * self.scale
|
||||
@ -209,14 +217,6 @@ extension NSTextView {
|
||||
textContainer.size = self.infiniteSize
|
||||
}
|
||||
|
||||
if isVertical {
|
||||
self.isVerticallyResizable = !newValue
|
||||
self.enclosingScrollView?.hasVerticalScroller = !newValue
|
||||
} else {
|
||||
self.isHorizontallyResizable = !newValue
|
||||
self.enclosingScrollView?.hasHorizontalScroller = !newValue
|
||||
}
|
||||
|
||||
if let visibleRange = visibleRange, var visibleRect = self.boundingRect(for: visibleRange) {
|
||||
visibleRect.size.width = 0
|
||||
visibleRect = visibleRect.inset(by: -self.textContainerOrigin)
|
||||
|
Loading…
Reference in New Issue
Block a user