mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix highlighting extra line fragment with multi-cursor
This commit is contained in:
parent
fe3b39fd92
commit
9f0c7adc2f
@ -31,6 +31,7 @@ Change Log
|
||||
### Fixes
|
||||
|
||||
- Fix an issue that the rectangular selection could not add an insertion point at the empty last line.
|
||||
- Fix an issue that the line was not highlighted when one of multiple insertion points locates at the empty last line.
|
||||
|
||||
|
||||
|
||||
|
@ -81,7 +81,9 @@ extension CurrentLineHighlighting {
|
||||
.map(\.rangeValue)
|
||||
.map { (self.string as NSString).lineRange(for: $0) }
|
||||
.reduce(into: [NSRange]()) { (ranges, range) in
|
||||
if ranges.last?.touches(range) == true {
|
||||
if range.isEmpty && range.location == self.string.length {
|
||||
ranges.append(range)
|
||||
} else if ranges.last?.touches(range) == true {
|
||||
ranges[ranges.count - 1].formUnion(range)
|
||||
} else {
|
||||
ranges.append(range)
|
||||
|
Loading…
Reference in New Issue
Block a user