提交 fca5c66e 编写于 作者: B Benjamin Pasero

Dragging a diff view to another editor group loses scroll position (fix #104517)

上级 ece81412
......@@ -1055,3 +1055,14 @@ export function getCodeEditor(thing: any): ICodeEditor | null {
return null;
}
/**
*@internal
*/
export function getIEditor(thing: any): editorCommon.IEditor | null {
if (isCodeEditor(thing) || isDiffEditor(thing)) {
return thing;
}
return null;
}
......@@ -12,7 +12,7 @@ import { Event } from 'vs/base/common/event';
import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ISerializableView } from 'vs/base/browser/ui/grid/grid';
import { getCodeEditor } from 'vs/editor/browser/editorBrowser';
import { getIEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorOptions } from 'vs/platform/editor/common/editor';
import { IEditorService, IResourceEditorInputType } from 'vs/workbench/services/editor/common/editorService';
......@@ -132,7 +132,7 @@ export interface IEditorGroupView extends IDisposable, ISerializableView, IEdito
}
export function getActiveTextEditorOptions(group: IEditorGroup, expectedActiveEditor?: IEditorInput, presetOptions?: EditorOptions): EditorOptions {
const activeGroupCodeEditor = group.activeEditorPane ? getCodeEditor(group.activeEditorPane.getControl()) : undefined;
const activeGroupCodeEditor = group.activeEditorPane ? getIEditor(group.activeEditorPane.getControl()) : undefined;
if (activeGroupCodeEditor) {
if (!expectedActiveEditor || expectedActiveEditor.matches(group.activeEditor)) {
return TextEditorOptions.fromEditor(activeGroupCodeEditor, presetOptions);
......
......@@ -46,7 +46,7 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { ScrollType, IEditor, ICodeEditorViewState, IDiffEditorViewState } from 'vs/editor/common/editorCommon';
import { once } from 'vs/base/common/functional';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
import { getCodeEditor } from 'vs/editor/browser/editorBrowser';
import { getIEditor } from 'vs/editor/browser/editorBrowser';
import { withNullAsUndefined } from 'vs/base/common/types';
import { Codicon, stripCodicons } from 'vs/base/common/codicons';
......@@ -134,7 +134,7 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
this.editorViewState = {
group: activeEditorPane.group,
editor: activeEditorPane.input,
state: withNullAsUndefined(getCodeEditor(activeEditorPane.getControl())?.saveViewState())
state: withNullAsUndefined(getIEditor(activeEditorPane.getControl())?.saveViewState())
};
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册