Fix the other invisibles setting update

This commit is contained in:
1024jp 2016-11-19 05:15:05 +09:00
parent 895bfc6f91
commit 48d9e09a8b
2 changed files with 9 additions and 1 deletions

View File

@ -12,7 +12,9 @@ develop
### Fixes
- Fix a possible issue where application could crash when changing document's encoding lossy.
- Fix a possible crash on changing document's encoding lossy.
- Fix an issue where editor views didn't update after changing the visibility of the other invisible characters.
3.1.1 (174)

View File

@ -91,6 +91,8 @@ final class LayoutManager: NSLayoutManager {
.showInvisibleTab,
.showInvisibleNewLine,
.showInvisibleFullwidthSpace,
.showOtherInvisibleChars,
]
private var defaultLineHeight: CGFloat = 1.0
@ -165,6 +167,10 @@ final class LayoutManager: NSLayoutManager {
self.applyDefaultInvisiblesSetting()
self.invisibleLines = self.generateInvisibleLines()
if keyPath == DefaultKeys.showOtherInvisibleChars.rawValue {
self.invalidateLayout(forCharacterRange: self.attributedString().string.nsRange, actualCharacterRange: nil)
}
if let textView = self.firstTextView {
textView.setNeedsDisplay(textView.bounds, avoidAdditionalLayout: false)
}