mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 13:10:43 +00:00
Try prevent duplicate placeholder decorations showing
This adds these protections: - Placeholders are now always disposed of before a new one is created, this was the main reason for these issues. - Prevent the command started event firing if it has already fired on the same line. Fixes #151228
This commit is contained in:
parent
9e52154c5a
commit
adf9340be6
2 changed files with 10 additions and 4 deletions
|
@ -297,6 +297,12 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
|
|||
}
|
||||
|
||||
handleCommandStart(): void {
|
||||
// Only update the column if the line has already been set
|
||||
if (this._currentCommand.commandStartMarker?.line === this._terminal.buffer.active.cursorY) {
|
||||
this._currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
||||
this._logService.debug('CommandDetectionCapability#handleCommandStart', this._currentCommand.commandStartX, this._currentCommand.commandStartMarker?.line);
|
||||
return;
|
||||
}
|
||||
if (this._isWindowsPty) {
|
||||
this._handleCommandStartWindows();
|
||||
return;
|
||||
|
|
|
@ -215,14 +215,14 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
|
|||
if (!decoration) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (beforeCommandExecution) {
|
||||
this._placeholderDecoration = decoration;
|
||||
}
|
||||
decoration.onRender(element => {
|
||||
if (element.classList.contains(DecorationSelector.OverviewRuler)) {
|
||||
return;
|
||||
}
|
||||
if (beforeCommandExecution && !this._placeholderDecoration) {
|
||||
this._placeholderDecoration = decoration;
|
||||
} else if (!this._decorations.get(decoration.marker.id)) {
|
||||
if (!this._decorations.get(decoration.marker.id)) {
|
||||
decoration.onDispose(() => this._decorations.delete(decoration.marker.id));
|
||||
this._decorations.set(decoration.marker.id,
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue