From 89f5c2e06caba9be8b0aedccc22762ee616a85f1 Mon Sep 17 00:00:00 2001 From: Simon Lamon Date: Sun, 24 Jul 2022 09:30:13 +0000 Subject: [PATCH 1/3] Allow markers on the alt buffer --- src/browser/Terminal.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/browser/Terminal.ts b/src/browser/Terminal.ts index bd82325d..9e41e5a4 100644 --- a/src/browser/Terminal.ts +++ b/src/browser/Terminal.ts @@ -1017,11 +1017,6 @@ export class Terminal extends CoreTerminal implements ITerminal { } public addMarker(cursorYOffset: number): IMarker | undefined { - // Disallow markers on the alt buffer - if (this.buffer !== this.buffers.normal) { - return; - } - return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); } From 0a83040ac88fcfc3bd2dc3a108217dd5f9145e4d Mon Sep 17 00:00:00 2001 From: Simon Lamon Date: Sun, 31 Jul 2022 07:38:14 +0000 Subject: [PATCH 2/3] clearAllMarkers --- src/common/buffer/BufferSet.test.ts | 13 +++++++++++++ src/common/buffer/BufferSet.ts | 1 + 2 files changed, 14 insertions(+) diff --git a/src/common/buffer/BufferSet.test.ts b/src/common/buffer/BufferSet.test.ts index 894ebb20..a200060f 100644 --- a/src/common/buffer/BufferSet.test.ts +++ b/src/common/buffer/BufferSet.test.ts @@ -71,4 +71,17 @@ describe('BufferSet', () => { assert.equal(bufferSet.active.y, 10); }); }); + + describe('markers', () => { + beforeEach(() => { + }); + + it('should clear the markers when the buffer is switched', () => { + bufferSet.activateAltBuffer(); + bufferSet.alt.addMarker(1); + assert.equal(bufferSet.alt.markers.length, 1); + bufferSet.activateNormalBuffer(); + assert.equal(bufferSet.alt.markers.length, 0); + }); + }); }); diff --git a/src/common/buffer/BufferSet.ts b/src/common/buffer/BufferSet.ts index de220e8f..7d07cec8 100644 --- a/src/common/buffer/BufferSet.ts +++ b/src/common/buffer/BufferSet.ts @@ -83,6 +83,7 @@ export class BufferSet extends Disposable implements IBufferSet { // The alt buffer should always be cleared when we switch to the normal // buffer. This frees up memory since the alt buffer should always be new // when activated. + this._alt.clearAllMarkers(); this._alt.clear(); this._activeBuffer = this._normal; this._onBufferActivate.fire({ From 14d59999e4a32904aaff91b6f777912a8651a173 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 Jul 2022 14:39:37 -0700 Subject: [PATCH 3/3] Update src/common/buffer/BufferSet.test.ts --- src/common/buffer/BufferSet.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/common/buffer/BufferSet.test.ts b/src/common/buffer/BufferSet.test.ts index a200060f..944b8c15 100644 --- a/src/common/buffer/BufferSet.test.ts +++ b/src/common/buffer/BufferSet.test.ts @@ -73,9 +73,6 @@ describe('BufferSet', () => { }); describe('markers', () => { - beforeEach(() => { - }); - it('should clear the markers when the buffer is switched', () => { bufferSet.activateAltBuffer(); bufferSet.alt.addMarker(1);