mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
fixes #39668
This commit is contained in:
@@ -28,6 +28,7 @@ export interface IOptions {
|
||||
isResizeable?: boolean;
|
||||
frameColor?: Color;
|
||||
arrowColor?: Color;
|
||||
keepEditorSelection?: boolean;
|
||||
}
|
||||
|
||||
export interface IStyles {
|
||||
@@ -42,7 +43,8 @@ const defaultOptions: IOptions = {
|
||||
showFrame: true,
|
||||
className: '',
|
||||
frameColor: defaultColor,
|
||||
arrowColor: defaultColor
|
||||
arrowColor: defaultColor,
|
||||
keepEditorSelection: false
|
||||
};
|
||||
|
||||
const WIDGET_ID = 'vs.editor.contrib.zoneWidget';
|
||||
@@ -391,7 +393,9 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
||||
|
||||
this._doLayout(containerHeight, width);
|
||||
|
||||
this.editor.setSelection(where);
|
||||
if (!this.options.keepEditorSelection) {
|
||||
this.editor.setSelection(where);
|
||||
}
|
||||
|
||||
// Reveal the line above or below the zone widget, to get the zone widget in the viewport
|
||||
const revealLineNumber = Math.min(this.editor.getModel().getLineCount(), Math.max(1, where.endLineNumber + 1));
|
||||
|
||||
@@ -197,7 +197,7 @@ class DirtyDiffWidget extends PeekViewWidget {
|
||||
@IMessageService private messageService: IMessageService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService
|
||||
) {
|
||||
super(editor, { isResizeable: true, frameWidth: 1 });
|
||||
super(editor, { isResizeable: true, frameWidth: 1, keepEditorSelection: true });
|
||||
|
||||
themeService.onThemeChange(this._applyTheme, this, this._disposables);
|
||||
this._applyTheme(themeService.getTheme());
|
||||
|
||||
Reference in New Issue
Block a user