Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6053021a
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,发现更多精彩内容 >>
提交
6053021a
编写于
1月 23, 2017
作者:
M
Matt Bierner
提交者:
GitHub
1月 23, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Split up and rename Markdown Scroll Sync Settings (#19077)
Splits the markdown scroll sync settings to be more granular.
上级
04513610
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
17 deletion
+23
-17
extensions/markdown/media/main.js
extensions/markdown/media/main.js
+3
-3
extensions/markdown/media/markdown.css
extensions/markdown/media/markdown.css
+5
-5
extensions/markdown/package.json
extensions/markdown/package.json
+9
-4
extensions/markdown/package.nls.json
extensions/markdown/package.nls.json
+3
-2
extensions/markdown/src/extension.ts
extensions/markdown/src/extension.ts
+3
-3
未找到文件。
extensions/markdown/media/main.js
浏览文件 @
6053021a
...
...
@@ -120,7 +120,7 @@
window
.
onload
=
()
=>
{
pageHeight
=
document
.
body
.
getBoundingClientRect
().
height
;
if
(
window
.
initialData
.
enablePreviewSync
)
{
if
(
window
.
initialData
.
scrollPreviewWithEditorSelection
)
{
const
initialLine
=
+
window
.
initialData
.
line
||
0
;
scrollDisabled
=
true
;
scrollToRevealSourceLine
(
initialLine
);
...
...
@@ -135,7 +135,7 @@
pageHeight
=
newPageHeight
;
},
true
);
if
(
window
.
initialData
.
enablePreviewSync
)
{
if
(
window
.
initialData
.
scrollPreviewWithEditorSelection
)
{
window
.
addEventListener
(
'
message
'
,
event
=>
{
const
line
=
+
event
.
data
.
line
;
...
...
@@ -157,7 +157,7 @@
}
};
if
(
window
.
initialData
.
enableScrollSync
)
{
if
(
window
.
initialData
.
scrollEditorWithPreview
)
{
window
.
onscroll
=
()
=>
{
if
(
scrollDisabled
)
{
scrollDisabled
=
false
;
...
...
extensions/markdown/media/markdown.css
浏览文件 @
6053021a
...
...
@@ -15,12 +15,12 @@ body.scrollBeyondLastLine {
margin-bottom
:
calc
(
100vh
-
22px
);
}
.code-line
{
body
.showEditorSelection
.code-line
{
position
:
relative
;
}
.code-active-line
:before
,
.code-line
:hover:before
{
body
.showEditorSelection
.code-active-line
:before
,
body
.showEditorSelection
.code-line
:hover:before
{
content
:
""
;
display
:
block
;
position
:
absolute
;
...
...
@@ -29,11 +29,11 @@ body.scrollBeyondLastLine {
height
:
100%
;
}
.code-active-line
:before
{
body
.showEditorSelection
.code-active-line
:before
{
border-left
:
3px
solid
rgba
(
0
,
122
,
204
,
0.5
);
}
.code-line
:hover:before
{
body
.showEditorSelection
.code-line
:hover:before
{
border-left
:
3px
solid
#4080D0
;
}
...
...
extensions/markdown/package.json
浏览文件 @
6053021a
...
...
@@ -148,15 +148,20 @@
"default"
:
1.6
,
"description"
:
"%markdown.preview.lineHeight.desc%"
},
"markdown.preview.
experimentalSyncronizationEnabled
"
:
{
"markdown.preview.
scrollPreviewWithEditorSelection
"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"description"
:
"%markdown.preview.
experimentalSyncronizationEnabled
.desc%"
"description"
:
"%markdown.preview.
scrollPreviewWithEditorSelection
.desc%"
},
"markdown.preview.
synchronizePreviewScrollingToEditor
"
:
{
"markdown.preview.
markEditorSelection
"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"description"
:
"%markdown.preview.synchronizePreviewScrollingToEditor.desc%"
"description"
:
"%markdown.preview.markEditorSelection.desc%"
},
"markdown.preview.scrollEditorWithPreview"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"description"
:
"%markdown.preview.scrollEditorWithPreview.desc%"
}
}
}
...
...
extensions/markdown/package.nls.json
浏览文件 @
6053021a
...
...
@@ -7,6 +7,7 @@
"markdown.preview.fontFamily.desc"
:
"Controls the font family used in the markdown preview."
,
"markdown.preview.fontSize.desc"
:
"Controls the font size in pixels used in the markdown preview."
,
"markdown.preview.lineHeight.desc"
:
"Controls the line height used in the markdown preview. This number is relative to the font size."
,
"markdown.preview.experimentalSyncronizationEnabled.desc"
:
"Enable experimental syncronization between the markdown preview and the editor"
,
"markdown.preview.synchronizePreviewScrollingToEditor.desc"
:
"When the preview is scrolled, update the view of the editor"
"markdown.preview.scrollPreviewWithEditorSelection.desc"
:
"Scrolls the markdown preview to reveal the currently selected line from the editor."
,
"markdown.preview.scrollEditorWithPreview.desc"
:
"When the markdown preview is scrolled, update the view of the editor."
,
"markdown.preview.markEditorSelection.desc"
:
"Mark the current editor selection in the markdown preview."
}
\ No newline at end of file
extensions/markdown/src/extension.ts
浏览文件 @
6053021a
...
...
@@ -283,14 +283,14 @@ class MDDocumentContentProvider implements vscode.TextDocumentContentProvider {
${
this
.
computeCustomStyleSheetIncludes
(
uri
)}
<base href="
${
document
.
uri
.
toString
(
true
)}
">
</head>
<body class="
${
scrollBeyondLastLine
?
'
scrollBeyondLastLine
'
:
''
}
${
wordWrap
?
'
wordWrap
'
:
''
}
">
<body class="
${
scrollBeyondLastLine
?
'
scrollBeyondLastLine
'
:
''
}
${
wordWrap
?
'
wordWrap
'
:
''
}
${
!!
markdownConfig
.
get
(
'
preview.markEditorSelection
'
)
?
'
showEditorSelection
'
:
''
}
">
${
body
}
<script>
window.initialData = {
source: "
${
encodeURIComponent
(
sourceUri
.
scheme
+
'
://
'
+
sourceUri
.
path
)}
",
line:
${
initialLine
}
,
enablePreviewSync:
${
!!
markdownConfig
.
get
(
'
preview.experimentalSyncronizationEnabled
'
,
true
)}
,
enableScrollSync:
${
!!
markdownConfig
.
get
(
'
preview.synchronizePreviewScrollingToEditor
'
,
true
)}
scrollPreviewWithEditorSelection:
${
!!
markdownConfig
.
get
(
'
preview.scrollPreviewWithEditorSelection
'
,
true
)}
,
scrollEditorWithPreview:
${
!!
markdownConfig
.
get
(
'
preview.scrollEditorWithPreview
'
,
true
)}
};
</script>
<script src="
${
this
.
getMediaPath
(
'
main.js
'
)}
"></script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录