Expose getSelectionPosition and select APIs instead
This commit is contained in:
@@ -99,7 +99,7 @@ describe('API Integration Tests', () => {
|
||||
await page.evaluate(`window.term.clearSelection()`);
|
||||
assert.equal(await page.evaluate(`window.term.hasSelection()`), false);
|
||||
assert.equal(await page.evaluate(`window.term.getSelection()`), '');
|
||||
await page.evaluate(`window.term.setSelection(1, 2, 2)`)
|
||||
await page.evaluate(`window.term.select(1, 2, 2)`)
|
||||
assert.equal(await page.evaluate(`window.term.hasSelection()`), true);
|
||||
assert.equal(await page.evaluate(`window.term.getSelection()`), 'oo');
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm';
|
||||
import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, ISelectionPosition } from 'xterm';
|
||||
import { ITerminal, IBuffer } from '../Types';
|
||||
import { IBufferLine } from '../core/Types';
|
||||
import { Terminal as TerminalCore } from '../Terminal';
|
||||
@@ -96,12 +96,15 @@ export class Terminal implements ITerminalApi {
|
||||
public hasSelection(): boolean {
|
||||
return this._core.hasSelection();
|
||||
}
|
||||
public setSelection(column: number, row: number, length: number): void {
|
||||
this._core.setSelection(column, row, length);
|
||||
public select(column: number, row: number, length: number): void {
|
||||
this._core.select(column, row, length);
|
||||
}
|
||||
public getSelection(): string {
|
||||
return this._core.getSelection();
|
||||
}
|
||||
public getSelectionPosition(): ISelectionPosition | undefined {
|
||||
return this._core.getSelectionPosition();
|
||||
}
|
||||
public clearSelection(): void {
|
||||
this._core.clearSelection();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user