Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
eafa759c
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,发现更多精彩内容 >>
提交
eafa759c
编写于
9月 03, 2019
作者:
P
Peng Lyu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'rebornix/revealsource'
上级
730f47da
1a404522
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
56 addition
and
37 deletion
+56
-37
src/vs/editor/browser/controller/coreCommands.ts
src/vs/editor/browser/controller/coreCommands.ts
+15
-15
src/vs/editor/browser/controller/textAreaHandler.ts
src/vs/editor/browser/controller/textAreaHandler.ts
+1
-0
src/vs/editor/browser/viewParts/lines/viewLines.ts
src/vs/editor/browser/viewParts/lines/viewLines.ts
+16
-5
src/vs/editor/browser/viewParts/minimap/minimap.ts
src/vs/editor/browser/viewParts/minimap/minimap.ts
+1
-0
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+1
-1
src/vs/editor/common/controller/cursor.ts
src/vs/editor/common/controller/cursor.ts
+10
-10
src/vs/editor/common/controller/cursorCommon.ts
src/vs/editor/common/controller/cursorCommon.ts
+2
-2
src/vs/editor/common/view/viewEvents.ts
src/vs/editor/common/view/viewEvents.ts
+7
-1
src/vs/editor/contrib/multicursor/multicursor.ts
src/vs/editor/contrib/multicursor/multicursor.ts
+3
-3
未找到文件。
src/vs/editor/browser/controller/coreCommands.ts
浏览文件 @
eafa759c
...
...
@@ -294,7 +294,7 @@ export namespace CoreNavigationCommands {
CursorMoveCommands
.
moveTo
(
cursors
.
context
,
cursors
.
getPrimaryCursor
(),
this
.
_inSelectionMode
,
args
.
position
,
args
.
viewPosition
)
]
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -322,7 +322,7 @@ export namespace CoreNavigationCommands {
toViewLineNumber
:
result
.
toLineNumber
,
toViewVisualColumn
:
result
.
toVisualColumn
});
cursors
.
reveal
(
true
,
(
result
.
reversed
?
RevealTarget
.
TopMost
:
RevealTarget
.
BottomMost
),
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
(
result
.
reversed
?
RevealTarget
.
TopMost
:
RevealTarget
.
BottomMost
),
ScrollType
.
Smooth
);
}
protected
abstract
_getColumnSelectResult
(
context
:
CursorContext
,
primary
:
CursorState
,
prevColumnSelectData
:
IColumnSelectData
,
args
:
any
):
IColumnSelectResult
;
...
...
@@ -492,7 +492,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
move
(
cursors
.
context
,
cursors
.
getAll
(),
args
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -831,7 +831,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
moveToBeginningOfLine
(
cursors
.
context
,
cursors
.
getAll
(),
this
.
_inSelectionMode
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -880,7 +880,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
this
.
_exec
(
cursors
.
context
,
cursors
.
getAll
())
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
private
_exec
(
context
:
CursorContext
,
cursors
:
CursorState
[]):
PartialCursorState
[]
{
...
...
@@ -910,7 +910,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
moveToEndOfLine
(
cursors
.
context
,
cursors
.
getAll
(),
this
.
_inSelectionMode
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -959,7 +959,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
this
.
_exec
(
cursors
.
context
,
cursors
.
getAll
())
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
private
_exec
(
context
:
CursorContext
,
cursors
:
CursorState
[]):
PartialCursorState
[]
{
...
...
@@ -990,7 +990,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
moveToBeginningOfBuffer
(
cursors
.
context
,
cursors
.
getAll
(),
this
.
_inSelectionMode
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -1034,7 +1034,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
moveToEndOfBuffer
(
cursors
.
context
,
cursors
.
getAll
(),
this
.
_inSelectionMode
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -1253,7 +1253,7 @@ export namespace CoreNavigationCommands {
CursorMoveCommands
.
word
(
cursors
.
context
,
cursors
.
getPrimaryCursor
(),
this
.
_inSelectionMode
,
args
.
position
)
]
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -1313,7 +1313,7 @@ export namespace CoreNavigationCommands {
CursorMoveCommands
.
line
(
cursors
.
context
,
cursors
.
getPrimaryCursor
(),
this
.
_inSelectionMode
,
args
.
position
,
args
.
viewPosition
)
]
);
cursors
.
reveal
(
false
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
false
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -1385,7 +1385,7 @@ export namespace CoreNavigationCommands {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
expandLineSelection
(
cursors
.
context
,
cursors
.
getAll
())
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
});
...
...
@@ -1413,7 +1413,7 @@ export namespace CoreNavigationCommands {
CursorMoveCommands
.
cancelSelection
(
cursors
.
context
,
cursors
.
getPrimaryCursor
())
]
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
});
...
...
@@ -1440,7 +1440,7 @@ export namespace CoreNavigationCommands {
cursors
.
getPrimaryCursor
()
]
);
cursors
.
reveal
(
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
Primary
,
ScrollType
.
Smooth
);
}
});
...
...
@@ -1488,7 +1488,7 @@ export namespace CoreNavigationCommands {
const
viewRange
=
cursors
.
context
.
convertModelRangeToViewRange
(
range
);
cursors
.
revealRange
(
false
,
viewRange
,
revealAt
,
ScrollType
.
Smooth
);
cursors
.
revealRange
(
args
.
source
,
false
,
viewRange
,
revealAt
,
ScrollType
.
Smooth
);
}
});
...
...
src/vs/editor/browser/controller/textAreaHandler.ts
浏览文件 @
eafa759c
...
...
@@ -280,6 +280,7 @@ export class TextAreaHandler extends ViewPart {
const
column
=
this
.
_selections
[
0
].
startColumn
;
this
.
_context
.
privateViewEventBus
.
emit
(
new
viewEvents
.
ViewRevealRangeRequestEvent
(
'
keyboard
'
,
new
Range
(
lineNumber
,
column
,
lineNumber
,
column
),
viewEvents
.
VerticalRevealType
.
Simple
,
true
,
...
...
src/vs/editor/browser/viewParts/lines/viewLines.ts
浏览文件 @
eafa759c
...
...
@@ -12,6 +12,7 @@ import { PartFingerprint, PartFingerprints, ViewPart } from 'vs/editor/browser/v
import
{
DomReadingContext
,
ViewLine
,
ViewLineOptions
}
from
'
vs/editor/browser/viewParts/lines/viewLine
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
}
from
'
vs/editor/common/core/range
'
;
import
{
Selection
}
from
'
vs/editor/common/core/selection
'
;
import
{
ScrollType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
HorizontalRange
,
IViewLines
,
LineVisibleRanges
}
from
'
vs/editor/common/view/renderingContext
'
;
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
...
...
@@ -71,6 +72,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
private
_typicalHalfwidthCharacterWidth
:
number
;
private
_isViewportWrapping
:
boolean
;
private
_revealHorizontalRightPadding
:
number
;
private
_selections
:
Selection
[];
private
_scrollOff
:
number
;
private
_canUseLayerHinting
:
boolean
;
private
_viewLineOptions
:
ViewLineOptions
;
...
...
@@ -98,6 +100,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
this
.
_scrollOff
=
conf
.
editor
.
viewInfo
.
cursorSurroundingLines
;
this
.
_canUseLayerHinting
=
conf
.
editor
.
canUseLayerHinting
;
this
.
_viewLineOptions
=
new
ViewLineOptions
(
conf
,
this
.
_context
.
theme
.
type
);
this
.
_selections
=
[];
PartFingerprints
.
write
(
this
.
domNode
,
PartFingerprint
.
ViewLines
);
this
.
domNode
.
setClassName
(
'
view-lines
'
);
...
...
@@ -188,6 +191,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
return
false
;
}
public
onCursorStateChanged
(
e
:
viewEvents
.
ViewCursorStateChangedEvent
):
boolean
{
this
.
_selections
=
e
.
selections
;
const
rendStartLineNumber
=
this
.
_visibleLines
.
getStartLineNumber
();
const
rendEndLineNumber
=
this
.
_visibleLines
.
getEndLineNumber
();
let
r
=
false
;
...
...
@@ -223,7 +227,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
public
onRevealRangeRequest
(
e
:
viewEvents
.
ViewRevealRangeRequestEvent
):
boolean
{
// Using the future viewport here in order to handle multiple
// incoming reveal range requests that might all desire to be animated
const
desiredScrollTop
=
this
.
_computeScrollTopToRevealRange
(
this
.
_context
.
viewLayout
.
getFutureViewport
(),
e
.
range
,
e
.
verticalType
);
const
desiredScrollTop
=
this
.
_computeScrollTopToRevealRange
(
this
.
_context
.
viewLayout
.
getFutureViewport
(),
e
.
source
,
e
.
range
,
e
.
verticalType
);
// validate the new desired scroll top
let
newScrollPosition
=
this
.
_context
.
viewLayout
.
validateScrollPosition
({
scrollTop
:
desiredScrollTop
});
...
...
@@ -589,7 +593,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
}
}
private
_computeScrollTopToRevealRange
(
viewport
:
Viewport
,
range
:
Range
,
verticalType
:
viewEvents
.
VerticalRevealType
):
number
{
private
_computeScrollTopToRevealRange
(
viewport
:
Viewport
,
source
:
string
,
range
:
Range
,
verticalType
:
viewEvents
.
VerticalRevealType
):
number
{
const
viewportStartY
=
viewport
.
top
;
const
viewportHeight
=
viewport
.
height
;
const
viewportEndY
=
viewportStartY
+
viewportHeight
;
...
...
@@ -600,9 +604,16 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
boxStartY
=
this
.
_context
.
viewLayout
.
getVerticalOffsetForLineNumber
(
range
.
startLineNumber
);
boxEndY
=
this
.
_context
.
viewLayout
.
getVerticalOffsetForLineNumber
(
range
.
endLineNumber
)
+
this
.
_lineHeight
;
const
context
=
Math
.
min
((
viewportHeight
/
this
.
_lineHeight
)
/
2
,
this
.
_scrollOff
);
boxStartY
-=
context
*
this
.
_lineHeight
;
boxEndY
+=
Math
.
max
(
0
,
(
context
-
1
))
*
this
.
_lineHeight
;
const
shouldIgnoreScrollOff
=
source
===
'
mouse
'
&&
(
this
.
_selections
.
length
>
1
// scroll off might trigger scrolling and mess up with multi cursor
||
(
this
.
_selections
.
length
>
0
&&
this
.
_selections
[
0
].
isEmpty
())
// we don't want to single click triggering selection
);
if
(
!
shouldIgnoreScrollOff
)
{
const
context
=
Math
.
min
((
viewportHeight
/
this
.
_lineHeight
)
/
2
,
this
.
_scrollOff
);
boxStartY
-=
context
*
this
.
_lineHeight
;
boxEndY
+=
Math
.
max
(
0
,
(
context
-
1
))
*
this
.
_lineHeight
;
}
if
(
verticalType
===
viewEvents
.
VerticalRevealType
.
Simple
||
verticalType
===
viewEvents
.
VerticalRevealType
.
Bottom
)
{
// Reveal one line more when the last line would be covered by the scrollbar - arrow down case or revealing a line explicitly at bottom
...
...
src/vs/editor/browser/viewParts/minimap/minimap.ts
浏览文件 @
eafa759c
...
...
@@ -517,6 +517,7 @@ export class Minimap extends ViewPart {
lineNumber
=
Math
.
min
(
lineNumber
,
this
.
_context
.
model
.
getLineCount
());
this
.
_context
.
privateViewEventBus
.
emit
(
new
viewEvents
.
ViewRevealRangeRequestEvent
(
'
mouse
'
,
new
Range
(
lineNumber
,
1
,
lineNumber
,
1
),
viewEvents
.
VerticalRevealType
.
Center
,
false
,
...
...
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
eafa759c
...
...
@@ -526,7 +526,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
const
validatedModelRange
=
this
.
_modelData
.
model
.
validateRange
(
modelRange
);
const
viewRange
=
this
.
_modelData
.
viewModel
.
coordinatesConverter
.
convertModelRangeToViewRange
(
validatedModelRange
);
this
.
_modelData
.
cursor
.
emitCursorRevealRange
(
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
);
this
.
_modelData
.
cursor
.
emitCursorRevealRange
(
'
api
'
,
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
);
}
public
revealLine
(
lineNumber
:
number
,
scrollType
:
editorCommon
.
ScrollType
=
editorCommon
.
ScrollType
.
Smooth
):
void
{
...
...
src/vs/editor/common/controller/cursor.ts
浏览文件 @
eafa759c
...
...
@@ -295,12 +295,12 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
this
.
_columnSelectData
=
columnSelectData
;
}
public
reveal
(
horizontal
:
boolean
,
target
:
RevealTarget
,
scrollType
:
editorCommon
.
ScrollType
):
void
{
this
.
_revealRange
(
target
,
viewEvents
.
VerticalRevealType
.
Simple
,
horizontal
,
scrollType
);
public
reveal
(
source
:
string
,
horizontal
:
boolean
,
target
:
RevealTarget
,
scrollType
:
editorCommon
.
ScrollType
):
void
{
this
.
_revealRange
(
source
,
target
,
viewEvents
.
VerticalRevealType
.
Simple
,
horizontal
,
scrollType
);
}
public
revealRange
(
revealHorizontal
:
boolean
,
viewRange
:
Range
,
verticalType
:
viewEvents
.
VerticalRevealType
,
scrollType
:
editorCommon
.
ScrollType
)
{
this
.
emitCursorRevealRange
(
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
);
public
revealRange
(
source
:
string
,
revealHorizontal
:
boolean
,
viewRange
:
Range
,
verticalType
:
viewEvents
.
VerticalRevealType
,
scrollType
:
editorCommon
.
ScrollType
)
{
this
.
emitCursorRevealRange
(
source
,
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
);
}
public
scrollTo
(
desiredScrollTop
:
number
):
void
{
...
...
@@ -371,7 +371,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
}
this
.
setStates
(
'
restoreState
'
,
CursorChangeReason
.
NotSet
,
CursorState
.
fromModelSelections
(
desiredSelections
));
this
.
reveal
(
true
,
RevealTarget
.
Primary
,
editorCommon
.
ScrollType
.
Immediate
);
this
.
reveal
(
'
restoreState
'
,
true
,
RevealTarget
.
Primary
,
editorCommon
.
ScrollType
.
Immediate
);
}
private
_onModelContentChanged
(
hadFlushEvent
:
boolean
):
void
{
...
...
@@ -543,7 +543,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
return
true
;
}
private
_revealRange
(
revealTarget
:
RevealTarget
,
verticalType
:
viewEvents
.
VerticalRevealType
,
revealHorizontal
:
boolean
,
scrollType
:
editorCommon
.
ScrollType
):
void
{
private
_revealRange
(
source
:
string
,
revealTarget
:
RevealTarget
,
verticalType
:
viewEvents
.
VerticalRevealType
,
revealHorizontal
:
boolean
,
scrollType
:
editorCommon
.
ScrollType
):
void
{
const
viewPositions
=
this
.
_cursors
.
getViewPositions
();
let
viewPosition
=
viewPositions
[
0
];
...
...
@@ -568,13 +568,13 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
}
const
viewRange
=
new
Range
(
viewPosition
.
lineNumber
,
viewPosition
.
column
,
viewPosition
.
lineNumber
,
viewPosition
.
column
);
this
.
emitCursorRevealRange
(
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
);
this
.
emitCursorRevealRange
(
source
,
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
);
}
public
emitCursorRevealRange
(
viewRange
:
Range
,
verticalType
:
viewEvents
.
VerticalRevealType
,
revealHorizontal
:
boolean
,
scrollType
:
editorCommon
.
ScrollType
)
{
public
emitCursorRevealRange
(
source
:
string
,
viewRange
:
Range
,
verticalType
:
viewEvents
.
VerticalRevealType
,
revealHorizontal
:
boolean
,
scrollType
:
editorCommon
.
ScrollType
)
{
try
{
const
eventsCollector
=
this
.
_beginEmit
();
eventsCollector
.
emit
(
new
viewEvents
.
ViewRevealRangeRequestEvent
(
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
));
eventsCollector
.
emit
(
new
viewEvents
.
ViewRevealRangeRequestEvent
(
source
,
viewRange
,
verticalType
,
revealHorizontal
,
scrollType
));
}
finally
{
this
.
_endEmit
();
}
...
...
@@ -748,7 +748,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
this
.
_validateAutoClosedActions
();
if
(
this
.
_emitStateChangedIfNecessary
(
source
,
cursorChangeReason
,
oldState
))
{
this
.
_revealRange
(
RevealTarget
.
Primary
,
viewEvents
.
VerticalRevealType
.
Simple
,
true
,
editorCommon
.
ScrollType
.
Smooth
);
this
.
_revealRange
(
source
,
RevealTarget
.
Primary
,
viewEvents
.
VerticalRevealType
.
Simple
,
true
,
editorCommon
.
ScrollType
.
Smooth
);
}
}
...
...
src/vs/editor/common/controller/cursorCommon.ts
浏览文件 @
eafa759c
...
...
@@ -55,8 +55,8 @@ export interface ICursors {
setColumnSelectData
(
columnSelectData
:
IColumnSelectData
):
void
;
setStates
(
source
:
string
,
reason
:
CursorChangeReason
,
states
:
PartialCursorState
[]
|
null
):
void
;
reveal
(
horizontal
:
boolean
,
target
:
RevealTarget
,
scrollType
:
ScrollType
):
void
;
revealRange
(
revealHorizontal
:
boolean
,
viewRange
:
Range
,
verticalType
:
VerticalRevealType
,
scrollType
:
ScrollType
):
void
;
reveal
(
source
:
string
,
horizontal
:
boolean
,
target
:
RevealTarget
,
scrollType
:
ScrollType
):
void
;
revealRange
(
source
:
string
,
revealHorizontal
:
boolean
,
viewRange
:
Range
,
verticalType
:
VerticalRevealType
,
scrollType
:
ScrollType
):
void
;
scrollTo
(
desiredScrollTop
:
number
):
void
;
...
...
src/vs/editor/common/view/viewEvents.ts
浏览文件 @
eafa759c
...
...
@@ -198,7 +198,13 @@ export class ViewRevealRangeRequestEvent {
public
readonly
scrollType
:
ScrollType
;
constructor
(
range
:
Range
,
verticalType
:
VerticalRevealType
,
revealHorizontal
:
boolean
,
scrollType
:
ScrollType
)
{
/**
* Source of the call that caused the event.
*/
readonly
source
:
string
;
constructor
(
source
:
string
,
range
:
Range
,
verticalType
:
VerticalRevealType
,
revealHorizontal
:
boolean
,
scrollType
:
ScrollType
)
{
this
.
source
=
source
;
this
.
range
=
range
;
this
.
verticalType
=
verticalType
;
this
.
revealHorizontal
=
revealHorizontal
;
...
...
src/vs/editor/contrib/multicursor/multicursor.ts
浏览文件 @
eafa759c
...
...
@@ -72,7 +72,7 @@ export class InsertCursorAbove extends EditorAction {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
addCursorUp
(
context
,
cursors
.
getAll
(),
useLogicalLine
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
TopMost
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
TopMost
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -121,7 +121,7 @@ export class InsertCursorBelow extends EditorAction {
CursorChangeReason
.
Explicit
,
CursorMoveCommands
.
addCursorDown
(
context
,
cursors
.
getAll
(),
useLogicalLine
)
);
cursors
.
reveal
(
true
,
RevealTarget
.
BottomMost
,
ScrollType
.
Smooth
);
cursors
.
reveal
(
args
.
source
,
true
,
RevealTarget
.
BottomMost
,
ScrollType
.
Smooth
);
}
}
...
...
@@ -1053,4 +1053,4 @@ registerEditorAction(MoveSelectionToPreviousFindMatchAction);
registerEditorAction
(
SelectHighlightsAction
);
registerEditorAction
(
CompatChangeAll
);
registerEditorAction
(
InsertCursorAtEndOfLineSelected
);
registerEditorAction
(
InsertCursorAtTopOfLineSelected
);
\ No newline at end of file
registerEditorAction
(
InsertCursorAtTopOfLineSelected
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录