Fix select all with no start and include content below viewport

This commit is contained in:
Daniel Imms
2017-06-06 23:13:50 -07:00
parent 7147787441
commit 2b2431824f
3 changed files with 19 additions and 6 deletions
+14 -1
View File
@@ -44,7 +44,7 @@ describe('SelectionManager', () => {
window = w;
document = window.document;
buffer = new CircularList<any>(100);
terminal = <any>{ cols: 80 };
terminal = <any>{ cols: 80, rows: 2 };
selectionManager = new TestSelectionManager(terminal, buffer, rowContainer, null);
done();
});
@@ -153,4 +153,17 @@ describe('SelectionManager', () => {
assert.deepEqual(selectionManager.model.finalSelectionEnd, [terminal.cols, 0], 'The actual selection spans the entire column');
});
});
describe('selectAll', () => {
it('should select the entire buffer, beyond the viewport', () => {
buffer.push(stringToRow('1'));
buffer.push(stringToRow('2'));
buffer.push(stringToRow('3'));
buffer.push(stringToRow('4'));
buffer.push(stringToRow('5'));
selectionManager.selectAll();
terminal.ybase = buffer.length - terminal.rows;
assert.equal(selectionManager.selectionText, '1\n2\n3\n4\n5');
});
});
});