提交 6cd78e2c 编写于 作者: J Joao Moreno

Revert "home, end in suggest"

This reverts commit 82211b4d.
fixes #10423
上级 3313a641
...@@ -376,16 +376,6 @@ export class List<T> implements IDisposable { ...@@ -376,16 +376,6 @@ export class List<T> implements IDisposable {
} }
} }
focusFirst(): void {
if (this.length === 0) { return; }
this.setFocus(0);
}
focusLast(): void {
if (this.length === 0) { return; }
this.setFocus(this.length - 1);
}
getFocus(): number[] { getFocus(): number[] {
return this.focus.get(); return this.focus.get();
} }
......
...@@ -148,12 +148,6 @@ export class SuggestController implements IEditorContribution { ...@@ -148,12 +148,6 @@ export class SuggestController implements IEditorContribution {
} }
} }
selectFirstSuggestion(): void {
if (this.widget) {
this.widget.selectFirst();
}
}
selectPrevSuggestion(): void { selectPrevSuggestion(): void {
if (this.widget) { if (this.widget) {
this.widget.selectPrevious(); this.widget.selectPrevious();
...@@ -166,12 +160,6 @@ export class SuggestController implements IEditorContribution { ...@@ -166,12 +160,6 @@ export class SuggestController implements IEditorContribution {
} }
} }
selectLastSuggestion(): void {
if (this.widget) {
this.widget.selectLast();
}
}
toggleSuggestionDetails(): void { toggleSuggestionDetails(): void {
if (this.widget) { if (this.widget) {
this.widget.toggleDetails(); this.widget.toggleDetails();
...@@ -265,18 +253,6 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ ...@@ -265,18 +253,6 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
} }
})); }));
CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
id: 'selectFirstSuggestion',
precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),
handler: c => c.selectFirstSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
primary: KeyCode.Home,
secondary: [KeyMod.Alt | KeyCode.Home]
}
}));
CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
id: 'selectPrevSuggestion', id: 'selectPrevSuggestion',
precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions), precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),
...@@ -302,18 +278,6 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ ...@@ -302,18 +278,6 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
} }
})); }));
CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
id: 'selectLastSuggestion',
precondition: KbExpr.and(SuggestContext.Visible, SuggestContext.MultipleSuggestions),
handler: c => c.selectLastSuggestion(),
kbOpts: {
weight: weight,
kbExpr: EditorContextKeys.TextFocus,
primary: KeyCode.End,
secondary: [KeyMod.Alt | KeyCode.End]
}
}));
CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({
id: 'toggleSuggestionDetails', id: 'toggleSuggestionDetails',
precondition: SuggestContext.Visible, precondition: SuggestContext.Visible,
......
...@@ -283,14 +283,6 @@ class SuggestionDetails { ...@@ -283,14 +283,6 @@ class SuggestionDetails {
this.scrollUp(80); this.scrollUp(80);
} }
scrollHome(): void {
this.body.scrollTop = 0;
}
scrollEnd(): void {
this.body.scrollTop = this.body.scrollHeight;
}
private configureFont() { private configureFont() {
const fontInfo = this.editor.getConfiguration().fontInfo; const fontInfo = this.editor.getConfiguration().fontInfo;
this.title.style.fontFamily = fontInfo.fontFamily; this.title.style.fontFamily = fontInfo.fontFamily;
...@@ -671,21 +663,6 @@ export class SuggestWidget implements IContentWidget, IDisposable { ...@@ -671,21 +663,6 @@ export class SuggestWidget implements IContentWidget, IDisposable {
} }
} }
selectLast(): boolean {
switch (this.state) {
case State.Hidden:
return false;
case State.Details:
this.details.scrollEnd();
return true;
case State.Loading:
return !this.isAuto;
default:
this.list.focusLast();
return true;
}
}
selectPreviousPage(): boolean { selectPreviousPage(): boolean {
switch (this.state) { switch (this.state) {
case State.Hidden: case State.Hidden:
...@@ -716,21 +693,6 @@ export class SuggestWidget implements IContentWidget, IDisposable { ...@@ -716,21 +693,6 @@ export class SuggestWidget implements IContentWidget, IDisposable {
} }
} }
selectFirst(): boolean {
switch (this.state) {
case State.Hidden:
return false;
case State.Details:
this.details.scrollHome();
return true;
case State.Loading:
return !this.isAuto;
default:
this.list.focusFirst();
return true;
}
}
acceptSelectedSuggestion(): boolean { acceptSelectedSuggestion(): boolean {
switch (this.state) { switch (this.state) {
case State.Hidden: case State.Hidden:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册