File tree Expand file tree Collapse file tree
src/vs/editor/test/browser/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2880,6 +2880,33 @@ suite('Editor Controller - Cursor Configuration', () => {
28802880
28812881 model . dispose ( ) ;
28822882 } ) ;
2883+
2884+ test ( 'issue #90973: Undo brings back model alternative version' , ( ) => {
2885+ let model = createTextModel (
2886+ [
2887+ ''
2888+ ] . join ( '\n' ) ,
2889+ {
2890+ insertSpaces : false ,
2891+ }
2892+ ) ;
2893+
2894+ withTestCodeEditor ( null , { model : model } , ( editor , cursor ) => {
2895+ const beforeVersion = model . getVersionId ( ) ;
2896+ const beforeAltVersion = model . getAlternativeVersionId ( ) ;
2897+ cursorCommand ( cursor , H . Type , { text : 'Hello' } , 'keyboard' ) ;
2898+ cursorCommand ( cursor , H . Undo , { } ) ;
2899+ const afterVersion = model . getVersionId ( ) ;
2900+ const afterAltVersion = model . getAlternativeVersionId ( ) ;
2901+
2902+ assert . notEqual ( beforeVersion , afterVersion ) ;
2903+ assert . equal ( beforeAltVersion , afterAltVersion ) ;
2904+ } ) ;
2905+
2906+ model . dispose ( ) ;
2907+ } ) ;
2908+
2909+
28832910} ) ;
28842911
28852912suite ( 'Editor Controller - Indentation Rules' , ( ) => {
You can’t perform that action at this time.
0 commit comments