Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
321e236b
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
321e236b
编写于
9月 16, 2015
作者:
A
Andrew Casey
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5280 from amcasey/ReadonlyCleanup
Tracking span and readonly region cleanup
上级
6e515e6e
c97f0d5b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
18 deletion
+11
-18
src/InteractiveWindow/Editor/CustomTrackingSpan.cs
src/InteractiveWindow/Editor/CustomTrackingSpan.cs
+3
-3
src/InteractiveWindow/Editor/InteractiveWindow.UIThreadOnly.cs
...nteractiveWindow/Editor/InteractiveWindow.UIThreadOnly.cs
+8
-15
未找到文件。
src/InteractiveWindow/Editor/CustomTrackingSpan.cs
浏览文件 @
321e236b
...
...
@@ -17,10 +17,10 @@ internal sealed class CustomTrackingSpan : ITrackingSpan
private
readonly
ITrackingPoint
_start
;
private
readonly
ITrackingPoint
_end
;
public
CustomTrackingSpan
(
ITextSnapshot
snapshot
,
Span
span
,
PointTrackingMode
startTrackingMode
,
PointTrackingMode
endTrackingMod
e
)
public
CustomTrackingSpan
(
ITextSnapshot
snapshot
,
Span
span
,
bool
canAppend
=
fals
e
)
{
_start
=
snapshot
.
CreateTrackingPoint
(
span
.
Start
,
startTrackingMod
e
);
_end
=
snapshot
.
CreateTrackingPoint
(
span
.
End
,
endTrackingMod
e
);
_start
=
snapshot
.
CreateTrackingPoint
(
span
.
Start
,
PointTrackingMode
.
Negativ
e
);
_end
=
snapshot
.
CreateTrackingPoint
(
span
.
End
,
canAppend
?
PointTrackingMode
.
Positive
:
PointTrackingMode
.
Negativ
e
);
}
#
region
ITrackingSpan
Members
...
...
src/InteractiveWindow/Editor/InteractiveWindow.UIThreadOnly.cs
浏览文件 @
321e236b
...
...
@@ -427,7 +427,7 @@ private void MakeStandardInputReadonly()
// replace previous span w/ a span that won't grow...
var
oldSpan
=
sourceSpans
[
index
];
var
newSpan
=
new
CustomTrackingSpan
(
oldSpan
.
Snapshot
,
oldSpan
.
Span
,
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Negative
);
var
newSpan
=
new
CustomTrackingSpan
(
oldSpan
.
Snapshot
,
oldSpan
.
Span
);
ReplaceProjectionSpan
(
index
,
newSpan
);
ApplyProtection
(
StandardInputBuffer
,
_standardInputProtection
,
allowAppend
:
true
);
...
...
@@ -671,8 +671,7 @@ private void AppendInput(string text)
var
replSpan
=
new
CustomTrackingSpan
(
buffer
.
CurrentSnapshot
,
new
Span
(
span
.
Start
,
span
.
Length
+
text
.
Length
),
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Positive
);
canAppend
:
true
);
ReplaceProjectionSpan
(
spanCount
-
1
,
replSpan
);
TextView
.
Caret
.
EnsureVisible
();
...
...
@@ -884,9 +883,7 @@ private void NewOutputBuffer()
Debug
.
Assert
(
GetSpanKind
(
sourceSpan
)
==
ReplSpanKind
.
Output
);
var
nonGrowingSpan
=
new
CustomTrackingSpan
(
sourceSpan
.
Snapshot
,
sourceSpan
.
Span
,
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Negative
);
sourceSpan
.
Span
);
ReplaceProjectionSpan
(
_currentOutputProjectionSpan
,
nonGrowingSpan
);
AppendNewOutputProjectionBuffer
();
...
...
@@ -899,8 +896,7 @@ private void AppendNewOutputProjectionBuffer()
var
trackingSpan
=
new
CustomTrackingSpan
(
currentSnapshot
,
new
Span
(
currentSnapshot
.
Length
,
0
),
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Positive
);
canAppend
:
true
);
_currentOutputProjectionSpan
=
AppendProjectionSpan
(
trackingSpan
);
}
...
...
@@ -1330,8 +1326,7 @@ private void AddLanguageBuffer()
var
languageSpan
=
new
CustomTrackingSpan
(
CurrentLanguageBuffer
.
CurrentSnapshot
,
new
Span
(
0
,
0
),
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Positive
);
canAppend
:
true
);
// projection buffer update must be the last operation as it might trigger event that accesses prompt line mapping:
AppendProjectionSpans
(
promptSpan
,
languageSpan
);
...
...
@@ -1590,7 +1585,7 @@ private object CreateTrackingSpan(SnapshotSpan snapshotSpan)
{
return
snapshotSpan
.
GetText
();
}
return
new
CustomTrackingSpan
(
snapshot
,
snapshotSpan
.
Span
,
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Negative
);
return
new
CustomTrackingSpan
(
snapshot
,
snapshotSpan
.
Span
);
}
private
ITrackingSpan
CreateLanguageSpanForLine
(
ITextSnapshotLine
languageLine
)
...
...
@@ -1600,8 +1595,7 @@ private ITrackingSpan CreateLanguageSpanForLine(ITextSnapshotLine languageLine)
return
new
CustomTrackingSpan
(
CurrentLanguageBuffer
.
CurrentSnapshot
,
span
,
PointTrackingMode
.
Negative
,
lastLine
?
PointTrackingMode
.
Positive
:
PointTrackingMode
.
Negative
);
canAppend
:
lastLine
);
}
private
void
ScrollToCaret
()
...
...
@@ -2562,8 +2556,7 @@ private void AddStandardInputSpan()
var
inputSpan
=
new
CustomTrackingSpan
(
currentSnapshot
,
new
Span
(
currentSnapshot
.
Length
,
0
),
PointTrackingMode
.
Negative
,
PointTrackingMode
.
Positive
);
canAppend
:
true
);
AppendProjectionSpans
(
promptSpan
,
inputSpan
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录