Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9504dda6
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9504dda6
编写于
7月 07, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't steal focus when restoring notebook editor state
Fix #101622
上级
46c2494c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
14 deletion
+13
-14
src/vs/workbench/contrib/notebook/browser/contrib/status/editorStatus.ts
...h/contrib/notebook/browser/contrib/status/editorStatus.ts
+8
-9
src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
...orkbench/contrib/notebook/browser/notebookEditorWidget.ts
+2
-2
src/vs/workbench/contrib/notebook/browser/view/renderers/codeCell.ts
...bench/contrib/notebook/browser/view/renderers/codeCell.ts
+2
-2
src/vs/workbench/contrib/notebook/browser/view/renderers/markdownCell.ts
...h/contrib/notebook/browser/view/renderers/markdownCell.ts
+1
-1
未找到文件。
src/vs/workbench/contrib/notebook/browser/contrib/status/editorStatus.ts
浏览文件 @
9504dda6
...
...
@@ -3,15 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
INotebookEditor
,
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_IS_ACTIVE_EDITOR
,
NOTEBOOK_HAS_MULTIPLE_KERNELS
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IQuickInputService
,
QuickPickInput
,
IQuickPickItem
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/common/notebookService
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
registerAction2
,
Action2
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
NOTEBOOK_ACTIONS_CATEGORY
,
INotebookCellActionContext
}
from
'
vs/workbench/contrib/notebook/browser/contrib/coreActions
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Action2
,
MenuId
,
registerAction2
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IQuickInputService
,
IQuickPickItem
,
QuickPickInput
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
INotebookCellActionContext
,
NOTEBOOK_ACTIONS_CATEGORY
}
from
'
vs/workbench/contrib/notebook/browser/contrib/coreActions
'
;
import
{
INotebookEditor
,
NOTEBOOK_HAS_MULTIPLE_KERNELS
,
NOTEBOOK_IS_ACTIVE_EDITOR
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/common/notebookService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
registerAction2
(
class
extends
Action2
{
...
...
@@ -20,11 +19,11 @@ registerAction2(class extends Action2 {
id
:
'
notebook.selectKernel
'
,
category
:
NOTEBOOK_ACTIONS_CATEGORY
,
title
:
nls
.
localize
(
'
notebookActions.selectKernel
'
,
"
Select Notebook Kernel
"
),
precondition
:
ContextKeyExpr
.
and
(
NOTEBOOK_IS_ACTIVE_EDITOR
,
NOTEBOOK_EDITOR_FOCUSED
)
,
precondition
:
NOTEBOOK_IS_ACTIVE_EDITOR
,
icon
:
{
id
:
'
codicon/server-environment
'
},
menu
:
{
id
:
MenuId
.
EditorTitle
,
when
:
ContextKeyExpr
.
and
(
NOTEBOOK_IS_ACTIVE_EDITOR
,
NOTEBOOK_HAS_MULTIPLE_KERNELS
)
,
when
:
NOTEBOOK_HAS_MULTIPLE_KERNELS
,
group
:
'
navigation
'
,
order
:
-
2
,
},
...
...
src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
浏览文件 @
9504dda6
...
...
@@ -239,7 +239,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
this
.
_createBody
(
this
.
_overlayContainer
);
this
.
_generateFontInfo
();
this
.
_editorFocus
=
NOTEBOOK_EDITOR_FOCUSED
.
bindTo
(
this
.
contextKeyService
);
this
.
_editorFocus
.
set
(
true
);
//
this._editorFocus.set(true);
this
.
_isVisible
=
true
;
this
.
_outputFocus
=
NOTEBOOK_OUTPUT_FOCUSED
.
bindTo
(
this
.
contextKeyService
);
this
.
_editorEditable
=
NOTEBOOK_EDITOR_EDITABLE
.
bindTo
(
this
.
contextKeyService
);
...
...
@@ -682,7 +682,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
}
if
(
viewState
?.
editorFocused
)
{
this
.
_list
?.
focusView
();
//
this._list?.focusView();
const
cell
=
this
.
_notebookViewModel
?.
viewCells
[
focusIdx
];
if
(
cell
)
{
cell
.
focusMode
=
CellFocusMode
.
Editor
;
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/codeCell.ts
浏览文件 @
9504dda6
...
...
@@ -57,7 +57,7 @@ export class CodeCell extends Disposable {
if
(
model
&&
templateData
.
editor
)
{
templateData
.
editor
.
setModel
(
model
);
viewCell
.
attachTextEditor
(
templateData
.
editor
);
if
(
notebookEditor
.
getActiveCell
()
===
viewCell
&&
viewCell
.
focusMode
===
CellFocusMode
.
Editor
)
{
if
(
notebookEditor
.
getActiveCell
()
===
viewCell
&&
viewCell
.
focusMode
===
CellFocusMode
.
Editor
&&
this
.
notebookEditor
.
hasFocus
()
)
{
templateData
.
editor
?.
focus
();
}
...
...
@@ -66,7 +66,7 @@ export class CodeCell extends Disposable {
this
.
onCellHeightChange
(
realContentHeight
);
}
if
(
this
.
notebookEditor
.
getActiveCell
()
===
this
.
viewCell
&&
viewCell
.
focusMode
===
CellFocusMode
.
Editor
)
{
if
(
this
.
notebookEditor
.
getActiveCell
()
===
this
.
viewCell
&&
viewCell
.
focusMode
===
CellFocusMode
.
Editor
&&
this
.
notebookEditor
.
hasFocus
()
)
{
templateData
.
editor
?.
focus
();
}
}
...
...
src/vs/workbench/contrib/notebook/browser/view/renderers/markdownCell.ts
浏览文件 @
9504dda6
...
...
@@ -227,7 +227,7 @@ export class StatefullMarkdownCell extends Disposable {
}
private
focusEditorIfNeeded
()
{
if
(
this
.
viewCell
.
focusMode
===
CellFocusMode
.
Editor
)
{
if
(
this
.
viewCell
.
focusMode
===
CellFocusMode
.
Editor
&&
this
.
notebookEditor
.
hasFocus
()
)
{
this
.
editor
?.
focus
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录