Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
144782b5
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,发现更多精彩内容 >>
提交
144782b5
编写于
2月 13, 2017
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary events in view controller
上级
96fcdf1e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
31 deletion
+18
-31
src/vs/base/browser/mouseEvent.ts
src/vs/base/browser/mouseEvent.ts
+0
-6
src/vs/editor/browser/controller/mouseHandler.ts
src/vs/editor/browser/controller/mouseHandler.ts
+6
-7
src/vs/editor/browser/editorBrowser.ts
src/vs/editor/browser/editorBrowser.ts
+2
-2
src/vs/editor/browser/view/viewController.ts
src/vs/editor/browser/view/viewController.ts
+10
-16
未找到文件。
src/vs/base/browser/mouseEvent.ts
浏览文件 @
144782b5
...
...
@@ -193,10 +193,4 @@ export class StandardMouseWheelEvent {
}
}
}
}
export
enum
MouseDownEventType
{
Down
,
Select
,
Drag
}
\ No newline at end of file
src/vs/editor/browser/controller/mouseHandler.ts
浏览文件 @
144782b5
...
...
@@ -18,7 +18,7 @@ import { TimeoutTimer, RunOnceScheduler } from 'vs/base/common/async';
import
{
ViewContext
}
from
'
vs/editor/common/view/viewContext
'
;
import
{
VisibleRange
}
from
'
vs/editor/common/view/renderingContext
'
;
import
{
EditorMouseEventFactory
,
GlobalEditorMouseMoveMonitor
,
EditorMouseEvent
,
createEditorPagePosition
,
ClientCoordinates
}
from
'
vs/editor/browser/editorDom
'
;
import
{
StandardMouseWheelEvent
,
MouseDownEventType
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
StandardMouseWheelEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
EditorZoom
}
from
'
vs/editor/common/config/editorZoom
'
;
import
{
IViewCursorRenderData
}
from
'
vs/editor/browser/viewParts/viewCursors/viewCursor
'
;
import
*
as
viewEvents
from
'
vs/editor/common/view/viewEvents
'
;
...
...
@@ -412,7 +412,7 @@ class MouseDownOperation extends Disposable {
}
this
.
_dispatchMouse
(
position
,
MouseDownEventType
.
Select
);
this
.
_dispatchMouse
(
position
,
true
);
}
private
_onMouseDragThenMove
(
e
:
EditorMouseEvent
):
void
{
...
...
@@ -426,7 +426,6 @@ class MouseDownOperation extends Disposable {
}
this
.
_dragTargetPosition
=
position
.
position
;
this
.
_dispatchMouse
(
position
,
MouseDownEventType
.
Drag
);
this
.
_viewController
.
emitMouseDrag
({
event
:
e
,
target
:
this
.
_createMouseTarget
(
e
,
true
)
...
...
@@ -470,7 +469,7 @@ class MouseDownOperation extends Disposable {
return
;
}
this
.
_dispatchMouse
(
position
,
e
.
shiftKey
?
MouseDownEventType
.
Select
:
MouseDownEventType
.
Down
);
this
.
_dispatchMouse
(
position
,
e
.
shiftKey
);
if
(
!
this
.
_isActive
)
{
this
.
_isActive
=
true
;
...
...
@@ -497,7 +496,7 @@ class MouseDownOperation extends Disposable {
// Ignoring because position is unknown
return
;
}
this
.
_dispatchMouse
(
position
,
MouseDownEventType
.
Select
);
this
.
_dispatchMouse
(
position
,
true
);
},
10
);
}
...
...
@@ -564,13 +563,13 @@ class MouseDownOperation extends Disposable {
return
new
MousePosition
(
hintedPosition
,
t
.
mouseColumn
);
}
private
_dispatchMouse
(
position
:
MousePosition
,
mouseDownEventType
:
MouseDownEventType
):
void
{
private
_dispatchMouse
(
position
:
MousePosition
,
inSelectionMode
:
boolean
):
void
{
this
.
_viewController
.
dispatchMouse
({
position
:
position
.
position
,
mouseColumn
:
position
.
mouseColumn
,
startedOnLineNumbers
:
this
.
_mouseState
.
startedOnLineNumbers
,
mouseDownEventType
:
mouseDownEventTyp
e
,
inSelectionMode
:
inSelectionMod
e
,
mouseDownCount
:
this
.
_mouseState
.
count
,
altKey
:
this
.
_mouseState
.
altKey
,
ctrlKey
:
this
.
_mouseState
.
ctrlKey
,
...
...
src/vs/editor/browser/editorBrowser.ts
浏览文件 @
144782b5
...
...
@@ -7,7 +7,7 @@
import
{
IEventEmitter
}
from
'
vs/base/common/eventEmitter
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IMouseEvent
,
MouseDownEventType
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
IConstructorSignature1
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
...
...
@@ -106,7 +106,7 @@ export interface IMouseDispatchData {
mouseColumn
:
number
;
startedOnLineNumbers
:
boolean
;
mouseDownEventType
:
MouseDownEventType
;
inSelectionMode
:
boolean
;
mouseDownCount
:
number
;
altKey
:
boolean
;
ctrlKey
:
boolean
;
...
...
src/vs/editor/browser/view/viewController.ts
浏览文件 @
144782b5
...
...
@@ -5,7 +5,6 @@
'
use strict
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
MouseDownEventType
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditorMouseEvent
,
IViewController
,
IMouseDispatchData
}
from
'
vs/editor/browser/editorBrowser
'
;
...
...
@@ -80,13 +79,13 @@ export class ViewController implements IViewController {
if
(
data
.
startedOnLineNumbers
)
{
// If the dragging started on the gutter, then have operations work on the entire line
if
(
data
.
altKey
)
{
if
(
data
.
mouseDownEventType
===
MouseDownEventType
.
Select
)
{
if
(
data
.
inSelectionMode
)
{
this
.
lastCursorLineSelect
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
createCursor
(
'
mouse
'
,
data
.
position
,
true
);
}
}
else
{
if
(
data
.
mouseDownEventType
===
MouseDownEventType
.
Select
)
{
if
(
data
.
inSelectionMode
)
{
this
.
lineSelectDrag
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
lineSelect
(
'
mouse
'
,
data
.
position
);
...
...
@@ -96,13 +95,13 @@ export class ViewController implements IViewController {
this
.
selectAll
(
'
mouse
'
);
}
else
if
(
data
.
mouseDownCount
===
3
)
{
if
(
data
.
altKey
)
{
if
(
data
.
mouseDownEventType
===
MouseDownEventType
.
Select
)
{
if
(
data
.
inSelectionMode
)
{
this
.
lastCursorLineSelectDrag
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
lastCursorLineSelect
(
'
mouse
'
,
data
.
position
);
}
}
else
{
if
(
data
.
mouseDownEventType
===
MouseDownEventType
.
Select
)
{
if
(
data
.
inSelectionMode
)
{
this
.
lineSelectDrag
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
lineSelect
(
'
mouse
'
,
data
.
position
);
...
...
@@ -112,7 +111,7 @@ export class ViewController implements IViewController {
if
(
data
.
altKey
)
{
this
.
lastCursorWordSelect
(
'
mouse
'
,
data
.
position
);
}
else
{
if
(
data
.
mouseDownEventType
===
MouseDownEventType
.
Select
)
{
if
(
data
.
inSelectionMode
)
{
this
.
wordSelectDrag
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
wordSelect
(
'
mouse
'
,
data
.
position
);
...
...
@@ -125,7 +124,7 @@ export class ViewController implements IViewController {
this
.
columnSelect
(
'
mouse
'
,
data
.
position
,
data
.
mouseColumn
);
}
else
{
// Do multi-cursor operations only when purely alt is pressed
if
(
data
.
mouseDownEventType
===
MouseDownEventType
.
Select
)
{
if
(
data
.
inSelectionMode
)
{
this
.
lastCursorMoveToSelect
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
createCursor
(
'
mouse
'
,
data
.
position
,
false
);
...
...
@@ -135,15 +134,10 @@ export class ViewController implements IViewController {
}
}
}
else
{
switch
(
data
.
mouseDownEventType
)
{
case
MouseDownEventType
.
Down
:
this
.
moveTo
(
'
mouse
'
,
data
.
position
);
break
;
case
MouseDownEventType
.
Select
:
this
.
moveToSelect
(
'
mouse
'
,
data
.
position
);
break
;
default
:
break
;
if
(
data
.
inSelectionMode
)
{
this
.
moveToSelect
(
'
mouse
'
,
data
.
position
);
}
else
{
this
.
moveTo
(
'
mouse
'
,
data
.
position
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录