mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix multi-cursor behavior with →
and ←
with empty selection
This commit is contained in:
parent
97de458481
commit
ae196f9ad6
@ -2,6 +2,15 @@
|
||||
Change Log
|
||||
==========================
|
||||
|
||||
3.7.0-beta.5 (unreleased)
|
||||
--------------------------
|
||||
|
||||
### Fixes
|
||||
|
||||
- [beta] Fix multi-cursor behavior with `→` and `←` when something is selected.
|
||||
|
||||
|
||||
|
||||
3.7.0-beta.4 (327)
|
||||
--------------------------
|
||||
|
||||
|
@ -38,7 +38,9 @@ extension EditorTextView {
|
||||
|
||||
guard self.hasMultipleInsertions else { return super.moveLeft(sender) }
|
||||
|
||||
self.moveCursors(affinity: .downstream) { (self.string as NSString).index(before: $0.lowerBound) }
|
||||
self.moveCursors(affinity: .downstream) {
|
||||
($0.length == 0) ? (self.string as NSString).index(before: $0.lowerBound) : $0.lowerBound
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +64,9 @@ extension EditorTextView {
|
||||
|
||||
guard self.hasMultipleInsertions else { return super.moveRight(sender) }
|
||||
|
||||
self.moveCursors(affinity: .upstream) { (self.string as NSString).index(after: $0.upperBound) }
|
||||
self.moveCursors(affinity: .upstream) {
|
||||
($0.length == 0) ? (self.string as NSString).index(after: $0.upperBound) : $0.upperBound
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user