Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
68bf7d72
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,发现更多精彩内容 >>
提交
68bf7d72
编写于
10月 14, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
563d56cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
30 deletion
+23
-30
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
+23
-30
未找到文件。
src/vs/editor/contrib/zoneWidget/zoneWidget.ts
浏览文件 @
68bf7d72
...
...
@@ -50,11 +50,11 @@ const WIDGET_ID = 'vs.editor.contrib.zoneWidget';
export
class
ViewZoneDelegate
implements
IViewZone
{
public
domNode
:
HTMLElement
;
public
id
:
string
=
''
;
// A valid zone id should be greater than 0
public
afterLineNumber
:
number
;
public
afterColumn
:
number
;
public
heightInLines
:
number
;
domNode
:
HTMLElement
;
id
:
string
=
''
;
// A valid zone id should be greater than 0
afterLineNumber
:
number
;
afterColumn
:
number
;
heightInLines
:
number
;
private
readonly
_onDomNodeTop
:
(
top
:
number
)
=>
void
;
private
readonly
_onComputedHeight
:
(
height
:
number
)
=>
void
;
...
...
@@ -71,11 +71,11 @@ export class ViewZoneDelegate implements IViewZone {
this
.
_onComputedHeight
=
onComputedHeight
;
}
public
onDomNodeTop
(
top
:
number
):
void
{
onDomNodeTop
(
top
:
number
):
void
{
this
.
_onDomNodeTop
(
top
);
}
public
onComputedHeight
(
height
:
number
):
void
{
onComputedHeight
(
height
:
number
):
void
{
this
.
_onComputedHeight
(
height
);
}
}
...
...
@@ -90,15 +90,15 @@ export class OverlayWidgetDelegate implements IOverlayWidget {
this
.
_domNode
=
domNode
;
}
public
getId
():
string
{
getId
():
string
{
return
this
.
_id
;
}
public
getDomNode
():
HTMLElement
{
getDomNode
():
HTMLElement
{
return
this
.
_domNode
;
}
public
getPosition
():
IOverlayWidgetPosition
|
null
{
getPosition
():
IOverlayWidgetPosition
|
null
{
return
null
;
}
}
...
...
@@ -167,10 +167,10 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
protected
_viewZone
:
ViewZoneDelegate
|
null
=
null
;
protected
readonly
_disposables
=
new
DisposableStore
();
public
container
:
HTMLElement
|
null
=
null
;
public
domNode
:
HTMLElement
;
public
editor
:
ICodeEditor
;
public
options
:
IOptions
;
container
:
HTMLElement
|
null
=
null
;
domNode
:
HTMLElement
;
editor
:
ICodeEditor
;
options
:
IOptions
;
constructor
(
editor
:
ICodeEditor
,
options
:
IOptions
=
{})
{
...
...
@@ -191,7 +191,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
}));
}
public
dispose
():
void
{
dispose
():
void
{
if
(
this
.
_overlayWidget
)
{
this
.
editor
.
removeOverlayWidget
(
this
.
_overlayWidget
);
this
.
_overlayWidget
=
null
;
...
...
@@ -212,7 +212,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
this
.
_disposables
.
dispose
();
}
public
create
():
void
{
create
():
void
{
dom
.
addClass
(
this
.
domNode
,
'
zone-widget
'
);
if
(
this
.
options
.
className
)
{
...
...
@@ -231,7 +231,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
this
.
_applyStyles
();
}
public
style
(
styles
:
IStyles
):
void
{
style
(
styles
:
IStyles
):
void
{
if
(
styles
.
frameColor
)
{
this
.
options
.
frameColor
=
styles
.
frameColor
;
}
...
...
@@ -284,7 +284,7 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
}
}
public
get
position
():
Position
|
undefined
{
get
position
():
Position
|
undefined
{
const
[
id
]
=
this
.
_positionMarkerId
;
if
(
!
id
)
{
return
undefined
;
...
...
@@ -304,18 +304,15 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
protected
_isShowing
:
boolean
=
false
;
public
show
(
rangeOrPos
:
IRange
|
IPosition
,
heightInLines
:
number
):
void
{
const
range
=
Range
.
isIRange
(
rangeOrPos
)
?
rangeOrPos
:
new
Range
(
rangeOrPos
.
lineNumber
,
rangeOrPos
.
column
,
rangeOrPos
.
lineNumber
,
rangeOrPos
.
column
);
show
(
rangeOrPos
:
IRange
|
IPosition
,
heightInLines
:
number
):
void
{
const
range
=
Range
.
isIRange
(
rangeOrPos
)
?
Range
.
lift
(
rangeOrPos
)
:
Range
.
fromPositions
(
rangeOrPos
);
this
.
_isShowing
=
true
;
this
.
_showImpl
(
range
,
heightInLines
);
this
.
_isShowing
=
false
;
this
.
_positionMarkerId
=
this
.
editor
.
deltaDecorations
(
this
.
_positionMarkerId
,
[{
range
,
options
:
ModelDecorationOptions
.
EMPTY
}]);
}
public
hide
():
void
{
hide
():
void
{
if
(
this
.
_viewZone
)
{
this
.
editor
.
changeViewZones
(
accessor
=>
{
if
(
this
.
_viewZone
)
{
...
...
@@ -350,12 +347,8 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
return
result
;
}
private
_showImpl
(
where
:
IRange
,
heightInLines
:
number
):
void
{
const
position
=
{
lineNumber
:
where
.
startLineNumber
,
column
:
where
.
startColumn
};
private
_showImpl
(
where
:
Range
,
heightInLines
:
number
):
void
{
const
position
=
where
.
getStartPosition
();
const
layoutInfo
=
this
.
editor
.
getLayoutInfo
();
const
width
=
this
.
_getWidth
(
layoutInfo
);
this
.
domNode
.
style
.
width
=
`
${
width
}
px`
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录