review changes

This commit is contained in:
Aiday Marlen Kyzy
2023-06-14 12:40:59 +02:00
parent 79c611d7b7
commit d983c8498a
3 changed files with 26 additions and 3 deletions

View File

@@ -47,6 +47,8 @@ export abstract class EditModeStrategy {
abstract hasFocus(): boolean;
abstract getWidgetPosition(): Position | undefined;
abstract needsMargin(): boolean;
}
export class PreviewStrategy extends EditModeStrategy {
@@ -145,6 +147,10 @@ export class PreviewStrategy extends EditModeStrategy {
hasFocus(): boolean {
return this._widget.hasFocus();
}
needsMargin(): boolean {
return true;
}
}
class InlineDiffDecorations {
@@ -359,6 +365,10 @@ export class LiveStrategy extends EditModeStrategy {
return lastLineOfLocalEdits ? new Position(lastLineOfLocalEdits, 1) : undefined;
}
override needsMargin(): boolean {
return Boolean(this._session.lastTextModelChanges.length);
}
hasFocus(): boolean {
return this._widget.hasFocus();
}