@@ -1278,7 +1278,7 @@ describe('Buffer', () => {
1278
1278
const s = terminal . buffer . iterator ( true ) . next ( ) . content ;
1279
1279
assert . equal ( input , s ) ;
1280
1280
for ( let i = 10 ; i < input . length ; ++ i ) {
1281
- const bufferIndex = terminal . buffer . stringIndexToBufferIndex ( 0 , i ) ;
1281
+ const bufferIndex = terminal . buffer . stringIndexToBufferIndex ( 0 , i , true ) ;
1282
1282
const j = ( i - 0 ) << 1 ;
1283
1283
assert . deepEqual ( [ ( j / terminal . cols ) | 0 , j % terminal . cols ] , bufferIndex ) ;
1284
1284
}
@@ -1290,7 +1290,7 @@ describe('Buffer', () => {
1290
1290
const s = terminal . buffer . iterator ( true ) . next ( ) . content ;
1291
1291
assert . equal ( input , s ) ;
1292
1292
for ( let i = 0 ; i < input . length ; ++ i ) {
1293
- const bufferIndex = terminal . buffer . stringIndexToBufferIndex ( 0 , i ) ;
1293
+ const bufferIndex = terminal . buffer . stringIndexToBufferIndex ( 0 , i , true ) ;
1294
1294
assert . equal ( input [ i ] , terminal . buffer . lines . get ( bufferIndex [ 0 ] ) . get ( bufferIndex [ 1 ] ) [ CHAR_DATA_CHAR_INDEX ] ) ;
1295
1295
}
1296
1296
} ) ;
@@ -1302,7 +1302,7 @@ describe('Buffer', () => {
1302
1302
const s = terminal . buffer . iterator ( true ) . next ( ) . content ;
1303
1303
assert . equal ( input , s ) ;
1304
1304
for ( let i = 0 ; i < input . length ; ++ i ) {
1305
- const bufferIndex = terminal . buffer . stringIndexToBufferIndex ( 0 , i ) ;
1305
+ const bufferIndex = terminal . buffer . stringIndexToBufferIndex ( 0 , i , true ) ;
1306
1306
assert . equal (
1307
1307
( ! ( i % 3 ) )
1308
1308
? input [ i ]
@@ -1312,6 +1312,13 @@ describe('Buffer', () => {
1312
1312
terminal . buffer . lines . get ( bufferIndex [ 0 ] ) . get ( bufferIndex [ 1 ] ) [ CHAR_DATA_CHAR_INDEX ] ) ;
1313
1313
}
1314
1314
} ) ;
1315
+
1316
+ it ( 'should handle \t in lines correctly' , ( ) => {
1317
+ const input = '\thttps://google.de' ;
1318
+ terminal . writeSync ( input ) ;
1319
+ const s = terminal . buffer . iterator ( true ) . next ( ) . content ;
1320
+ assert . equal ( s , Array ( terminal . getOption ( 'tabStopWidth' ) + 1 ) . join ( ' ' ) + 'https://google.de' ) ;
1321
+ } ) ;
1315
1322
} ) ;
1316
1323
describe ( 'BufferStringIterator' , function ( ) : void {
1317
1324
it ( 'iterator does not overflow buffer limits' , function ( ) : void {
0 commit comments