@@ -2274,20 +2274,20 @@ suite('Editor Controller - Indentation Rules', () => {
22742274 } ) ;
22752275 } ) ;
22762276
2277- test ( 'Enter honors decreaseIndentPattern' , ( ) => {
2277+ test ( 'Type honors decreaseIndentPattern' , ( ) => {
22782278 usingCursor ( {
22792279 text : [
22802280 'if (true) {' ,
2281- '\t} '
2281+ '\t'
22822282 ] ,
22832283 languageIdentifier : mode . getLanguageIdentifier ( ) ,
22842284 modelOpts : { insertSpaces : false , tabSize : 4 , detectIndentation : false , defaultEOL : DefaultEndOfLine . LF , trimAutoWhitespace : true }
22852285 } , ( model , cursor ) => {
2286- moveTo ( cursor , 2 , 3 , false ) ;
2287- assertCursor ( cursor , new Selection ( 2 , 3 , 2 , 3 ) ) ;
2286+ moveTo ( cursor , 2 , 2 , false ) ;
2287+ assertCursor ( cursor , new Selection ( 2 , 2 , 2 , 2 ) ) ;
22882288
2289- cursorCommand ( cursor , H . Type , { text : '\n ' } , 'keyboard' ) ;
2290- assertCursor ( cursor , new Selection ( 3 , 1 , 3 , 1 ) ) ;
2289+ cursorCommand ( cursor , H . Type , { text : '} ' } , 'keyboard' ) ;
2290+ assertCursor ( cursor , new Selection ( 2 , 2 , 2 , 2 ) ) ;
22912291 assert . equal ( model . getLineContent ( 2 ) , '}' , '001' ) ;
22922292 } ) ;
22932293 } ) ;
@@ -2365,46 +2365,6 @@ suite('Editor Controller - Indentation Rules', () => {
23652365 model . dispose ( ) ;
23662366 } ) ;
23672367
2368- test ( 'Enter adjusts indentation of current line 1' , ( ) => {
2369- usingCursor ( {
2370- text : [
2371- 'if (true) {' ,
2372- '\tif (true) {' ,
2373- '\t\treturn true;' ,
2374- '\t\t}}'
2375- ] ,
2376- languageIdentifier : mode . getLanguageIdentifier ( ) ,
2377- modelOpts : { insertSpaces : false , tabSize : 4 , detectIndentation : false , defaultEOL : DefaultEndOfLine . LF , trimAutoWhitespace : true }
2378- } , ( model , cursor ) => {
2379- moveTo ( cursor , 4 , 4 , false ) ;
2380- assertCursor ( cursor , new Selection ( 4 , 4 , 4 , 4 ) ) ;
2381-
2382- cursorCommand ( cursor , H . Type , { text : '\n' } , 'keyboard' ) ;
2383- assertCursor ( cursor , new Selection ( 5 , 1 , 5 , 1 ) ) ;
2384- assert . equal ( model . getLineContent ( 4 ) , '\t}' , '001' ) ;
2385- } ) ;
2386- } ) ;
2387-
2388- test ( 'Enter adjusts indentation of current line 2' , ( ) => {
2389- usingCursor ( {
2390- text : [
2391- 'if (true) {' ,
2392- '\tif (true) {' ,
2393- '\t\treturn true;' ,
2394- '}}'
2395- ] ,
2396- languageIdentifier : mode . getLanguageIdentifier ( ) ,
2397- modelOpts : { insertSpaces : false , tabSize : 4 , detectIndentation : false , defaultEOL : DefaultEndOfLine . LF , trimAutoWhitespace : true }
2398- } , ( model , cursor ) => {
2399- moveTo ( cursor , 4 , 2 , false ) ;
2400- assertCursor ( cursor , new Selection ( 4 , 2 , 4 , 2 ) ) ;
2401-
2402- cursorCommand ( cursor , H . Type , { text : '\n' } , 'keyboard' ) ;
2403- assertCursor ( cursor , new Selection ( 5 , 1 , 5 , 1 ) ) ;
2404- assert . equal ( model . getLineContent ( 4 ) , '\t}' , '001' ) ;
2405- } ) ;
2406- } ) ;
2407-
24082368 test ( 'Enter honors intential indent' , ( ) => {
24092369 usingCursor ( {
24102370 text : [
@@ -2431,14 +2391,14 @@ suite('Editor Controller - Indentation Rules', () => {
24312391 'if (true) {' ,
24322392 '\tif (true) {' ,
24332393 '\t\treturn true;' ,
2434- '\t\t }a}'
2394+ '\t}a}'
24352395 ] ,
24362396 languageIdentifier : mode . getLanguageIdentifier ( ) ,
24372397 modelOpts : { insertSpaces : false , tabSize : 4 , detectIndentation : false , defaultEOL : DefaultEndOfLine . LF , trimAutoWhitespace : true }
24382398 } , ( model , cursor ) => {
2439- moveTo ( cursor , 4 , 4 , false ) ;
2440- moveTo ( cursor , 4 , 5 , true ) ;
2441- assertCursor ( cursor , new Selection ( 4 , 4 , 4 , 5 ) ) ;
2399+ moveTo ( cursor , 4 , 3 , false ) ;
2400+ moveTo ( cursor , 4 , 4 , true ) ;
2401+ assertCursor ( cursor , new Selection ( 4 , 3 , 4 , 4 ) ) ;
24422402
24432403 cursorCommand ( cursor , H . Type , { text : '\n' } , 'keyboard' ) ;
24442404 assertCursor ( cursor , new Selection ( 5 , 1 , 5 , 1 ) ) ;
0 commit comments