@@ -333,9 +333,9 @@ describe('BufferLine', function(): void {
333333 const line = new TestBufferLine ( 10 , CellData . fromCharData ( [ DEFAULT_ATTR , NULL_CELL_CHAR , NULL_CELL_WIDTH , NULL_CELL_CODE ] ) , false ) ;
334334 const columns : number [ ] = [ ] ;
335335 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , ' ' ) ;
336- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) ;
336+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ;
337337 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , '' ) ;
338- assert . deepEqual ( columns , [ ] ) ;
338+ assert . deepEqual ( columns , [ 0 ] ) ;
339339 } ) ;
340340 it ( 'ASCII' , function ( ) : void {
341341 const columns : number [ ] = [ ] ;
@@ -345,16 +345,16 @@ describe('BufferLine', function(): void {
345345 line . setCell ( 4 , CellData . fromCharData ( [ 1 , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ) ;
346346 line . setCell ( 5 , CellData . fromCharData ( [ 1 , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ) ;
347347 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , 'a a aa ' ) ;
348- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) ;
348+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ;
349349 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , 'a a aa' ) ;
350- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 ] ) ;
350+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 ] ) ;
351351 for ( const trimRight of [ true , false ] ) {
352352 assert . equal ( line . translateToString ( trimRight , 0 , 5 , columns ) , 'a a a' ) ;
353- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 ] ) ;
353+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 ] ) ;
354354 assert . equal ( line . translateToString ( trimRight , 0 , 4 , columns ) , 'a a ' ) ;
355- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 ] ) ;
355+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 ] ) ;
356356 assert . equal ( line . translateToString ( trimRight , 0 , 3 , columns ) , 'a a' ) ;
357- assert . deepEqual ( columns , [ 0 , 1 , 2 ] ) ;
357+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 ] ) ;
358358 }
359359
360360 } ) ;
@@ -366,16 +366,16 @@ describe('BufferLine', function(): void {
366366 line . setCell ( 4 , CellData . fromCharData ( [ 1 , '𝄞' , 1 , '𝄞' . charCodeAt ( 0 ) ] ) ) ;
367367 line . setCell ( 5 , CellData . fromCharData ( [ 1 , '𝄞' , 1 , '𝄞' . charCodeAt ( 0 ) ] ) ) ;
368368 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , 'a 𝄞 𝄞𝄞 ' ) ;
369- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 , 7 , 8 , 9 ] ) ;
369+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ;
370370 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , 'a 𝄞 𝄞𝄞' ) ;
371- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 ] ) ;
371+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 ] ) ;
372372 for ( const trimRight of [ true , false ] ) {
373373 assert . equal ( line . translateToString ( trimRight , 0 , 5 , columns ) , 'a 𝄞 𝄞' ) ;
374- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 ] ) ;
374+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 ] ) ;
375375 assert . equal ( line . translateToString ( trimRight , 0 , 4 , columns ) , 'a 𝄞 ' ) ;
376- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 ] ) ;
376+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 ] ) ;
377377 assert . equal ( line . translateToString ( trimRight , 0 , 3 , columns ) , 'a 𝄞' ) ;
378- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 ] ) ;
378+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 ] ) ;
379379 }
380380 } ) ;
381381 it ( 'combining' , function ( ) : void {
@@ -386,16 +386,16 @@ describe('BufferLine', function(): void {
386386 line . setCell ( 4 , CellData . fromCharData ( [ 1 , 'e\u0301' , 1 , '\u0301' . charCodeAt ( 0 ) ] ) ) ;
387387 line . setCell ( 5 , CellData . fromCharData ( [ 1 , 'e\u0301' , 1 , '\u0301' . charCodeAt ( 0 ) ] ) ) ;
388388 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , 'a e\u0301 e\u0301e\u0301 ' ) ;
389- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 , 7 , 8 , 9 ] ) ;
389+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ;
390390 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , 'a e\u0301 e\u0301e\u0301' ) ;
391- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 ] ) ;
391+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 , 5 , 6 ] ) ;
392392 for ( const trimRight of [ true , false ] ) {
393393 assert . equal ( line . translateToString ( trimRight , 0 , 5 , columns ) , 'a e\u0301 e\u0301' ) ;
394- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 ] ) ;
394+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 , 4 , 5 ] ) ;
395395 assert . equal ( line . translateToString ( trimRight , 0 , 4 , columns ) , 'a e\u0301 ' ) ;
396- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 ] ) ;
396+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 , 4 ] ) ;
397397 assert . equal ( line . translateToString ( trimRight , 0 , 3 , columns ) , 'a e\u0301' ) ;
398- assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 ] ) ;
398+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 2 , 3 ] ) ;
399399 }
400400 } ) ;
401401 it ( 'fullwidth' , function ( ) : void {
@@ -409,22 +409,22 @@ describe('BufferLine', function(): void {
409409 line . setCell ( 7 , CellData . fromCharData ( [ 1 , '1' , 2 , '1' . charCodeAt ( 0 ) ] ) ) ;
410410 line . setCell ( 8 , CellData . fromCharData ( [ 0 , '' , 0 , 0 ] ) ) ;
411411 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , 'a 1 11 ' ) ;
412- assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 , 7 , 9 ] ) ;
412+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 , 7 , 9 , 10 ] ) ;
413413 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , 'a 1 11' ) ;
414- assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 , 7 ] ) ;
414+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 , 7 , 9 ] ) ;
415415 for ( const trimRight of [ true , false ] ) {
416416 assert . equal ( line . translateToString ( trimRight , 0 , 7 , columns ) , 'a 1 1' ) ;
417- assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 ] ) ;
417+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 , 7 ] ) ;
418418 assert . equal ( line . translateToString ( trimRight , 0 , 6 , columns ) , 'a 1 1' ) ;
419- assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 ] ) ;
419+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 , 7 ] ) ;
420420 assert . equal ( line . translateToString ( trimRight , 0 , 5 , columns ) , 'a 1 ' ) ;
421- assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 ] ) ;
421+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 , 5 ] ) ;
422422 assert . equal ( line . translateToString ( trimRight , 0 , 4 , columns ) , 'a 1' ) ;
423- assert . deepEqual ( columns , [ 0 , 1 , 2 ] ) ;
423+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 ] ) ;
424424 assert . equal ( line . translateToString ( trimRight , 0 , 3 , columns ) , 'a 1' ) ;
425- assert . deepEqual ( columns , [ 0 , 1 , 2 ] ) ;
425+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 4 ] ) ;
426426 assert . equal ( line . translateToString ( trimRight , 0 , 2 , columns ) , 'a ' ) ;
427- assert . deepEqual ( columns , [ 0 , 1 ] ) ;
427+ assert . deepEqual ( columns , [ 0 , 1 , 2 ] ) ;
428428 }
429429 } ) ;
430430 it ( 'space at end' , function ( ) : void {
@@ -436,9 +436,9 @@ describe('BufferLine', function(): void {
436436 line . setCell ( 5 , CellData . fromCharData ( [ 1 , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ) ;
437437 line . setCell ( 6 , CellData . fromCharData ( [ 1 , ' ' , 1 , ' ' . charCodeAt ( 0 ) ] ) ) ;
438438 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , 'a a aa ' ) ;
439- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) ;
439+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ;
440440 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , 'a a aa ' ) ;
441- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 ] ) ;
441+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ] ) ;
442442 } ) ;
443443 it ( 'should always return some sane value' , function ( ) : void {
444444 const columns : number [ ] = [ ] ;
@@ -447,16 +447,16 @@ describe('BufferLine', function(): void {
447447 // fullwidth pairs --> needs to be fixed after settling BufferLine impl
448448 const line = new TestBufferLine ( 10 , CellData . fromCharData ( [ DEFAULT_ATTR , NULL_CELL_CHAR , 0 , NULL_CELL_CODE ] ) , false ) ;
449449 assert . equal ( line . translateToString ( false , undefined , undefined , columns ) , ' ' ) ;
450- assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) ;
450+ assert . deepEqual ( columns , [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) ;
451451 assert . equal ( line . translateToString ( true , undefined , undefined , columns ) , '' ) ;
452- assert . deepEqual ( columns , [ ] ) ;
452+ assert . deepEqual ( columns , [ 0 ] ) ;
453453 } ) ;
454454 it ( 'should work with endCol=0' , ( ) => {
455455 const columns : number [ ] = [ ] ;
456456 const line = new TestBufferLine ( 10 , CellData . fromCharData ( [ DEFAULT_ATTR , NULL_CELL_CHAR , 0 , NULL_CELL_CODE ] ) , false ) ;
457457 line . setCell ( 0 , CellData . fromCharData ( [ 1 , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ) ;
458458 assert . equal ( line . translateToString ( true , 0 , 0 , columns ) , '' ) ;
459- assert . deepEqual ( columns , [ ] ) ;
459+ assert . deepEqual ( columns , [ 0 ] ) ;
460460 } ) ;
461461 } ) ;
462462 describe ( 'addCharToCell' , ( ) => {
0 commit comments