Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4e9cc698
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,发现更多精彩内容 >>
提交
4e9cc698
编写于
5月 13, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
untitled and created files are pinned by default
上级
0744ade2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
6 addition
and
20 deletion
+6
-20
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+1
-1
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
...s/workbench/parts/files/browser/editors/textFileEditor.ts
+4
-4
src/vs/workbench/parts/files/browser/fileActions.ts
src/vs/workbench/parts/files/browser/fileActions.ts
+1
-4
src/vs/workbench/parts/files/electron-browser/electronFileTracker.ts
...bench/parts/files/electron-browser/electronFileTracker.ts
+0
-11
未找到文件。
src/vs/workbench/common/editor.ts
浏览文件 @
4e9cc698
...
...
@@ -333,7 +333,7 @@ export class TextEditorOptions extends EditorOptions {
public
static
from
(
input
:
IResourceInput
):
TextEditorOptions
{
let
options
:
TextEditorOptions
=
null
;
if
(
input
&&
input
.
options
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
input
.
options
.
preserveFocus
)
{
if
(
input
.
options
.
selection
||
input
.
options
.
forceOpen
||
input
.
options
.
preserveFocus
||
input
.
options
.
pinned
||
typeof
input
.
options
.
index
===
'
number
'
)
{
options
=
new
TextEditorOptions
();
}
...
...
src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
浏览文件 @
4e9cc698
...
...
@@ -184,13 +184,13 @@ export class TextFileEditor extends BaseTextEditor {
new
Action
(
'
workbench.files.action.createMissingFile
'
,
nls
.
localize
(
'
createFile
'
,
"
Create File
"
),
null
,
true
,
()
=>
{
return
this
.
fileService
.
updateContent
((
<
FileEditorInput
>
input
).
getResource
(),
''
).
then
(()
=>
{
// Add to working files
this
.
textFileService
.
getWorkingFilesModel
().
addEntry
((
<
FileEditorInput
>
input
).
getResource
());
// Open
return
this
.
editorService
.
openEditor
({
resource
:
(
<
FileEditorInput
>
input
).
getResource
(),
mime
:
MIME_TEXT
mime
:
MIME_TEXT
,
options
:
{
pinned
:
true
// new file gets pinned by default
}
});
});
})
...
...
src/vs/workbench/parts/files/browser/fileActions.ts
浏览文件 @
4e9cc698
...
...
@@ -578,10 +578,7 @@ export class GlobalNewUntitledFileAction extends Action {
public
run
():
TPromise
<
any
>
{
let
input
=
this
.
untitledEditorService
.
createOrGet
();
// Make sure this untitled buffer shows up in working files set
this
.
textFileService
.
getWorkingFilesModel
().
addEntry
(
input
.
getResource
());
return
this
.
editorService
.
openEditor
(
input
);
return
this
.
editorService
.
openEditor
(
input
,
EditorOptions
.
create
({
pinned
:
true
}));
// untitled are always pinned
}
}
...
...
src/vs/workbench/parts/files/electron-browser/electronFileTracker.ts
浏览文件 @
4e9cc698
...
...
@@ -6,7 +6,6 @@
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
TextFileChangeEvent
,
EventType
as
FileEventType
,
ITextFileService
,
AutoSaveMode
,
VIEWLET_ID
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
...
...
@@ -123,16 +122,6 @@ export class FileTracker implements IWorkbenchContribution {
return
viewletPromise
.
then
(()
=>
{
// Out of workspace files get added right away to working files model
resources
.
forEach
((
fileToOpen
)
=>
{
let
resource
=
fileToOpen
.
resource
;
let
workspace
=
this
.
contextService
.
getWorkspace
();
if
(
!
workspace
||
!
paths
.
isEqualOrParent
(
resource
.
fsPath
,
workspace
.
resource
.
fsPath
))
{
this
.
textFileService
.
getWorkingFilesModel
().
addEntry
(
resource
);
}
});
// In diffMode we open 2 resources as diff
if
(
diffMode
)
{
return
TPromise
.
join
(
resources
.
map
(
f
=>
this
.
editorService
.
inputToType
(
f
))).
then
((
inputs
:
EditorInput
[])
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录