提交 e4279700 编写于 作者: J Joao Moreno

Merge branch 'master' of github.com:Microsoft/vscode

......@@ -35,6 +35,8 @@ import { BreadcrumbsFilePicker, BreadcrumbsOutlinePicker, BreadcrumbsPicker } fr
import { EditorGroupView } from 'vs/workbench/browser/parts/editor/editorGroupView';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { localize } from 'vs/nls';
class Item extends BreadcrumbsItem {
......@@ -329,6 +331,13 @@ export class BreadcrumbsControl {
//#region commands
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: 'breadcrumbs.focus',
title: localize('cmd.focus', "Focus Breadcrumbs")
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'breadcrumbs.focus',
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
......
......@@ -243,6 +243,7 @@ export class ReviewController implements IEditorContribution {
this._commentWidgets = [];
this.localToDispose.push(this.editor.onMouseMove(e => this.onEditorMouseMove(e)));
this.localToDispose.push(this.editor.onDidBlurEditorText(() => this.onDidBlurEditorText()));
this.localToDispose.push(this.editor.onDidChangeModelContent(() => {
if (this._newCommentGlyph) {
this.editor.removeContentWidget(this._newCommentGlyph);
......@@ -317,6 +318,10 @@ export class ReviewController implements IEditorContribution {
return;
}
if (!this.editor.hasTextFocus()) {
return;
}
const hasCommentingRanges = this._commentInfos.length && this._commentInfos.some(info => !!info.commentingRanges.length);
if (hasCommentingRanges && e.target.position && e.target.position.lineNumber !== undefined) {
if (this._newCommentGlyph && e.target.element.className !== 'comment-hint') {
......@@ -338,6 +343,12 @@ export class ReviewController implements IEditorContribution {
}
}
private onDidBlurEditorText(): void {
if (this._newCommentGlyph) {
this.editor.removeContentWidget(this._newCommentGlyph);
}
}
private getNewCommentAction(line: number): { replyCommand: modes.Command, ownerId: number } {
for (let i = 0; i < this._commentInfos.length; i++) {
const commentInfo = this._commentInfos[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册