Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6cf6af3e
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,发现更多精彩内容 >>
提交
6cf6af3e
编写于
3月 16, 2017
作者:
D
Daniel Imms
提交者:
GitHub
3月 16, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22751 from Microsoft/tyriar/22413
Polish terminal link hover hint
上级
eb0a05f7
f7de4e03
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
6 deletion
+27
-6
src/vs/workbench/parts/terminal/electron-browser/media/xterm.css
...workbench/parts/terminal/electron-browser/media/xterm.css
+3
-2
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+2
-0
src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts
...ch/parts/terminal/electron-browser/terminalLinkHandler.ts
+15
-4
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+7
-0
未找到文件。
src/vs/workbench/parts/terminal/electron-browser/media/xterm.css
浏览文件 @
6cf6af3e
...
...
@@ -52,15 +52,16 @@
.monaco-workbench
.panel.integrated-terminal
.xterm
a
{
color
:
inherit
;
cursor
:
text
;
text-decoration
:
none
;
}
.monaco-workbench
.panel.integrated-terminal
.xterm
a
:hover
{
.monaco-workbench
.panel.integrated-terminal
.ctrl-held
.xterm
a
:hover
{
cursor
:
pointer
;
text-decoration
:
underline
;
}
.monaco-workbench
.panel.integrated-terminal
.xterm
a
.xterm-invalid-link
:hover
{
.monaco-workbench
.panel.integrated-terminal
.ctrl-held
.xterm
a
.xterm-invalid-link
:hover
{
cursor
:
text
;
text-decoration
:
none
;
}
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
6cf6af3e
...
...
@@ -489,6 +489,8 @@ export class TerminalInstance implements ITerminalInstance {
private
_sendPtyDataToXterm
(
message
:
{
type
:
string
,
content
:
string
}):
void
{
if
(
message
.
type
===
'
data
'
)
{
this
.
_widgetManager
.
closeMessage
();
this
.
_linkHandler
.
disposeTooltipListeners
();
this
.
_xterm
.
write
(
message
.
content
);
}
}
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts
浏览文件 @
6cf6af3e
...
...
@@ -3,11 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
path
from
'
path
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
*
as
pfs
from
'
vs/base/node/pfs
'
;
import
Uri
from
'
vs/base/common/uri
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
TerminalWidgetManager
}
from
'
vs/workbench/parts/terminal/browser/terminalWidgetManager
'
;
...
...
@@ -35,6 +37,8 @@ export type XtermLinkMatcherHandler = (event: MouseEvent, uri: string) => boolea
export
type
XtermLinkMatcherValidationCallback
=
(
uri
:
string
,
element
:
HTMLElement
,
callback
:
(
isValid
:
boolean
)
=>
void
)
=>
void
;
export
class
TerminalLinkHandler
{
private
_tooltipDisposables
:
IDisposable
[]
=
[];
constructor
(
private
_widgetManager
:
TerminalWidgetManager
,
private
_xterm
:
any
,
...
...
@@ -68,6 +72,10 @@ export class TerminalLinkHandler {
});
}
public
disposeTooltipListeners
():
void
{
this
.
_tooltipDisposables
=
dispose
(
this
.
_tooltipDisposables
);
}
private
_wrapLinkHandler
(
handler
:
(
uri
:
string
)
=>
boolean
|
void
):
XtermLinkMatcherHandler
{
return
(
event
:
MouseEvent
,
uri
:
string
)
=>
{
// Require ctrl/cmd on click
...
...
@@ -112,7 +120,8 @@ export class TerminalLinkHandler {
private
_addTooltipEventListeners
(
element
:
HTMLElement
)
{
let
timeout
=
null
;
element
.
addEventListener
(
'
mouseenter
'
,
()
=>
{
let
isMessageShowing
=
false
;
this
.
_tooltipDisposables
.
push
(
dom
.
addDisposableListener
(
element
,
dom
.
EventType
.
MOUSE_OVER
,
()
=>
{
timeout
=
setTimeout
(()
=>
{
let
message
:
string
;
if
(
platform
.
isMacintosh
)
{
...
...
@@ -121,12 +130,14 @@ export class TerminalLinkHandler {
message
=
nls
.
localize
(
'
terminalLinkHandler.followLinkCtrl
'
,
'
Ctrl + click to follow link
'
);
}
this
.
_widgetManager
.
showMessage
(
element
.
offsetLeft
,
element
.
offsetTop
,
message
);
isMessageShowing
=
true
;
},
500
);
});
element
.
addEventListener
(
'
mouseleave
'
,
()
=>
{
})
)
;
this
.
_tooltipDisposables
.
push
(
dom
.
addDisposableListener
(
element
,
dom
.
EventType
.
MOUSE_OUT
,
()
=>
{
clearTimeout
(
timeout
);
this
.
_widgetManager
.
closeMessage
();
});
isMessageShowing
=
false
;
}));
}
private
_resolvePath
(
link
:
string
):
TPromise
<
string
>
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
6cf6af3e
...
...
@@ -145,6 +145,9 @@ export class TerminalPanel extends Panel {
}
private
_attachEventListeners
():
void
{
this
.
_register
(
DOM
.
addDisposableListener
(
window
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
KeyboardEvent
)
=>
this
.
_refreshCtrlHeld
(
e
.
ctrlKey
)));
this
.
_register
(
DOM
.
addDisposableListener
(
window
,
DOM
.
EventType
.
KEY_UP
,
(
e
:
KeyboardEvent
)
=>
this
.
_refreshCtrlHeld
(
e
.
ctrlKey
)));
this
.
_register
(
DOM
.
addDisposableListener
(
window
,
DOM
.
EventType
.
FOCUS
,
(
e
:
KeyboardEvent
)
=>
this
.
_refreshCtrlHeld
(
e
.
ctrlKey
)));
this
.
_register
(
DOM
.
addDisposableListener
(
this
.
_parentDomElement
,
'
mousedown
'
,
(
event
:
MouseEvent
)
=>
{
if
(
this
.
_terminalService
.
terminalInstances
.
length
===
0
)
{
return
;
...
...
@@ -197,6 +200,10 @@ export class TerminalPanel extends Panel {
}));
}
private
_refreshCtrlHeld
(
ctrlKey
:
boolean
):
void
{
this
.
_parentDomElement
.
classList
.
toggle
(
'
ctrl-held
'
,
ctrlKey
);
}
private
_updateTheme
(
theme
?:
ITheme
):
void
{
if
(
!
theme
)
{
theme
=
this
.
themeService
.
getTheme
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录