Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4ba9ad5d
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,发现更多精彩内容 >>
未验证
提交
4ba9ad5d
编写于
5月 25, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Emit view zones changed through view model
上级
5a1565ce
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
9 deletion
+26
-9
src/vs/editor/browser/view/viewImpl.ts
src/vs/editor/browser/view/viewImpl.ts
+2
-3
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+4
-4
src/vs/editor/common/viewModel/viewModelEventDispatcher.ts
src/vs/editor/common/viewModel/viewModelEventDispatcher.ts
+18
-1
src/vs/editor/common/viewModel/viewModelImpl.ts
src/vs/editor/common/viewModel/viewModelImpl.ts
+2
-1
未找到文件。
src/vs/editor/browser/view/viewImpl.ts
浏览文件 @
4ba9ad5d
...
@@ -450,10 +450,9 @@ export class View extends ViewEventHandler {
...
@@ -450,10 +450,9 @@ export class View extends ViewEventHandler {
return
new
OverviewRuler
(
this
.
_context
,
cssClassName
);
return
new
OverviewRuler
(
this
.
_context
,
cssClassName
);
}
}
public
change
(
callback
:
(
changeAccessor
:
IViewZoneChangeAccessor
)
=>
any
):
boolean
{
public
change
(
callback
:
(
changeAccessor
:
IViewZoneChangeAccessor
)
=>
any
):
void
{
const
hadAChange
=
this
.
viewZones
.
changeViewZones
(
callback
);
this
.
viewZones
.
changeViewZones
(
callback
);
this
.
_scheduleRender
();
this
.
_scheduleRender
();
return
hadAChange
;
}
}
public
render
(
now
:
boolean
,
everything
:
boolean
):
void
{
public
render
(
now
:
boolean
,
everything
:
boolean
):
void
{
...
...
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
4ba9ad5d
...
@@ -1385,10 +1385,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
...
@@ -1385,10 +1385,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
if
(
!
this
.
_modelData
||
!
this
.
_modelData
.
hasRealView
)
{
if
(
!
this
.
_modelData
||
!
this
.
_modelData
.
hasRealView
)
{
return
;
return
;
}
}
const
hasChanges
=
this
.
_modelData
.
view
.
change
(
callback
);
this
.
_modelData
.
view
.
change
(
callback
);
if
(
hasChanges
)
{
this
.
_onDidChangeViewZones
.
fire
();
}
}
}
public
getTargetAtClientPoint
(
clientX
:
number
,
clientY
:
number
):
editorBrowser
.
IMouseTarget
|
null
{
public
getTargetAtClientPoint
(
clientX
:
number
,
clientY
:
number
):
editorBrowser
.
IMouseTarget
|
null
{
...
@@ -1521,6 +1518,9 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
...
@@ -1521,6 +1518,9 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
case
OutgoingViewModelEventKind
.
ScrollChanged
:
case
OutgoingViewModelEventKind
.
ScrollChanged
:
this
.
_onDidScrollChange
.
fire
(
e
);
this
.
_onDidScrollChange
.
fire
(
e
);
break
;
break
;
case
OutgoingViewModelEventKind
.
ViewZonesChanged
:
this
.
_onDidChangeViewZones
.
fire
();
break
;
}
}
}));
}));
...
...
src/vs/editor/common/viewModel/viewModelEventDispatcher.ts
浏览文件 @
4ba9ad5d
...
@@ -148,6 +148,7 @@ export const enum OutgoingViewModelEventKind {
...
@@ -148,6 +148,7 @@ export const enum OutgoingViewModelEventKind {
ContentSizeChanged
,
ContentSizeChanged
,
FocusChanged
,
FocusChanged
,
ScrollChanged
,
ScrollChanged
,
ViewZonesChanged
,
}
}
export
class
ContentSizeChangedEvent
implements
IContentSizeChangedEvent
{
export
class
ContentSizeChangedEvent
implements
IContentSizeChangedEvent
{
...
@@ -251,7 +252,6 @@ export class ScrollChangedEvent {
...
@@ -251,7 +252,6 @@ export class ScrollChangedEvent {
return
(
!
this
.
scrollWidthChanged
&&
!
this
.
scrollLeftChanged
&&
!
this
.
scrollHeightChanged
&&
!
this
.
scrollTopChanged
);
return
(
!
this
.
scrollWidthChanged
&&
!
this
.
scrollLeftChanged
&&
!
this
.
scrollHeightChanged
&&
!
this
.
scrollTopChanged
);
}
}
public
merge
(
other
:
OutgoingViewModelEvent
):
ScrollChangedEvent
{
public
merge
(
other
:
OutgoingViewModelEvent
):
ScrollChangedEvent
{
if
(
other
.
kind
!==
OutgoingViewModelEventKind
.
ScrollChanged
)
{
if
(
other
.
kind
!==
OutgoingViewModelEventKind
.
ScrollChanged
)
{
return
this
;
return
this
;
...
@@ -263,8 +263,25 @@ export class ScrollChangedEvent {
...
@@ -263,8 +263,25 @@ export class ScrollChangedEvent {
}
}
}
}
export
class
ViewZonesChangedEvent
{
public
readonly
kind
=
OutgoingViewModelEventKind
.
ViewZonesChanged
;
constructor
()
{
}
public
isNoOp
():
boolean
{
return
false
;
}
public
merge
(
other
:
OutgoingViewModelEvent
):
ViewZonesChangedEvent
{
return
this
;
}
}
export
type
OutgoingViewModelEvent
=
(
export
type
OutgoingViewModelEvent
=
(
ContentSizeChangedEvent
ContentSizeChangedEvent
|
FocusChangedEvent
|
FocusChangedEvent
|
ScrollChangedEvent
|
ScrollChangedEvent
|
ViewZonesChangedEvent
);
);
src/vs/editor/common/viewModel/viewModelImpl.ts
浏览文件 @
4ba9ad5d
...
@@ -30,7 +30,7 @@ import { Cursor } from 'vs/editor/common/controller/cursor';
...
@@ -30,7 +30,7 @@ import { Cursor } from 'vs/editor/common/controller/cursor';
import
{
PartialCursorState
,
CursorState
,
IColumnSelectData
,
EditOperationType
,
CursorConfiguration
}
from
'
vs/editor/common/controller/cursorCommon
'
;
import
{
PartialCursorState
,
CursorState
,
IColumnSelectData
,
EditOperationType
,
CursorConfiguration
}
from
'
vs/editor/common/controller/cursorCommon
'
;
import
{
CursorChangeReason
}
from
'
vs/editor/common/controller/cursorEvents
'
;
import
{
CursorChangeReason
}
from
'
vs/editor/common/controller/cursorEvents
'
;
import
{
IWhitespaceChangeAccessor
}
from
'
vs/editor/common/viewLayout/linesLayout
'
;
import
{
IWhitespaceChangeAccessor
}
from
'
vs/editor/common/viewLayout/linesLayout
'
;
import
{
ViewModelEventDispatcher
,
OutgoingViewModelEvent
,
FocusChangedEvent
,
ScrollChangedEvent
}
from
'
vs/editor/common/viewModel/viewModelEventDispatcher
'
;
import
{
ViewModelEventDispatcher
,
OutgoingViewModelEvent
,
FocusChangedEvent
,
ScrollChangedEvent
,
ViewZonesChangedEvent
}
from
'
vs/editor/common/viewModel/viewModelEventDispatcher
'
;
import
{
ViewEventHandler
}
from
'
vs/editor/common/viewModel/viewEventHandler
'
;
import
{
ViewEventHandler
}
from
'
vs/editor/common/viewModel/viewEventHandler
'
;
const
USE_IDENTITY_LINES_COLLECTION
=
true
;
const
USE_IDENTITY_LINES_COLLECTION
=
true
;
...
@@ -980,6 +980,7 @@ export class ViewModel extends Disposable implements IViewModel {
...
@@ -980,6 +980,7 @@ export class ViewModel extends Disposable implements IViewModel {
const
hadAChange
=
this
.
viewLayout
.
changeWhitespace
(
callback
);
const
hadAChange
=
this
.
viewLayout
.
changeWhitespace
(
callback
);
if
(
hadAChange
)
{
if
(
hadAChange
)
{
this
.
_eventDispatcher
.
emitSingleViewEvent
(
new
viewEvents
.
ViewZonesChangedEvent
());
this
.
_eventDispatcher
.
emitSingleViewEvent
(
new
viewEvents
.
ViewZonesChangedEvent
());
this
.
_eventDispatcher
.
emitOutgoingEvent
(
new
ViewZonesChangedEvent
());
}
}
}
}
public
setMaxLineWidth
(
maxLineWidth
:
number
):
void
{
public
setMaxLineWidth
(
maxLineWidth
:
number
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录