@@ -7,7 +7,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IAttributeData, IBufferLine } from 'common/Types';
|
||||
import { BufferSet } from 'common/buffer/BufferSet';
|
||||
import { IBuffer, IBufferSet } from 'common/buffer/Types';
|
||||
import { IBufferService, IOptionsService } from 'common/services/Services';
|
||||
import { IBufferService, IOptionsService, type IBufferResizeEvent } from 'common/services/Services';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
export const MINIMUM_COLS = 2; // Less than 2 can mess with wide chars
|
||||
@@ -22,7 +22,7 @@ export class BufferService extends Disposable implements IBufferService {
|
||||
/** Whether the user is scrolling (locks the scroll position) */
|
||||
public isUserScrolling: boolean = false;
|
||||
|
||||
private readonly _onResize = this._register(new Emitter<{ cols: number, rows: number }>());
|
||||
private readonly _onResize = this._register(new Emitter<IBufferResizeEvent>());
|
||||
public readonly onResize = this._onResize.event;
|
||||
private readonly _onScroll = this._register(new Emitter<number>());
|
||||
public readonly onScroll = this._onScroll.event;
|
||||
@@ -43,12 +43,12 @@ export class BufferService extends Disposable implements IBufferService {
|
||||
}
|
||||
|
||||
public resize(cols: number, rows: number): void {
|
||||
const colsChanged = this.cols !== cols;
|
||||
const rowsChanged = this.rows !== rows;
|
||||
this.cols = cols;
|
||||
this.rows = rows;
|
||||
this.buffers.resize(cols, rows);
|
||||
// TODO: This doesn't fire when scrollback changes - add a resize event to BufferSet and forward
|
||||
// event
|
||||
this._onResize.fire({ cols, rows });
|
||||
this._onResize.fire({ cols, rows, colsChanged, rowsChanged });
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
|
||||
Reference in New Issue
Block a user