Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c89e3cdc
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,发现更多精彩内容 >>
提交
c89e3cdc
编写于
2月 07, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scm: pimp up commit editor
上级
7f6ba7f6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
10 deletion
+32
-10
src/vs/workbench/parts/scm/electron-browser/media/scmViewlet.css
...workbench/parts/scm/electron-browser/media/scmViewlet.css
+12
-5
src/vs/workbench/parts/scm/electron-browser/scmEditor.ts
src/vs/workbench/parts/scm/electron-browser/scmEditor.ts
+19
-4
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+1
-1
未找到文件。
src/vs/workbench/parts/scm/electron-browser/media/scmViewlet.css
浏览文件 @
c89e3cdc
...
...
@@ -76,11 +76,18 @@
display
:
none
;
}
/* HACK */
.action-label.scm-commit
{
background-image
:
url('check.svg')
;
.monaco-shell.vs
.scm-viewlet
>
.scm-editor
>
.monaco-editor.focused
{
outline
:
1px
solid
rgba
(
0
,
122
,
204
,
0.4
);
}
.vs-dark
.action-label.scm-commit
{
background-image
:
url('check-inverse.svg')
;
.monaco-shell.vs-dark
.scm-viewlet
>
.scm-editor
>
.monaco-editor.focused
{
outline
:
1px
solid
rgba
(
14
,
99
,
156
,
0.6
);
}
.monaco-shell.hc-black
.scm-viewlet
>
.scm-editor
>
.monaco-editor
{
outline
:
1px
solid
#6fc3df
;
}
.monaco-shell.hc-black
.scm-viewlet
>
.scm-editor
>
.monaco-editor.focused
{
outline
:
2px
solid
#f38518
;
}
src/vs/workbench/parts/scm/electron-browser/scmEditor.ts
浏览文件 @
c89e3cdc
...
...
@@ -61,6 +61,8 @@ export const InSCMInputContextKey = new RawContextKey<boolean>('inSCMInput', fal
export
class
SCMEditor
{
private
static
VerticalPadding
=
4
;
private
editor
:
SCMCodeEditorWidget
;
private
disposables
:
IDisposable
[]
=
[];
...
...
@@ -76,7 +78,7 @@ export class SCMEditor {
scrollbar
:
{
horizontal
:
'
hidden
'
},
lineDecorationsWidth
:
0
,
lineDecorationsWidth
:
3
,
scrollBeyondLastLine
:
false
,
theme
:
this
.
themeService
.
getColorTheme
().
id
,
renderLineHighlight
:
'
none
'
,
...
...
@@ -106,15 +108,24 @@ export class SCMEditor {
this
.
editor
=
scopedInstantiationService
.
createInstance
(
SCMCodeEditorWidget
,
container
,
this
.
editorOptions
);
this
.
themeService
.
onDidColorThemeChange
(
e
=>
this
.
editor
.
updateOptions
(
this
.
editorOptions
),
null
,
this
.
disposables
);
this
.
editor
.
setModel
(
this
.
scmService
.
inputBoxModel
);
const
model
=
this
.
scmService
.
inputBoxModel
;
this
.
editor
.
setModel
(
model
);
this
.
editor
.
changeViewZones
(
accessor
=>
{
accessor
.
addZone
({
afterLineNumber
:
0
,
heightInPx
:
SCMEditor
.
VerticalPadding
,
domNode
:
document
.
createElement
(
'
div
'
)
});
});
}
get
lineHeight
():
number
{
private
get
lineHeight
():
number
{
return
this
.
editor
.
getConfiguration
().
lineHeight
;
}
// TODO@joao TODO@alex isn't there a better way to get the number of lines?
get
lineCount
():
number
{
private
get
lineCount
():
number
{
const
model
=
this
.
scmService
.
inputBoxModel
;
const
modelLength
=
model
.
getValueLength
();
const
lastPosition
=
model
.
getPositionAt
(
modelLength
);
...
...
@@ -124,6 +135,10 @@ export class SCMEditor {
return
viewHeight
/
this
.
lineHeight
;
}
get
viewHeight
():
number
{
return
Math
.
min
(
this
.
lineCount
,
8
)
*
this
.
lineHeight
+
(
SCMEditor
.
VerticalPadding
);
}
layout
(
dimension
:
IDimension
):
void
{
this
.
editor
.
layout
(
dimension
);
}
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
c89e3cdc
...
...
@@ -238,7 +238,7 @@ export class SCMViewlet extends Viewlet {
this
.
cachedDimension
=
dimension
;
const
editorHeight
=
Math
.
min
(
this
.
editor
.
lineCount
,
8
)
*
this
.
editor
.
line
Height
;
const
editorHeight
=
this
.
editor
.
view
Height
;
this
.
editor
.
layout
({
width
:
dimension
.
width
-
25
,
height
:
editorHeight
});
const
listHeight
=
dimension
.
height
-
(
editorHeight
+
12
/* margin */
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录