Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
82211b4d
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,发现更多精彩内容 >>
提交
82211b4d
编写于
8月 08, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
home, end in suggest
fixes #10263
上级
11d23f15
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
90 addition
and
1 deletion
+90
-1
product.json
product.json
+6
-1
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+10
-0
src/vs/editor/contrib/suggest/browser/suggest.ts
src/vs/editor/contrib/suggest/browser/suggest.ts
+36
-0
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
+38
-0
未找到文件。
product.json
浏览文件 @
82211b4d
...
...
@@ -11,5 +11,10 @@
"win32AppId"
:
"{{E34003BB-9E10-4501-8C11-BE3FAA83F23F}"
,
"win32AppUserModelId"
:
"Microsoft.CodeOSS"
,
"darwinBundleIdentifier"
:
"com.visualstudio.code.oss"
,
"reportIssueUrl"
:
"https://github.com/Microsoft/vscode/issues/new"
"reportIssueUrl"
:
"https://github.com/Microsoft/vscode/issues/new"
,
"extensionsGallery"
:
{
"serviceUrl"
:
"https://marketplace.visualstudio.com/_apis/public/gallery"
,
"cacheUrl"
:
"https://vscode.blob.core.windows.net/gallery/index"
,
"itemUrl"
:
"https://marketplace.visualstudio.com/items"
}
}
\ No newline at end of file
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
82211b4d
...
...
@@ -376,6 +376,16 @@ export class List<T> implements IDisposable {
}
}
focusFirst
():
void
{
if
(
this
.
length
===
0
)
{
return
;
}
this
.
setFocus
(
0
);
}
focusLast
():
void
{
if
(
this
.
length
===
0
)
{
return
;
}
this
.
setFocus
(
this
.
length
-
1
);
}
getFocus
():
number
[]
{
return
this
.
focus
.
get
();
}
...
...
src/vs/editor/contrib/suggest/browser/suggest.ts
浏览文件 @
82211b4d
...
...
@@ -148,6 +148,12 @@ export class SuggestController implements IEditorContribution {
}
}
selectFirstSuggestion
():
void
{
if
(
this
.
widget
)
{
this
.
widget
.
selectFirst
();
}
}
selectPrevSuggestion
():
void
{
if
(
this
.
widget
)
{
this
.
widget
.
selectPrevious
();
...
...
@@ -160,6 +166,12 @@ export class SuggestController implements IEditorContribution {
}
}
selectLastSuggestion
():
void
{
if
(
this
.
widget
)
{
this
.
widget
.
selectLast
();
}
}
toggleSuggestionDetails
():
void
{
if
(
this
.
widget
)
{
this
.
widget
.
toggleDetails
();
...
...
@@ -254,6 +266,18 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({
}
}));
CommonEditorRegistry
.
registerEditorCommand2
(
new
SuggestCommand
({
id
:
'
selectFirstSuggestion
'
,
precondition
:
KbExpr
.
and
(
SuggestContext
.
Visible
,
SuggestContext
.
MultipleSuggestions
),
handler
:
c
=>
c
.
selectFirstSuggestion
(),
kbOpts
:
{
weight
:
weight
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyCode
.
Home
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
Home
]
}
}));
CommonEditorRegistry
.
registerEditorCommand2
(
new
SuggestCommand
({
id
:
'
selectPrevSuggestion
'
,
precondition
:
KbExpr
.
and
(
SuggestContext
.
Visible
,
SuggestContext
.
MultipleSuggestions
),
...
...
@@ -279,6 +303,18 @@ CommonEditorRegistry.registerEditorCommand2(new SuggestCommand({
}
}));
CommonEditorRegistry
.
registerEditorCommand2
(
new
SuggestCommand
({
id
:
'
selectLastSuggestion
'
,
precondition
:
KbExpr
.
and
(
SuggestContext
.
Visible
,
SuggestContext
.
MultipleSuggestions
),
handler
:
c
=>
c
.
selectLastSuggestion
(),
kbOpts
:
{
weight
:
weight
,
kbExpr
:
EditorContextKeys
.
TextFocus
,
primary
:
KeyCode
.
End
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
End
]
}
}));
CommonEditorRegistry
.
registerEditorCommand2
(
new
SuggestCommand
({
id
:
'
toggleSuggestionDetails
'
,
precondition
:
SuggestContext
.
Visible
,
...
...
src/vs/editor/contrib/suggest/browser/suggestWidget.ts
浏览文件 @
82211b4d
...
...
@@ -283,6 +283,14 @@ class SuggestionDetails {
this
.
scrollUp
(
80
);
}
scrollHome
():
void
{
this
.
body
.
scrollTop
=
0
;
}
scrollEnd
():
void
{
this
.
body
.
scrollTop
=
this
.
body
.
scrollHeight
;
}
private
configureFont
()
{
const
fontInfo
=
this
.
editor
.
getConfiguration
().
fontInfo
;
this
.
title
.
style
.
fontFamily
=
fontInfo
.
fontFamily
;
...
...
@@ -663,6 +671,21 @@ export class SuggestWidget implements IContentWidget, IDisposable {
}
}
selectLast
():
boolean
{
switch
(
this
.
state
)
{
case
State
.
Hidden
:
return
false
;
case
State
.
Details
:
this
.
details
.
scrollEnd
();
return
true
;
case
State
.
Loading
:
return
!
this
.
isAuto
;
default
:
this
.
list
.
focusLast
();
return
true
;
}
}
selectPreviousPage
():
boolean
{
switch
(
this
.
state
)
{
case
State
.
Hidden
:
...
...
@@ -693,6 +716,21 @@ export class SuggestWidget implements IContentWidget, IDisposable {
}
}
selectFirst
():
boolean
{
switch
(
this
.
state
)
{
case
State
.
Hidden
:
return
false
;
case
State
.
Details
:
this
.
details
.
scrollHome
();
return
true
;
case
State
.
Loading
:
return
!
this
.
isAuto
;
default
:
this
.
list
.
focusFirst
();
return
true
;
}
}
acceptSelectedSuggestion
():
boolean
{
switch
(
this
.
state
)
{
case
State
.
Hidden
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录