Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f5fdb8e0
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,发现更多精彩内容 >>
提交
f5fdb8e0
编写于
4月 27, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #43208: Add editor.scrollBeyondLastColumn
上级
9f5fd606
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
3 deletion
+23
-3
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+5
-0
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+10
-0
src/vs/editor/common/viewLayout/viewLayout.ts
src/vs/editor/common/viewLayout/viewLayout.ts
+2
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+6
-0
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
f5fdb8e0
...
...
@@ -254,6 +254,11 @@ const editorConfiguration: IConfigurationNode = {
'
default
'
:
EDITOR_DEFAULTS
.
viewInfo
.
scrollBeyondLastLine
,
'
description
'
:
nls
.
localize
(
'
scrollBeyondLastLine
'
,
"
Controls if the editor will scroll beyond the last line
"
)
},
'
editor.scrollBeyondLastColumn
'
:
{
'
type
'
:
'
number
'
,
'
default
'
:
EDITOR_DEFAULTS
.
viewInfo
.
scrollBeyondLastColumn
,
'
description
'
:
nls
.
localize
(
'
scrollBeyondLastColumn
'
,
"
Controls if the editor will scroll beyond the last column
"
)
},
'
editor.smoothScrolling
'
:
{
'
type
'
:
'
boolean
'
,
'
default
'
:
EDITOR_DEFAULTS
.
viewInfo
.
smoothScrolling
,
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
f5fdb8e0
...
...
@@ -300,6 +300,11 @@ export interface IEditorOptions {
* Defaults to true.
*/
scrollBeyondLastLine
?:
boolean
;
/**
* Enable that scrolling can go beyond the last column by a number of columns.
* Defaults to 5.
*/
scrollBeyondLastColumn
?:
number
;
/**
* Enable that the editor animates scrolling to a position.
* Defaults to false.
...
...
@@ -825,6 +830,7 @@ export interface InternalEditorViewOptions {
readonly
cursorWidth
:
number
;
readonly
hideCursorInOverviewRuler
:
boolean
;
readonly
scrollBeyondLastLine
:
boolean
;
readonly
scrollBeyondLastColumn
:
number
;
readonly
smoothScrolling
:
boolean
;
readonly
stopRenderingLineAfter
:
number
;
readonly
renderWhitespace
:
'
none
'
|
'
boundary
'
|
'
all
'
;
...
...
@@ -1105,6 +1111,7 @@ export class InternalEditorOptions {
&&
a
.
cursorWidth
===
b
.
cursorWidth
&&
a
.
hideCursorInOverviewRuler
===
b
.
hideCursorInOverviewRuler
&&
a
.
scrollBeyondLastLine
===
b
.
scrollBeyondLastLine
&&
a
.
scrollBeyondLastColumn
===
b
.
scrollBeyondLastColumn
&&
a
.
smoothScrolling
===
b
.
smoothScrolling
&&
a
.
stopRenderingLineAfter
===
b
.
stopRenderingLineAfter
&&
a
.
renderWhitespace
===
b
.
renderWhitespace
...
...
@@ -1718,6 +1725,7 @@ export class EditorOptionsValidator {
cursorWidth
:
_clampedInt
(
opts
.
cursorWidth
,
defaults
.
cursorWidth
,
0
,
Number
.
MAX_VALUE
),
hideCursorInOverviewRuler
:
_boolean
(
opts
.
hideCursorInOverviewRuler
,
defaults
.
hideCursorInOverviewRuler
),
scrollBeyondLastLine
:
_boolean
(
opts
.
scrollBeyondLastLine
,
defaults
.
scrollBeyondLastLine
),
scrollBeyondLastColumn
:
_clampedInt
(
opts
.
scrollBeyondLastColumn
,
defaults
.
scrollBeyondLastColumn
,
0
,
Constants
.
MAX_SAFE_SMALL_INTEGER
),
smoothScrolling
:
_boolean
(
opts
.
smoothScrolling
,
defaults
.
smoothScrolling
),
stopRenderingLineAfter
:
_clampedInt
(
opts
.
stopRenderingLineAfter
,
defaults
.
stopRenderingLineAfter
,
-
1
,
Constants
.
MAX_SAFE_SMALL_INTEGER
),
renderWhitespace
:
renderWhitespace
,
...
...
@@ -1830,6 +1838,7 @@ export class InternalEditorOptionsFactory {
cursorWidth
:
opts
.
viewInfo
.
cursorWidth
,
hideCursorInOverviewRuler
:
opts
.
viewInfo
.
hideCursorInOverviewRuler
,
scrollBeyondLastLine
:
opts
.
viewInfo
.
scrollBeyondLastLine
,
scrollBeyondLastColumn
:
opts
.
viewInfo
.
scrollBeyondLastColumn
,
smoothScrolling
:
opts
.
viewInfo
.
smoothScrolling
,
stopRenderingLineAfter
:
opts
.
viewInfo
.
stopRenderingLineAfter
,
renderWhitespace
:
(
accessibilityIsOn
?
'
none
'
:
opts
.
viewInfo
.
renderWhitespace
),
// DISABLED WHEN SCREEN READER IS ATTACHED
...
...
@@ -2280,6 +2289,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
cursorWidth
:
0
,
hideCursorInOverviewRuler
:
false
,
scrollBeyondLastLine
:
true
,
scrollBeyondLastColumn
:
5
,
smoothScrolling
:
false
,
stopRenderingLineAfter
:
10000
,
renderWhitespace
:
'
none
'
,
...
...
src/vs/editor/common/viewLayout/viewLayout.ts
浏览文件 @
f5fdb8e0
...
...
@@ -18,8 +18,6 @@ const SMOOTH_SCROLLING_TIME = 125;
export
class
ViewLayout
extends
Disposable
implements
IViewLayout
{
static
LINES_HORIZONTAL_EXTRA_PX
=
30
;
private
readonly
_configuration
:
editorCommon
.
IConfiguration
;
private
readonly
_linesLayout
:
LinesLayout
;
...
...
@@ -143,7 +141,8 @@ export class ViewLayout extends Disposable implements IViewLayout {
private
_computeScrollWidth
(
maxLineWidth
:
number
,
viewportWidth
:
number
):
number
{
let
isViewportWrapping
=
this
.
_configuration
.
editor
.
wrappingInfo
.
isViewportWrapping
;
if
(
!
isViewportWrapping
)
{
return
Math
.
max
(
maxLineWidth
+
ViewLayout
.
LINES_HORIZONTAL_EXTRA_PX
,
viewportWidth
);
const
extraHorizontalSpace
=
this
.
_configuration
.
editor
.
viewInfo
.
scrollBeyondLastColumn
*
this
.
_configuration
.
editor
.
fontInfo
.
typicalHalfwidthCharacterWidth
;
return
Math
.
max
(
maxLineWidth
+
extraHorizontalSpace
,
viewportWidth
);
}
return
Math
.
max
(
maxLineWidth
,
viewportWidth
);
}
...
...
src/vs/monaco.d.ts
浏览文件 @
f5fdb8e0
...
...
@@ -2623,6 +2623,11 @@ declare namespace monaco.editor {
* Defaults to true.
*/
scrollBeyondLastLine
?:
boolean
;
/**
* Enable that scrolling can go beyond the last column by a number of columns.
* Defaults to 5.
*/
scrollBeyondLastColumn
?:
number
;
/**
* Enable that the editor animates scrolling to a position.
* Defaults to false.
...
...
@@ -3088,6 +3093,7 @@ declare namespace monaco.editor {
readonly
cursorWidth
:
number
;
readonly
hideCursorInOverviewRuler
:
boolean
;
readonly
scrollBeyondLastLine
:
boolean
;
readonly
scrollBeyondLastColumn
:
number
;
readonly
smoothScrolling
:
boolean
;
readonly
stopRenderingLineAfter
:
number
;
readonly
renderWhitespace
:
'
none
'
|
'
boundary
'
|
'
all
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录