Archived
Merge from vscode 073a24de05773f2261f89172987002dc0ae2f1cd (#9711)
This commit is contained in:
@@ -30,6 +30,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { Constants } from 'vs/base/common/uint';
|
||||
|
||||
const DIFF_LINES_PADDING = 3;
|
||||
|
||||
@@ -124,16 +125,6 @@ export class DiffReview extends Disposable {
|
||||
}
|
||||
this._render();
|
||||
}));
|
||||
this._register(diffEditor.getOriginalEditor().onDidFocusEditorWidget(() => {
|
||||
if (this._isVisible) {
|
||||
this.hide();
|
||||
}
|
||||
}));
|
||||
this._register(diffEditor.getModifiedEditor().onDidFocusEditorWidget(() => {
|
||||
if (this._isVisible) {
|
||||
this.hide();
|
||||
}
|
||||
}));
|
||||
this._register(dom.addStandardDisposableListener(this.domNode.domNode, 'click', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -209,7 +200,9 @@ export class DiffReview extends Disposable {
|
||||
}
|
||||
|
||||
index = index % this._diffs.length;
|
||||
this._diffEditor.setPosition(new Position(this._diffs[index].entries[0].modifiedLineStart, 1));
|
||||
const entries = this._diffs[index].entries;
|
||||
this._diffEditor.setPosition(new Position(entries[0].modifiedLineStart, 1));
|
||||
this._diffEditor.setSelection({ startColumn: 1, startLineNumber: entries[0].modifiedLineStart, endColumn: Constants.MAX_SAFE_SMALL_INTEGER, endLineNumber: entries[entries.length - 1].modifiedLineEnd });
|
||||
this._isVisible = true;
|
||||
this._diffEditor.doLayout();
|
||||
this._render();
|
||||
@@ -242,7 +235,9 @@ export class DiffReview extends Disposable {
|
||||
}
|
||||
|
||||
index = index % this._diffs.length;
|
||||
this._diffEditor.setPosition(new Position(this._diffs[index].entries[0].modifiedLineStart, 1));
|
||||
const entries = this._diffs[index].entries;
|
||||
this._diffEditor.setPosition(new Position(entries[0].modifiedLineStart, 1));
|
||||
this._diffEditor.setSelection({ startColumn: 1, startLineNumber: entries[0].modifiedLineStart, endColumn: Constants.MAX_SAFE_SMALL_INTEGER, endLineNumber: entries[entries.length - 1].modifiedLineEnd });
|
||||
this._isVisible = true;
|
||||
this._diffEditor.doLayout();
|
||||
this._render();
|
||||
@@ -551,6 +546,7 @@ export class DiffReview extends Disposable {
|
||||
let container = document.createElement('div');
|
||||
container.className = 'diff-review-table';
|
||||
container.setAttribute('role', 'list');
|
||||
container.setAttribute('aria-label', 'Difference review. Use "Stage | Unstage | Revert Selected Ranges" commands');
|
||||
Configuration.applyFontInfoSlow(container, modifiedOptions.get(EditorOption.fontInfo));
|
||||
|
||||
let minOriginalLine = 0;
|
||||
@@ -590,11 +586,11 @@ export class DiffReview extends Disposable {
|
||||
|
||||
const getAriaLines = (lines: number) => {
|
||||
if (lines === 0) {
|
||||
return nls.localize('no_lines', "no lines");
|
||||
return nls.localize('no_lines_changed', "no lines changed");
|
||||
} else if (lines === 1) {
|
||||
return nls.localize('one_line', "1 line");
|
||||
return nls.localize('one_line_changed', "1 line changed");
|
||||
} else {
|
||||
return nls.localize('more_lines', "{0} lines", lines);
|
||||
return nls.localize('more_lines_changed', "{0} lines changed", lines);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -608,9 +604,9 @@ export class DiffReview extends Disposable {
|
||||
'That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.',
|
||||
'Variables 0 and 1 refer to the diff index out of total number of diffs.',
|
||||
'Variables 2 and 4 will be numbers (a line number).',
|
||||
'Variables 3 and 5 will be "no lines", "1 line" or "X lines", localized separately.'
|
||||
'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.'
|
||||
]
|
||||
}, "Difference {0} of {1}: original {2}, {3}, modified {4}, {5}", (diffIndex + 1), this._diffs.length, minOriginalLine, originalChangedLinesCntAria, minModifiedLine, modifiedChangedLinesCntAria));
|
||||
}, "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}", (diffIndex + 1), this._diffs.length, minOriginalLine, originalChangedLinesCntAria, minModifiedLine, modifiedChangedLinesCntAria));
|
||||
header.appendChild(cell);
|
||||
|
||||
// @@ -504,7 +517,7 @@
|
||||
|
||||
Reference in New Issue
Block a user