mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix selection after redo with .balancesBrackets option
This commit is contained in:
parent
a4fe5acfab
commit
4de7040896
@ -12,6 +12,11 @@ Change Log
|
||||
- Adjust width of line number views.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where the cursor position did not restore correctly after repeatedly undoing & redoing bracket insertion with the “Automatically insert closing brackets and quotes” option enabled.
|
||||
|
||||
|
||||
|
||||
3.6.1 (288)
|
||||
--------------------------
|
||||
|
@ -353,7 +353,7 @@ final class EditorTextView: NSTextView, CurrentLineHighlighting, Themable {
|
||||
!(pair.begin == pair.end && CharacterSet.alphanumerics.contains(self.characterBeforeInsertion ?? UnicodeScalar(0))) // for "
|
||||
{
|
||||
super.insertText(String(pair.begin) + String(pair.end), replacementRange: replacementRange)
|
||||
self.selectedRange.location -= 1
|
||||
self.setSelectedRangesWithUndo([NSRange(location: self.selectedRange.location - 1, length: 0)])
|
||||
self.textStorage?.addAttribute(.autoBalancedClosingBracket, value: true,
|
||||
range: NSRange(location: self.selectedRange.location, length: 1))
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user