Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -34,7 +34,7 @@ export class InsertCursorAbove extends EditorAction {
alias: 'Add Cursor Above',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.UpArrow,
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.UpArrow,
@@ -70,7 +70,7 @@ export class InsertCursorBelow extends EditorAction {
alias: 'Add Cursor Below',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow,
linux: {
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.DownArrow,
@@ -107,35 +107,31 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
alias: 'Add Cursors to Line Ends',
precondition: null,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I
}
});
}
private getCursorsForSelection(selection: Selection, editor: ICodeEditor): Selection[] {
private getCursorsForSelection(selection: Selection, model: ITextModel, result: Selection[]): void {
if (selection.isEmpty()) {
return [];
return;
}
let model = editor.getModel();
let newSelections: Selection[] = [];
for (let i = selection.startLineNumber; i < selection.endLineNumber; i++) {
let currentLineMaxColumn = model.getLineMaxColumn(i);
newSelections.push(new Selection(i, currentLineMaxColumn, i, currentLineMaxColumn));
result.push(new Selection(i, currentLineMaxColumn, i, currentLineMaxColumn));
}
if (selection.endColumn > 1) {
newSelections.push(new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn));
result.push(new Selection(selection.endLineNumber, selection.endColumn, selection.endLineNumber, selection.endColumn));
}
return newSelections;
}
public run(accessor: ServicesAccessor, editor: ICodeEditor): void {
let selections = editor.getSelections();
let newSelections = selections
.map((selection) => this.getCursorsForSelection(selection, editor))
.reduce((prev, curr) => { return prev.concat(curr); });
const model = editor.getModel();
const selections = editor.getSelections();
let newSelections: Selection[] = [];
selections.forEach((sel) => this.getCursorsForSelection(sel, model, newSelections));
if (newSelections.length > 0) {
editor.setSelections(newSelections);
@@ -603,7 +599,7 @@ export class CompatChangeAll extends MultiCursorSelectionControllerAction {
alias: 'Change All Occurrences',
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.textFocus,
kbExpr: EditorContextKeys.editorTextFocus,
primary: KeyMod.CtrlCmd | KeyCode.F2
},
menuOpts: {
@@ -803,9 +799,7 @@ export class SelectionHighlighter extends Disposable implements IEditorContribut
this.state = state;
if (!this.state) {
if (this.decorations.length > 0) {
this.decorations = this.editor.deltaDecorations(this.decorations, []);
}
this.decorations = this.editor.deltaDecorations(this.decorations, []);
return;
}