Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
145a0072
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,发现更多精彩内容 >>
提交
145a0072
编写于
7月 21, 2020
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix not resetting cell list focus context key when closing notebook
上级
282214a3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
22 deletion
+3
-22
src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
...orkbench/contrib/notebook/browser/notebookEditorWidget.ts
+1
-21
src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts
...rkbench/contrib/notebook/browser/view/notebookCellList.ts
+2
-1
未找到文件。
src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts
浏览文件 @
145a0072
...
...
@@ -28,7 +28,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
import
{
EditorMemento
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorOptions
,
IEditorMemento
}
from
'
vs/workbench/common/editor
'
;
import
{
CELL_MARGIN
,
CELL_RUN_GUTTER
,
EDITOR_BOTTOM_PADDING
,
EDITOR_TOP_MARGIN
,
EDITOR_TOP_PADDING
,
SCROLLABLE_ELEMENT_PADDING_TOP
,
BOTTOM_CELL_TOOLBAR_HEIGHT
,
CELL_BOTTOM_MARGIN
,
CODE_CELL_LEFT_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
CellEditState
,
CellFocusMode
,
ICellRange
,
ICellViewModel
,
INotebookCellList
,
INotebookEditor
,
INotebookEditorContribution
,
INotebookEditorMouseEvent
,
NotebookLayoutInfo
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_EDITOR_EXECUTING_NOTEBOOK
,
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_RUNNABLE
,
NOTEBOOK_HAS_MULTIPLE_KERNELS
,
NOTEBOOK_OUTPUT_FOCUSED
,
INotebookDeltaDecoration
,
NOTEBOOK_CELL_LIST_FOCUSED
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CellEditState
,
CellFocusMode
,
ICellRange
,
ICellViewModel
,
INotebookCellList
,
INotebookEditor
,
INotebookEditorContribution
,
INotebookEditorMouseEvent
,
NotebookLayoutInfo
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_EDITOR_EXECUTING_NOTEBOOK
,
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_RUNNABLE
,
NOTEBOOK_HAS_MULTIPLE_KERNELS
,
NOTEBOOK_OUTPUT_FOCUSED
,
INotebookDeltaDecoration
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
NotebookEditorExtensionsRegistry
}
from
'
vs/workbench/contrib/notebook/browser/notebookEditorExtensions
'
;
import
{
NotebookCellList
}
from
'
vs/workbench/contrib/notebook/browser/view/notebookCellList
'
;
import
{
OutputRenderer
}
from
'
vs/workbench/contrib/notebook/browser/view/output/outputRenderer
'
;
...
...
@@ -86,9 +86,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
private
_dimension
:
DOM
.
Dimension
|
null
=
null
;
private
_shadowElementViewInfo
:
{
height
:
number
,
width
:
number
,
top
:
number
;
left
:
number
;
}
|
null
=
null
;
private
_cellListFocusTracker
:
DOM
.
IFocusTracker
|
null
=
null
;
private
_editorFocus
:
IContextKey
<
boolean
>
|
null
=
null
;
private
_cellListFocus
:
IContextKey
<
boolean
>
|
null
=
null
;
private
_outputFocus
:
IContextKey
<
boolean
>
|
null
=
null
;
private
_editorEditable
:
IContextKey
<
boolean
>
|
null
=
null
;
private
_editorRunnable
:
IContextKey
<
boolean
>
|
null
=
null
;
...
...
@@ -239,12 +237,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
// Note - focus going to the webview will fire 'blur', but the webview element will be
// a descendent of the notebook editor root.
const
focused
=
DOM
.
isAncestor
(
document
.
activeElement
,
this
.
_overlayContainer
);
if
(
focused
)
{
const
cellListFocused
=
DOM
.
isAncestor
(
document
.
activeElement
,
this
.
_body
);
this
.
_cellListFocus
?.
set
(
cellListFocused
);
}
else
{
this
.
_cellListFocus
?.
set
(
false
);
}
this
.
_editorFocus
?.
set
(
focused
);
this
.
_notebookViewModel
?.
setFocus
(
focused
);
}
...
...
@@ -265,7 +257,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
this
.
_createBody
(
this
.
_overlayContainer
);
this
.
_generateFontInfo
();
this
.
_editorFocus
=
NOTEBOOK_EDITOR_FOCUSED
.
bindTo
(
this
.
contextKeyService
);
this
.
_cellListFocus
=
NOTEBOOK_CELL_LIST_FOCUSED
.
bindTo
(
this
.
contextKeyService
);
this
.
_isVisible
=
true
;
this
.
_outputFocus
=
NOTEBOOK_OUTPUT_FOCUSED
.
bindTo
(
this
.
contextKeyService
);
this
.
_editorEditable
=
NOTEBOOK_EDITOR_EDITABLE
.
bindTo
(
this
.
contextKeyService
);
...
...
@@ -403,17 +394,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
this
.
_register
(
widgetFocusTracker
);
this
.
_register
(
widgetFocusTracker
.
onDidFocus
(()
=>
this
.
_onDidFocusEmitter
.
fire
()));
this
.
_cellListFocusTracker
=
this
.
_register
(
DOM
.
trackFocus
(
this
.
_body
));
this
.
_register
(
this
.
_cellListFocusTracker
.
onDidFocus
(()
=>
{
// hack - FocusTracker forces 'blur' to run after 'focus'.
// We want the other way around so that when switching from notebook to notebook, the focus happens last
setTimeout
(()
=>
{
this
.
updateEditorFocus
();
},
0
);
}));
this
.
_register
(
this
.
_cellListFocusTracker
.
onDidBlur
(()
=>
{
this
.
updateEditorFocus
();
}));
}
private
_updateForCursorNavigationMode
(
applyFocusChange
:
()
=>
void
):
void
{
...
...
src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts
浏览文件 @
145a0072
...
...
@@ -19,7 +19,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IListService
,
IWorkbenchListOptions
,
WorkbenchList
}
from
'
vs/platform/list/browser/listService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
CellRevealPosition
,
CellRevealType
,
CursorAtBoundary
,
getVisibleCells
,
ICellRange
,
ICellViewModel
,
INotebookCellList
,
reduceCellRanges
,
CellEditState
,
CellFocusMode
,
BaseCellRenderTemplate
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CellRevealPosition
,
CellRevealType
,
CursorAtBoundary
,
getVisibleCells
,
ICellRange
,
ICellViewModel
,
INotebookCellList
,
reduceCellRanges
,
CellEditState
,
CellFocusMode
,
BaseCellRenderTemplate
,
NOTEBOOK_CELL_LIST_FOCUSED
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
CellViewModel
,
NotebookViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel
'
;
import
{
diff
,
IProcessedOutput
,
NOTEBOOK_EDITOR_CURSOR_BOUNDARY
,
CellKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
clamp
}
from
'
vs/base/common/numbers
'
;
...
...
@@ -75,6 +75,7 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
listUser
,
container
,
delegate
,
renderers
,
options
,
contextKeyService
,
listService
,
themeService
,
configurationService
,
keybindingService
);
NOTEBOOK_CELL_LIST_FOCUSED
.
bindTo
(
this
.
contextKeyService
).
set
(
true
);
this
.
_focusNextPreviousDelegate
=
options
.
focusNextPreviousDelegate
;
this
.
_previousFocusedElements
=
this
.
getFocusedElements
();
this
.
_localDisposableStore
.
add
(
this
.
onDidChangeFocus
((
e
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录