mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix wrong trailing whitespaces removal (fix #930)
This commit is contained in:
parent
69098bc967
commit
18a09a1dea
@ -7,12 +7,13 @@ Change Log
|
||||
|
||||
### Improvements
|
||||
|
||||
- Highlight all lines that contain one of multi-insrtion points as current lines.
|
||||
- Highlight all lines that contain one of multi-insertion points as current lines.
|
||||
- Insert the text cotnent of .textClipping files when dropped.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where trailing whitespaces before the insertion points could be wrongly removed on the first auto-saving.
|
||||
- Improve stability.
|
||||
|
||||
|
||||
|
@ -398,7 +398,7 @@ final class Document: NSDocument, AdditionalDocumentPreparing, EncodingHolder {
|
||||
assert(Thread.isMainThread)
|
||||
if UserDefaults.standard[.trimsTrailingWhitespaceOnSave] {
|
||||
let trimsWhitespaceOnlyLines = UserDefaults.standard[.trimsWhitespaceOnlyLines]
|
||||
let keepsEditingPoint = (saveOperation == .autosaveInPlaceOperation || saveOperation == .autosaveElsewhereOperation)
|
||||
let keepsEditingPoint = (saveOperation == .autosaveInPlaceOperation || saveOperation == .autosaveElsewhereOperation || saveOperation == .autosaveAsOperation)
|
||||
let textView = self.textStorage.layoutManagers.lazy
|
||||
.compactMap { $0.textViewForBeginningOfSelection }
|
||||
.first { !keepsEditingPoint || $0.window?.firstResponder == $0 }
|
||||
|
Loading…
Reference in New Issue
Block a user