Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
9030a391
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9030a391
编写于
3月 27, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
markdown editor align with code editor
上级
9f4af01e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
6 deletion
+9
-6
src/vs/workbench/contrib/notebook/browser/constants.ts
src/vs/workbench/contrib/notebook/browser/constants.ts
+1
-0
src/vs/workbench/contrib/notebook/browser/contrib/notebookActions.ts
...bench/contrib/notebook/browser/contrib/notebookActions.ts
+2
-2
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
+1
-0
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
...h/contrib/notebook/browser/view/renderers/cellRenderer.ts
+3
-2
src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts
...ntrib/notebook/browser/viewModel/markdownCellViewModel.ts
+2
-2
未找到文件。
src/vs/workbench/contrib/notebook/browser/constants.ts
浏览文件 @
9030a391
...
...
@@ -22,6 +22,7 @@ export const EXECUTE_CELL_COMMAND_ID = 'workbench.notebook.cell.execute';
// Cell sizing related
export
const
CELL_MARGIN
=
20
;
export
const
CELL_RUN_GUTTER
=
32
;
// TODO should be dynamic based on execution order width, and runnable enablement
export
const
EDITOR_TOP_MARGIN
=
8
;
export
const
EDITOR_TOP_PADDING
=
8
;
export
const
EDITOR_BOTTOM_PADDING
=
8
;
export
const
EDITOR_TOOLBAR_HEIGHT
=
22
;
...
...
src/vs/workbench/contrib/notebook/browser/contrib/notebookActions.ts
浏览文件 @
9030a391
...
...
@@ -321,7 +321,7 @@ registerAction2(class extends Action2 {
});
}
async
run
(
accessor
:
ServicesAccessor
):
Promise
<
void
>
{
async
run
(
accessor
:
ServicesAccessor
,
context
?:
INotebookCellActionContext
):
Promise
<
void
>
{
return
changeActiveCellToKind
(
CellKind
.
Markdown
,
accessor
);
}
});
...
...
@@ -384,7 +384,7 @@ async function changeActiveCellToKind(kind: CellKind, accessor: ServicesAccessor
return
;
}
editor
.
focusNotebookCell
(
newCell
,
fals
e
);
editor
.
focusNotebookCell
(
newCell
,
tru
e
);
editor
.
deleteNotebookCell
(
activeCell
);
}
...
...
src/vs/workbench/contrib/notebook/browser/notebookEditor.ts
浏览文件 @
9030a391
...
...
@@ -805,6 +805,7 @@ registerThemingParticipant((theme, collector) => {
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .output { margin: 0px
${
CELL_MARGIN
}
px 0px
${
CELL_MARGIN
+
CELL_RUN_GUTTER
}
px }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .cell .cell-editor-container { width: calc(100% -
${
CELL_RUN_GUTTER
}
px); }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .cell .markdown-editor-container { margin-left:
${
CELL_RUN_GUTTER
}
px; }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .monaco-list-row > div.cell.markdown { padding-left:
${
CELL_RUN_GUTTER
}
px; }`
);
collector
.
addRule
(
`.monaco-workbench .part.editor > .content .notebook-editor .cell .run-button-container { width:
${
CELL_RUN_GUTTER
}
px; }`
);
});
src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts
浏览文件 @
9030a391
...
...
@@ -179,7 +179,8 @@ export class MarkdownCellRenderer extends AbstractCellRenderer implements IListR
renderTemplate
(
container
:
HTMLElement
):
CellRenderTemplate
{
const
codeInnerContent
=
document
.
createElement
(
'
div
'
);
DOM
.
addClasses
(
codeInnerContent
,
'
cell
'
,
'
code
'
);
codeInnerContent
.
style
.
display
=
'
none
'
;
const
editorContainer
=
DOM
.
append
(
codeInnerContent
,
$
(
'
.markdown-editor-container
'
));
editorContainer
.
style
.
display
=
'
none
'
;
const
disposables
=
new
DisposableStore
();
const
toolbar
=
this
.
createToolbar
(
container
);
...
...
@@ -196,7 +197,7 @@ export class MarkdownCellRenderer extends AbstractCellRenderer implements IListR
return
{
container
:
container
,
cellContainer
:
innerContent
,
editingContainer
:
codeInnerContent
,
editingContainer
:
editorContainer
,
disposables
,
toolbar
,
toJSON
:
()
=>
{
return
{};
}
...
...
src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts
浏览文件 @
9030a391
...
...
@@ -12,7 +12,7 @@ import { ICellViewModel, CellFindMatch, MarkdownCellLayoutInfo, MarkdownCellLayo
import
{
MarkdownRenderer
}
from
'
vs/workbench/contrib/notebook/browser/view/renderers/mdRenderer
'
;
import
{
BaseCellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel
'
;
import
{
CellKind
,
ICell
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
CELL_MARGIN
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
CELL_MARGIN
,
CELL_RUN_GUTTER
}
from
'
vs/workbench/contrib/notebook/browser/constants
'
;
import
{
NotebookEventDispatcher
}
from
'
vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher
'
;
export
class
MarkdownCellViewModel
extends
BaseCellViewModel
implements
ICellViewModel
{
...
...
@@ -55,7 +55,7 @@ export class MarkdownCellViewModel extends BaseCellViewModel implements ICellVie
layoutChange
(
state
:
MarkdownCellLayoutChangeEvent
)
{
// recompute
const
editorWidth
=
state
.
outerWidth
!==
undefined
?
state
.
outerWidth
-
CELL_MARGIN
*
2
:
0
;
const
editorWidth
=
state
.
outerWidth
!==
undefined
?
state
.
outerWidth
-
CELL_MARGIN
*
2
-
CELL_RUN_GUTTER
:
0
;
this
.
_layoutInfo
=
{
fontInfo
:
state
.
font
||
null
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录