@@ -2412,14 +2412,16 @@ define(function (require, exports, module) {
24122412 } ) ;
24132413
24142414 describe ( "Open Line Above and Below" , function ( ) {
2415- var indentUnit = Editor . getSpaceUnits ( ) ;
2416-
2417- var indentation = ( function ( ) {
2418- // generate indent string once
2419- var spaces = [ ] ;
2420- spaces . length = indentUnit + 1 ;
2421- return spaces . join ( " " ) ;
2422- } ( ) ) ;
2415+ var indentUnit = SpecRunnerUtils . EDITOR_USE_TABS ? 1 : SpecRunnerUtils . EDITOR_SPACE_UNITS ,
2416+ indentation = ( function ( ) {
2417+ // generate indent string once
2418+ if ( SpecRunnerUtils . EDITOR_USE_TABS ) {
2419+ return "\t" ;
2420+ }
2421+ var spaces = [ ] ;
2422+ spaces . length = indentUnit + 1 ;
2423+ return spaces . join ( " " ) ;
2424+ } ( ) ) ;
24232425
24242426 beforeEach ( setupFullEditor ) ;
24252427
@@ -2514,11 +2516,11 @@ define(function (require, exports, module) {
25142516 CommandManager . execute ( Commands . EDIT_OPEN_LINE_ABOVE , myEditor ) ;
25152517
25162518 var lines = defaultContent . split ( "\n" ) ;
2517- lines . splice ( 2 , 0 , " " + indentation ) ;
2519+ lines . splice ( 2 , 0 , indentation + indentation ) ;
25182520 var expectedText = lines . join ( "\n" ) ;
25192521
25202522 expect ( myDocument . getText ( ) ) . toEqual ( expectedText ) ;
2521- expectCursorAt ( { line : 2 , ch : 4 + indentUnit } ) ;
2523+ expectCursorAt ( { line : 2 , ch : indentUnit * 2 } ) ;
25222524 } ) ;
25232525
25242526 it ( "should insert new line below when no selection" , function ( ) {
@@ -2598,11 +2600,11 @@ define(function (require, exports, module) {
25982600 CommandManager . execute ( Commands . EDIT_OPEN_LINE_BELOW , myEditor ) ;
25992601
26002602 var lines = defaultContent . split ( "\n" ) ;
2601- lines . splice ( 3 , 0 , " " + indentation ) ;
2603+ lines . splice ( 3 , 0 , indentation + indentation ) ;
26022604 var expectedText = lines . join ( "\n" ) ;
26032605
26042606 expect ( myDocument . getText ( ) ) . toEqual ( expectedText ) ;
2605- expectCursorAt ( { line : 3 , ch : 4 + indentUnit } ) ;
2607+ expectCursorAt ( { line : 3 , ch : indentUnit * 2 } ) ;
26062608 } ) ;
26072609
26082610 it ( "should insert new line below when multiple line selection" , function ( ) {
@@ -2612,11 +2614,11 @@ define(function (require, exports, module) {
26122614 CommandManager . execute ( Commands . EDIT_OPEN_LINE_BELOW , myEditor ) ;
26132615
26142616 var lines = defaultContent . split ( "\n" ) ;
2615- lines . splice ( 5 , 0 , " " + indentation ) ;
2617+ lines . splice ( 5 , 0 , indentation + indentation ) ;
26162618 var expectedText = lines . join ( "\n" ) ;
26172619
26182620 expect ( myDocument . getText ( ) ) . toEqual ( expectedText ) ;
2619- expectCursorAt ( { line : 5 , ch : 4 + indentUnit } ) ;
2621+ expectCursorAt ( { line : 5 , ch : indentUnit * 2 } ) ;
26202622 } ) ;
26212623 } ) ;
26222624
0 commit comments