Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7919b9d1
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,发现更多精彩内容 >>
提交
7919b9d1
编写于
5月 13, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - clarify active/visible text editor control to support diff as well
上级
31e42aac
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
14 deletion
+20
-14
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
+6
-3
src/vs/workbench/services/editor/browser/nextEditorService.ts
...vs/workbench/services/editor/browser/nextEditorService.ts
+7
-6
src/vs/workbench/services/editor/common/nextEditorService.ts
src/vs/workbench/services/editor/common/nextEditorService.ts
+7
-5
未找到文件。
src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts
浏览文件 @
7919b9d1
...
...
@@ -19,7 +19,7 @@ import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRe
import
{
themeColorFromId
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEditorOptions
,
RenderLineNumbersType
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
INextEditorService
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/nextEditorService
'
;
import
{
ICode
Editor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
isCodeEditor
,
isDiff
Editor
}
from
'
vs/editor/browser/editorBrowser
'
;
export
const
GOTO_LINE_PREFIX
=
'
:
'
;
...
...
@@ -37,10 +37,13 @@ export class GotoLineAction extends QuickOpenAction {
public
run
():
TPromise
<
void
>
{
const
editor
=
this
.
editorService
.
activeTextEditorControl
as
ICodeEditor
;
let
editor
=
this
.
editorService
.
activeTextEditorControl
;
if
(
isDiffEditor
(
editor
))
{
editor
=
editor
.
getModifiedEditor
();
}
let
restoreOptions
:
IEditorOptions
=
null
;
if
(
editor
)
{
if
(
isCodeEditor
(
editor
)
)
{
const
config
=
editor
.
getConfiguration
();
if
(
config
.
viewInfo
.
renderLineNumbers
===
RenderLineNumbersType
.
Relative
)
{
editor
.
updateOptions
({
...
...
src/vs/workbench/services/editor/browser/nextEditorService.ts
浏览文件 @
7919b9d1
...
...
@@ -29,7 +29,8 @@ import { INextEditorService, IResourceEditor, ACTIVE_GROUP_TYPE, SIDE_GROUP_TYPE
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
Disposable
,
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
coalesce
}
from
'
vs/base/common/arrays
'
;
import
{
isCodeEditor
,
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
isCodeEditor
,
isDiffEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IEditor
as
ITextEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
toWinJsPromise
}
from
'
vs/base/common/async
'
;
type
ICachedEditorInput
=
ResourceEditorInput
|
IFileEditorInput
|
DataUriEditorInput
;
...
...
@@ -139,11 +140,11 @@ export class NextEditorService extends Disposable implements INextEditorService
return
activeGroup
?
activeGroup
.
activeControl
:
void
0
;
}
get
activeTextEditorControl
():
I
Code
Editor
{
get
activeTextEditorControl
():
I
Text
Editor
{
const
activeControl
=
this
.
activeControl
;
if
(
activeControl
)
{
const
activeControlWidget
=
activeControl
.
getControl
();
if
(
isCodeEditor
(
activeControlWidget
))
{
if
(
isCodeEditor
(
activeControlWidget
)
||
isDiffEditor
(
activeControlWidget
)
)
{
return
activeControlWidget
;
}
}
...
...
@@ -161,8 +162,8 @@ export class NextEditorService extends Disposable implements INextEditorService
return
coalesce
(
this
.
nextEditorGroupsService
.
groups
.
map
(
group
=>
group
.
activeControl
));
}
get
visibleTextEditorControls
():
I
Code
Editor
[]
{
return
this
.
visibleControls
.
map
(
control
=>
control
.
getControl
()
as
I
CodeEditor
).
filter
(
widget
=>
isCode
Editor
(
widget
));
get
visibleTextEditorControls
():
I
Text
Editor
[]
{
return
this
.
visibleControls
.
map
(
control
=>
control
.
getControl
()
as
I
TextEditor
).
filter
(
widget
=>
isCodeEditor
(
widget
)
||
isDiff
Editor
(
widget
));
}
get
visibleEditors
():
IEditorInput
[]
{
...
...
@@ -358,7 +359,7 @@ export class NextEditorService extends Disposable implements INextEditorService
invokeWithinEditorContext
<
T
>
(
fn
:
(
accessor
:
ServicesAccessor
)
=>
T
):
T
{
const
activeTextEditorControl
=
this
.
activeTextEditorControl
;
if
(
activeTextEditorControl
)
{
if
(
isCodeEditor
(
activeTextEditorControl
)
)
{
return
activeTextEditorControl
.
invokeWithinContext
(
fn
);
}
...
...
src/vs/workbench/services/editor/common/nextEditorService.ts
浏览文件 @
7919b9d1
...
...
@@ -9,7 +9,7 @@ import { createDecorator, ServiceIdentifier, ServicesAccessor } from 'vs/platfor
import
{
IEditorInput
,
IResourceInput
,
IUntitledResourceInput
,
IResourceDiffInput
,
IResourceSideBySideInput
,
IEditor
,
IEditorOptions
}
from
'
vs/platform/editor/common/editor
'
;
import
{
GroupIdentifier
,
IEditorOpeningEvent
,
IEditorInputWithOptions
,
IEditorIdentifier
}
from
'
vs/workbench/common/editor
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IEditor
as
I
Code
Editor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IEditor
as
I
Text
Editor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
INextEditorGroup
}
from
'
vs/workbench/services/group/common/nextEditorGroupsService
'
;
export
const
INextEditorService
=
createDecorator
<
INextEditorService
>
(
'
nextEditorService
'
);
...
...
@@ -65,9 +65,10 @@ export interface INextEditorService {
/**
* The currently active text editor control if there is a control active
* and it is an instance of the code text editor.
* and it is an instance of the code text editor (either normal or diff
* editor).
*/
readonly
activeTextEditorControl
:
I
Code
Editor
;
readonly
activeTextEditorControl
:
I
Text
Editor
;
/**
* The currently active editor if any.
...
...
@@ -80,9 +81,10 @@ export interface INextEditorService {
readonly
visibleControls
:
ReadonlyArray
<
IEditor
>
;
/**
* All text editor controls that are currently visible across all editor groups.
* All text editor controls (either normal or diff editor) that are currently
* visible across all editor groups.
*/
readonly
visibleTextEditorControls
:
ReadonlyArray
<
I
Code
Editor
>
;
readonly
visibleTextEditorControls
:
ReadonlyArray
<
I
Text
Editor
>
;
/**
* All editors that are currently visible across all editor groups.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录