Fix hanging-indent update

This commit is contained in:
1024jp 2017-09-21 09:17:04 +09:00
parent 74ca15350d
commit f762d1eb5a
2 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ Develop
### Fixes
- Fix an issue where current line highlight was occasionally too wide when line height is 1.0.
- Fix an issue where the hanging-indent was not update in specific cases.

View File

@ -289,7 +289,7 @@ final class LayoutManager: NSLayoutManager {
override func textStorage(_ str: NSTextStorage, edited editedMask: NSTextStorageEditedOptions, range newCharRange: NSRange, changeInLength delta: Int, invalidatedRange invalidatedCharRange: NSRange) {
// invalidate wrapping line indent in editRange if needed
if editedMask & NSTextStorageEditedOptions(1) != 0 { // Hey Swift 3, where has NSTextStorageEditedCharacters gone...
if editedMask & NSTextStorageEditedOptions(1) != 0 || delta < 0 { // Hey Swift 3, where has NSTextStorageEditedCharacters gone...
self.invalidateIndent(in: newCharRange)
}