mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix contents of selection
in scripting (fix #1392)
This commit is contained in:
parent
1a08589bc4
commit
a4c80f5ce2
@ -13,6 +13,7 @@ Change Log
|
||||
### Fixes
|
||||
|
||||
- Fix an issue on macOS 13 that the Find All button in the find panel was not localized.
|
||||
- Fix an issue on CotEditor 4.4.0 that `contents of selection` of a document object returned its entire contents.
|
||||
|
||||
|
||||
|
||||
|
@ -101,7 +101,8 @@ final class TextSelection: NSObject {
|
||||
get {
|
||||
guard let textView = self.textView else { return nil }
|
||||
|
||||
let textStorage = NSTextStorage(string: textView.string)
|
||||
let string = (textView.string as NSString).substring(with: textView.selectedRange)
|
||||
let textStorage = NSTextStorage(string: string)
|
||||
|
||||
textStorage.observeDirectEditing { (editedString) in
|
||||
textView.insert(string: editedString, at: .replaceSelection)
|
||||
|
Loading…
Reference in New Issue
Block a user