@@ -851,9 +851,7 @@ export class ModeHandler implements vscode.Disposable, IModeHandler {
851
851
}
852
852
}
853
853
854
- ranRepeatableAction =
855
- ( ranRepeatableAction && this . vimState . currentMode === Mode . Normal ) ||
856
- this . createUndoPointForBrackets ( ) ;
854
+ ranRepeatableAction &&= this . vimState . currentMode === Mode . Normal ;
857
855
858
856
// We don't want to record a repeatable action when exiting from these modes
859
857
// by pressing <Esc>
@@ -1751,46 +1749,6 @@ export class ModeHandler implements vscode.Disposable, IModeHandler {
1751
1749
}
1752
1750
}
1753
1751
1754
- // Return true if a new undo point should be created based on brackets and parentheses
1755
- private createUndoPointForBrackets ( ) : boolean {
1756
- // }])> keys all start a new undo state when directly next to an {[(< opening character
1757
- const key =
1758
- this . vimState . recordedState . actionKeys [ this . vimState . recordedState . actionKeys . length - 1 ] ;
1759
-
1760
- if ( key === undefined ) {
1761
- return false ;
1762
- }
1763
-
1764
- if ( this . vimState . currentMode === Mode . Insert ) {
1765
- // Check if the keypress is a closing bracket to a corresponding opening bracket right next to it
1766
- let result = PairMatcher . nextPairedChar (
1767
- this . vimState . cursorStopPosition ,
1768
- key ,
1769
- this . vimState ,
1770
- false ,
1771
- ) ;
1772
- if ( result !== undefined ) {
1773
- if ( this . vimState . cursorStopPosition . isEqual ( result ) ) {
1774
- return true ;
1775
- }
1776
- }
1777
-
1778
- result = PairMatcher . nextPairedChar (
1779
- this . vimState . cursorStopPosition . getLeft ( ) ,
1780
- key ,
1781
- this . vimState ,
1782
- false ,
1783
- ) ;
1784
- if ( result !== undefined ) {
1785
- if ( this . vimState . cursorStopPosition . getLeft ( 2 ) . isEqual ( result ) ) {
1786
- return true ;
1787
- }
1788
- }
1789
- }
1790
-
1791
- return false ;
1792
- }
1793
-
1794
1752
dispose ( ) {
1795
1753
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
1796
1754
this . disposables . map ( ( d ) => d . dispose ( ) ) ;
0 commit comments