mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Store selections for undo by tab deletion
This commit is contained in:
parent
ce662e409c
commit
c85f244c0a
@ -7,6 +7,7 @@ Change Log
|
||||
|
||||
### Improvements
|
||||
|
||||
- Avoid selecting deleted spaces when undoing a soft tab deletion.
|
||||
- Add “.cxx” extension to “C++” syntax style.
|
||||
- Adjust width of line number views.
|
||||
|
||||
|
@ -504,6 +504,7 @@ final class EditorTextView: NSTextView, CurrentLineHighlighting, Themable {
|
||||
if self.isAutomaticTabExpansionEnabled,
|
||||
let deletionRange = self.string.rangeForSoftTabDeletion(in: self.selectedRange, tabWidth: self.tabWidth)
|
||||
{
|
||||
self.setSelectedRangesWithUndo(self.selectedRanges)
|
||||
self.selectedRange = deletionRange
|
||||
}
|
||||
|
||||
@ -514,6 +515,7 @@ final class EditorTextView: NSTextView, CurrentLineHighlighting, Themable {
|
||||
let nextCharacter = self.characterAfterInsertion,
|
||||
self.matchingBracketPairs.contains(where: { $0.begin == Character(lastCharacter) && $0.end == Character(nextCharacter) })
|
||||
{
|
||||
self.setSelectedRangesWithUndo(self.selectedRanges)
|
||||
self.selectedRange = NSRange(location: self.selectedRange.location - 1, length: 2)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user