mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Spport mutli-cursor when inputting in unicode hex
This commit is contained in:
parent
de63c5b012
commit
2546793618
@ -2,6 +2,15 @@
|
||||
Change Log
|
||||
==========================
|
||||
|
||||
3.7.3 (unreleased)
|
||||
--------------------------
|
||||
|
||||
### Improvements
|
||||
|
||||
- “Input in unicode hex” now supports multi-cursor editing.
|
||||
|
||||
|
||||
|
||||
3.7.2 (347)
|
||||
--------------------------
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// © 2014-2018 1024jp
|
||||
// © 2014-2019 1024jp
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -42,14 +42,12 @@ extension EditorTextView: UnicodeInputReceiver {
|
||||
/// insert an Unicode character from Unicode input panel
|
||||
@IBAction func insertUnicodeCharacter(_ sender: UnicodeInputViewController) {
|
||||
|
||||
guard let character = sender.characterString else { return }
|
||||
guard
|
||||
let character = sender.characterString,
|
||||
let ranges = self.rangesForUserTextChange as? [NSRange]
|
||||
else { return }
|
||||
|
||||
let range = self.rangeForUserTextChange
|
||||
|
||||
if self.shouldChangeText(in: range, replacementString: character) {
|
||||
self.replaceCharacters(in: range, with: character)
|
||||
self.didChangeText()
|
||||
}
|
||||
self.insertText(character, replacementRanges: ranges)
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user