Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
6e9996ed
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
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,发现更多精彩内容 >>
提交
6e9996ed
编写于
1月 21, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Intl is not defined in Safari < 10
上级
7ecae478
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
2 deletion
+38
-2
src/vs/base/common/comparers.ts
src/vs/base/common/comparers.ts
+33
-2
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+5
-0
未找到文件。
src/vs/base/common/comparers.ts
浏览文件 @
6e9996ed
...
@@ -7,10 +7,41 @@
...
@@ -7,10 +7,41 @@
import
scorer
=
require
(
'
vs/base/common/scorer
'
);
import
scorer
=
require
(
'
vs/base/common/scorer
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
import
strings
=
require
(
'
vs/base/common/strings
'
);
const
FileNameComparer
=
new
Intl
.
Collator
(
undefined
,
{
numeric
:
true
,
sensitivity
:
'
base
'
});
let
intlFileNameComparer
:
Intl
.
Collator
;
export
function
setFileNameComparer
(
collator
:
Intl
.
Collator
):
void
{
intlFileNameComparer
=
collator
;
}
export
function
compareFileNames
(
one
:
string
,
other
:
string
):
number
{
export
function
compareFileNames
(
one
:
string
,
other
:
string
):
number
{
return
FileNameComparer
.
compare
(
one
||
''
,
other
||
''
);
if
(
intlFileNameComparer
)
{
return
intlFileNameComparer
.
compare
(
one
||
''
,
other
||
''
);
}
return
noIntlCompareFileNames
(
one
,
other
);
}
const
FileNameMatch
=
/^
([^
.
]
*
)(\.(
.*
))?
$/
;
export
function
noIntlCompareFileNames
(
one
:
string
,
other
:
string
):
number
{
let
oneMatch
=
FileNameMatch
.
exec
(
one
.
toLowerCase
());
let
otherMatch
=
FileNameMatch
.
exec
(
other
.
toLowerCase
());
let
oneName
=
oneMatch
[
1
]
||
''
;
let
oneExtension
=
oneMatch
[
3
]
||
''
;
let
otherName
=
otherMatch
[
1
]
||
''
;
let
otherExtension
=
otherMatch
[
3
]
||
''
;
if
(
oneName
!==
otherName
)
{
return
oneName
<
otherName
?
-
1
:
1
;
}
if
(
oneExtension
===
otherExtension
)
{
return
0
;
}
return
oneExtension
<
otherExtension
?
-
1
:
1
;
}
}
export
function
compareAnything
(
one
:
string
,
other
:
string
,
lookFor
:
string
):
number
{
export
function
compareAnything
(
one
:
string
,
other
:
string
,
lookFor
:
string
):
number
{
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
6e9996ed
...
@@ -12,6 +12,7 @@ import { IOptions } from 'vs/workbench/common/options';
...
@@ -12,6 +12,7 @@ import { IOptions } from 'vs/workbench/common/options';
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
{
domContentLoaded
}
from
'
vs/base/browser/dom
'
;
import
{
domContentLoaded
}
from
'
vs/base/browser/dom
'
;
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
comparer
=
require
(
'
vs/base/common/comparers
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
uri
from
'
vs/base/common/uri
'
;
import
uri
from
'
vs/base/common/uri
'
;
...
@@ -46,11 +47,15 @@ export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest {
...
@@ -46,11 +47,15 @@ export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest {
}
}
export
function
startup
(
configuration
:
IWindowConfiguration
):
TPromise
<
void
>
{
export
function
startup
(
configuration
:
IWindowConfiguration
):
TPromise
<
void
>
{
// Ensure others can listen to zoom level changes
// Ensure others can listen to zoom level changes
browser
.
setZoomFactor
(
webFrame
.
getZoomFactor
());
browser
.
setZoomFactor
(
webFrame
.
getZoomFactor
());
browser
.
setZoomLevel
(
webFrame
.
getZoomLevel
());
browser
.
setZoomLevel
(
webFrame
.
getZoomLevel
());
browser
.
setFullscreen
(
!!
configuration
.
fullscreen
);
browser
.
setFullscreen
(
!!
configuration
.
fullscreen
);
// Setup Intl
comparer
.
setFileNameComparer
(
new
Intl
.
Collator
(
undefined
,
{
numeric
:
true
,
sensitivity
:
'
base
'
}));
// Shell Options
// Shell Options
const
filesToOpen
=
configuration
.
filesToOpen
&&
configuration
.
filesToOpen
.
length
?
toInputs
(
configuration
.
filesToOpen
)
:
null
;
const
filesToOpen
=
configuration
.
filesToOpen
&&
configuration
.
filesToOpen
.
length
?
toInputs
(
configuration
.
filesToOpen
)
:
null
;
const
filesToCreate
=
configuration
.
filesToCreate
&&
configuration
.
filesToCreate
.
length
?
toInputs
(
configuration
.
filesToCreate
)
:
null
;
const
filesToCreate
=
configuration
.
filesToCreate
&&
configuration
.
filesToCreate
.
length
?
toInputs
(
configuration
.
filesToCreate
)
:
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录