Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8758dc9d
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,发现更多精彩内容 >>
未验证
提交
8758dc9d
编写于
2月 27, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #91405: Improve minimap settings
上级
15bdd26e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
23 deletion
+23
-23
src/vs/editor/browser/viewParts/minimap/minimap.ts
src/vs/editor/browser/viewParts/minimap/minimap.ts
+3
-3
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+13
-13
src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts
...ditor/test/common/viewLayout/editorLayoutProvider.test.ts
+6
-6
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+1
-1
未找到文件。
src/vs/editor/browser/viewParts/minimap/minimap.ts
浏览文件 @
8758dc9d
...
...
@@ -46,7 +46,7 @@ class MinimapOptions {
public
readonly
renderMinimap
:
RenderMinimap
;
public
readonly
mode
:
'
actual
'
|
'
cover
'
|
'
contain
'
;
public
readonly
size
:
'
proportional
'
|
'
fill
'
|
'
fit
'
;
public
readonly
minimapHeightIsEditorHeight
:
boolean
;
...
...
@@ -108,7 +108,7 @@ class MinimapOptions {
const
minimapOpts
=
options
.
get
(
EditorOption
.
minimap
);
this
.
renderMinimap
=
layoutInfo
.
renderMinimap
|
0
;
this
.
mode
=
minimapOpts
.
mod
e
;
this
.
size
=
minimapOpts
.
siz
e
;
this
.
minimapHeightIsEditorHeight
=
layoutInfo
.
minimapHeightIsEditorHeight
;
this
.
scrollBeyondLastLine
=
options
.
get
(
EditorOption
.
scrollBeyondLastLine
);
this
.
showSlider
=
minimapOpts
.
showSlider
;
...
...
@@ -144,7 +144,7 @@ class MinimapOptions {
public
equals
(
other
:
MinimapOptions
):
boolean
{
return
(
this
.
renderMinimap
===
other
.
renderMinimap
&&
this
.
mode
===
other
.
mod
e
&&
this
.
size
===
other
.
siz
e
&&
this
.
minimapHeightIsEditorHeight
===
other
.
minimapHeightIsEditorHeight
&&
this
.
scrollBeyondLastLine
===
other
.
scrollBeyondLastLine
&&
this
.
showSlider
===
other
.
showSlider
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
8758dc9d
...
...
@@ -1802,7 +1802,7 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.
const
minimapRenderCharacters
=
minimap
.
renderCharacters
;
let
minimapScale
=
(
pixelRatio
>=
2
?
Math
.
round
(
minimap
.
scale
*
2
)
:
minimap
.
scale
);
const
minimapMaxColumn
=
minimap
.
maxColumn
|
0
;
const
minimap
Mode
=
minimap
.
mod
e
;
const
minimap
Size
=
minimap
.
siz
e
;
const
scrollbar
=
options
.
get
(
EditorOption
.
scrollbar
);
const
verticalScrollbarWidth
=
scrollbar
.
verticalScrollbarSize
|
0
;
...
...
@@ -1866,7 +1866,7 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.
let
minimapCharWidth
=
minimapScale
/
pixelRatio
;
let
minimapWidthMultiplier
:
number
=
1
;
if
(
minimap
Mode
===
'
cover
'
||
minimapMode
===
'
contain
'
)
{
if
(
minimap
Size
===
'
fill
'
||
minimapSize
===
'
fit
'
)
{
const
viewLineCount
=
env
.
viewLineCount
;
const
{
typicalViewportLineCount
,
extraLinesBeyondLastLine
,
desiredRatio
,
minimapLineCount
}
=
EditorLayoutInfoComputer
.
computeContainedMinimapLineCount
({
viewLineCount
:
viewLineCount
,
...
...
@@ -1887,7 +1887,7 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.
minimapCharWidth
=
minimapScale
/
pixelRatio
;
}
else
{
const
effectiveMinimapHeight
=
Math
.
ceil
((
viewLineCount
+
extraLinesBeyondLastLine
)
*
minimapLineHeight
);
if
(
minimap
Mode
===
'
cover
'
||
effectiveMinimapHeight
>
minimapCanvasInnerHeight
)
{
if
(
minimap
Size
===
'
fill
'
||
effectiveMinimapHeight
>
minimapCanvasInnerHeight
)
{
minimapHeightIsEditorHeight
=
true
;
const
configuredFontScale
=
minimapScale
;
minimapLineHeight
=
Math
.
min
(
lineHeight
*
pixelRatio
,
Math
.
max
(
1
,
Math
.
floor
(
1
/
desiredRatio
)));
...
...
@@ -2074,7 +2074,7 @@ export interface IEditorMinimapOptions {
* Control the minimap rendering mode.
* Defaults to 'actual'.
*/
mode
?:
'
actual
'
|
'
cover
'
|
'
contain
'
;
size
?:
'
proportional
'
|
'
fill
'
|
'
fit
'
;
/**
* Control the rendering of the minimap slider.
* Defaults to 'mouseover'.
...
...
@@ -2103,7 +2103,7 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
constructor
()
{
const
defaults
:
EditorMinimapOptions
=
{
enabled
:
true
,
mode
:
'
actu
al
'
,
size
:
'
proportion
al
'
,
side
:
'
right
'
,
showSlider
:
'
mouseover
'
,
renderCharacters
:
true
,
...
...
@@ -2118,16 +2118,16 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
default
:
defaults
.
enabled
,
description
:
nls
.
localize
(
'
minimap.enabled
'
,
"
Controls whether the minimap is shown.
"
)
},
'
editor.minimap.
mod
e
'
:
{
'
editor.minimap.
siz
e
'
:
{
type
:
'
string
'
,
enum
:
[
'
actual
'
,
'
cover
'
,
'
contain
'
],
enum
:
[
'
proportional
'
,
'
fill
'
,
'
fit
'
],
enumDescriptions
:
[
nls
.
localize
(
'
minimap.
mode.actual
'
,
"
The minimap will be displayed in its original size, so it might be higher than the editor
.
"
),
nls
.
localize
(
'
minimap.
mode.cover
'
,
"
The minimap will always have the height of the editor and will stretch or shrink as necessary
.
"
),
nls
.
localize
(
'
minimap.
mode.contain
'
,
"
The minimap will shrink as necessary to never be higher than the editor
.
"
),
nls
.
localize
(
'
minimap.
size.proportional
'
,
"
The minimap has the same size as the editor contents (and might scroll)
.
"
),
nls
.
localize
(
'
minimap.
size.fill
'
,
"
The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)
.
"
),
nls
.
localize
(
'
minimap.
size.fit
'
,
"
The minimap will shrink as necessary to never be larger than the editor (no scrolling)
.
"
),
],
default
:
defaults
.
mod
e
,
description
:
nls
.
localize
(
'
minimap.
mode
'
,
"
Controls the rendering mod
e of the minimap.
"
)
default
:
defaults
.
siz
e
,
description
:
nls
.
localize
(
'
minimap.
size
'
,
"
Controls the siz
e of the minimap.
"
)
},
'
editor.minimap.side
'
:
{
type
:
'
string
'
,
...
...
@@ -2169,7 +2169,7 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
const
input
=
_input
as
IEditorMinimapOptions
;
return
{
enabled
:
EditorBooleanOption
.
boolean
(
input
.
enabled
,
this
.
defaultValue
.
enabled
),
mode
:
EditorStringEnumOption
.
stringSet
<
'
actual
'
|
'
cover
'
|
'
contain
'
>
(
input
.
mode
,
this
.
defaultValue
.
mode
,
[
'
actual
'
,
'
cover
'
,
'
contain
'
]),
size
:
EditorStringEnumOption
.
stringSet
<
'
proportional
'
|
'
fill
'
|
'
fit
'
>
(
input
.
size
,
this
.
defaultValue
.
size
,
[
'
proportional
'
,
'
fill
'
,
'
fit
'
]),
side
:
EditorStringEnumOption
.
stringSet
<
'
right
'
|
'
left
'
>
(
input
.
side
,
this
.
defaultValue
.
side
,
[
'
right
'
,
'
left
'
]),
showSlider
:
EditorStringEnumOption
.
stringSet
<
'
always
'
|
'
mouseover
'
>
(
input
.
showSlider
,
this
.
defaultValue
.
showSlider
,
[
'
always
'
,
'
mouseover
'
]),
renderCharacters
:
EditorBooleanOption
.
boolean
(
input
.
renderCharacters
,
this
.
defaultValue
.
renderCharacters
),
...
...
src/vs/editor/test/common/viewLayout/editorLayoutProvider.test.ts
浏览文件 @
8758dc9d
...
...
@@ -33,7 +33,7 @@ interface IEditorLayoutProviderOpts {
readonly
minimapSide
:
'
left
'
|
'
right
'
;
readonly
minimapRenderCharacters
:
boolean
;
readonly
minimapMaxColumn
:
number
;
minimap
Mode
?:
'
actual
'
|
'
cover
'
|
'
contain
'
;
minimap
Size
?:
'
proportional
'
|
'
fill
'
|
'
fit
'
;
readonly
pixelRatio
:
number
;
}
...
...
@@ -47,7 +47,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
options
.
_write
(
EditorOption
.
folding
,
false
);
const
minimapOptions
:
EditorMinimapOptions
=
{
enabled
:
input
.
minimap
,
mode
:
input
.
minimapMode
||
'
actu
al
'
,
size
:
input
.
minimapSize
||
'
proportion
al
'
,
side
:
input
.
minimapSide
,
renderCharacters
:
input
.
minimapRenderCharacters
,
maxColumn
:
input
.
minimapMaxColumn
,
...
...
@@ -978,7 +978,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
minimapSide
:
'
right
'
,
minimapRenderCharacters
:
true
,
minimapMaxColumn
:
150
,
minimap
Mode
:
'
cover
'
,
minimap
Size
:
'
fill
'
,
pixelRatio
:
2
,
},
{
width
:
1000
,
...
...
@@ -1042,7 +1042,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
minimapSide
:
'
right
'
,
minimapRenderCharacters
:
true
,
minimapMaxColumn
:
150
,
minimap
Mode
:
'
cover
'
,
minimap
Size
:
'
fill
'
,
pixelRatio
:
2
,
},
{
width
:
1000
,
...
...
@@ -1106,7 +1106,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
minimapSide
:
'
right
'
,
minimapRenderCharacters
:
true
,
minimapMaxColumn
:
150
,
minimap
Mode
:
'
contain
'
,
minimap
Size
:
'
fit
'
,
pixelRatio
:
2
,
},
{
width
:
1000
,
...
...
@@ -1170,7 +1170,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
minimapSide
:
'
right
'
,
minimapRenderCharacters
:
true
,
minimapMaxColumn
:
150
,
minimap
Mode
:
'
contain
'
,
minimap
Size
:
'
fit
'
,
pixelRatio
:
2
,
},
{
width
:
1000
,
...
...
src/vs/monaco.d.ts
浏览文件 @
8758dc9d
...
...
@@ -3444,7 +3444,7 @@ declare namespace monaco.editor {
* Control the minimap rendering mode.
* Defaults to 'actual'.
*/
mode
?:
'
actual
'
|
'
cover
'
|
'
contain
'
;
size
?:
'
proportional
'
|
'
fill
'
|
'
fit
'
;
/**
* Control the rendering of the minimap slider.
* Defaults to 'mouseover'.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录