Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8a0da20f
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,发现更多精彩内容 >>
提交
8a0da20f
编写于
5月 06, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cursor computes pageSize, not configuration
上级
e477f92e
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
91 addition
and
94 deletion
+91
-94
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+0
-6
src/vs/editor/common/controller/cursor.ts
src/vs/editor/common/controller/cursor.ts
+5
-5
src/vs/editor/common/controller/oneCursor.ts
src/vs/editor/common/controller/oneCursor.ts
+11
-6
src/vs/editor/common/editorCommon.ts
src/vs/editor/common/editorCommon.ts
+0
-2
src/vs/editor/test/common/controller/cursor.test.ts
src/vs/editor/test/common/controller/cursor.test.ts
+75
-75
未找到文件。
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
8a0da20f
...
...
@@ -81,7 +81,6 @@ export class InternalEditorOptions implements editorCommon.IInternalEditorOption
wrappingInfo
:
editorCommon
.
EditorWrappingInfo
;
contribInfo
:
editorCommon
.
EditorContribOptions
;
lineHeight
:
number
;
pageSize
:
number
;
constructor
(
input
:
editorCommon
.
IInternalEditorOptions
)
{
this
.
wordSeparators
=
String
(
input
.
wordSeparators
);
...
...
@@ -100,7 +99,6 @@ export class InternalEditorOptions implements editorCommon.IInternalEditorOption
this
.
wrappingInfo
=
input
.
wrappingInfo
.
clone
();
this
.
contribInfo
=
input
.
contribInfo
.
clone
();
this
.
lineHeight
=
Number
(
input
.
lineHeight
)
|
0
;
this
.
pageSize
=
Number
(
input
.
pageSize
)
|
0
;
}
}
...
...
@@ -164,8 +162,6 @@ class InternalEditorOptionsHelper {
verticalScrollbarHasArrows
:
scrollbar
.
verticalHasArrows
});
let
pageSize
=
Math
.
floor
(
layoutInfo
.
height
/
fontInfo
.
lineHeight
)
-
2
;
if
(
isDominatedByLongLines
&&
wrappingColumn
>
0
)
{
// Force viewport width wrapping if model is dominated by long lines
wrappingColumn
=
0
;
...
...
@@ -264,7 +260,6 @@ class InternalEditorOptionsHelper {
contribInfo
:
contribInfo
,
lineHeight
:
fontInfo
.
lineHeight
,
// todo -> duplicated in styling
pageSize
:
pageSize
,
};
}
...
...
@@ -325,7 +320,6 @@ class InternalEditorOptionsHelper {
wrappingInfo
:
(
!
prevOpts
.
wrappingInfo
.
equals
(
newOpts
.
wrappingInfo
)),
contribInfo
:
(
!
prevOpts
.
contribInfo
.
equals
(
newOpts
.
contribInfo
)),
lineHeight
:
(
prevOpts
.
lineHeight
!==
newOpts
.
lineHeight
),
pageSize
:
(
prevOpts
.
pageSize
!==
newOpts
.
pageSize
),
};
}
}
...
...
src/vs/editor/common/controller/cursor.ts
浏览文件 @
8a0da20f
...
...
@@ -66,7 +66,7 @@ interface ICommandsData {
export
class
Cursor
extends
EventEmitter
{
private
editorId
:
number
;
/*private*/
configuration
:
editorCommon
.
IConfiguration
;
private
configuration
:
editorCommon
.
IConfiguration
;
private
model
:
editorCommon
.
IModel
;
private
modelUnbinds
:
IDisposable
[];
...
...
@@ -1288,11 +1288,11 @@ export class Cursor extends EventEmitter {
}
private
_moveDown
(
inSelectionMode
:
boolean
,
isPaged
:
boolean
,
ctx
:
IMultipleCursorOperationContext
):
boolean
{
return
this
.
_invokeForAll
(
ctx
,
(
cursorIndex
:
number
,
oneCursor
:
OneCursor
,
oneCtx
:
IOneCursorOperationContext
)
=>
OneCursorOp
.
moveDown
(
oneCursor
,
inSelectionMode
,
isPaged
,
oneCtx
));
return
this
.
_invokeForAll
(
ctx
,
(
cursorIndex
:
number
,
oneCursor
:
OneCursor
,
oneCtx
:
IOneCursorOperationContext
)
=>
OneCursorOp
.
moveDown
(
oneCursor
,
inSelectionMode
,
isPaged
,
ctx
.
eventData
&&
ctx
.
eventData
.
pageSize
||
0
,
oneCtx
));
}
private
_moveUp
(
inSelectionMode
:
boolean
,
isPaged
:
boolean
,
ctx
:
IMultipleCursorOperationContext
):
boolean
{
return
this
.
_invokeForAll
(
ctx
,
(
cursorIndex
:
number
,
oneCursor
:
OneCursor
,
oneCtx
:
IOneCursorOperationContext
)
=>
OneCursorOp
.
moveUp
(
oneCursor
,
inSelectionMode
,
isPaged
,
oneCtx
));
return
this
.
_invokeForAll
(
ctx
,
(
cursorIndex
:
number
,
oneCursor
:
OneCursor
,
oneCtx
:
IOneCursorOperationContext
)
=>
OneCursorOp
.
moveUp
(
oneCursor
,
inSelectionMode
,
isPaged
,
ctx
.
eventData
&&
ctx
.
eventData
.
pageSize
||
0
,
oneCtx
));
}
private
_moveToBeginningOfLine
(
inSelectionMode
:
boolean
,
ctx
:
IMultipleCursorOperationContext
):
boolean
{
...
...
@@ -1451,12 +1451,12 @@ export class Cursor extends EventEmitter {
}
private
_scrollUp
(
isPaged
:
boolean
,
ctx
:
IMultipleCursorOperationContext
):
boolean
{
ctx
.
requestScrollDeltaLines
=
isPaged
?
-
this
.
c
onfiguration
.
editor
.
pageSize
:
-
1
;
ctx
.
requestScrollDeltaLines
=
isPaged
?
-
this
.
c
ursors
.
getAll
()[
0
].
getPageSize
()
:
-
1
;
return
true
;
}
private
_scrollDown
(
isPaged
:
boolean
,
ctx
:
IMultipleCursorOperationContext
):
boolean
{
ctx
.
requestScrollDeltaLines
=
isPaged
?
this
.
c
onfiguration
.
editor
.
pageSize
:
1
;
ctx
.
requestScrollDeltaLines
=
isPaged
?
this
.
c
ursors
.
getAll
()[
0
].
getPageSize
()
:
1
;
return
true
;
}
...
...
src/vs/editor/common/controller/oneCursor.ts
浏览文件 @
8a0da20f
...
...
@@ -450,6 +450,11 @@ export class OneCursor {
// -------------------- START reading API
public
getPageSize
():
number
{
let
c
=
this
.
configuration
.
editor
;
return
Math
.
floor
(
c
.
layoutInfo
.
height
/
c
.
fontInfo
.
lineHeight
)
-
2
;
}
public
getSelectionStart
():
editorCommon
.
IEditorRange
{
return
this
.
selectionStart
;
}
...
...
@@ -675,7 +680,7 @@ export class OneCursorOp {
}
public
static
columnSelectUp
(
isPaged
:
boolean
,
cursor
:
OneCursor
,
toViewLineNumber
:
number
,
toViewVisualColumn
:
number
):
IColumnSelectResult
{
var
linesCount
=
isPaged
?
cursor
.
configuration
.
editor
.
pageSize
:
1
;
var
linesCount
=
isPaged
?
cursor
.
getPageSize
()
:
1
;
toViewLineNumber
-=
linesCount
;
if
(
toViewLineNumber
<
1
)
{
...
...
@@ -686,7 +691,7 @@ export class OneCursorOp {
}
public
static
columnSelectDown
(
isPaged
:
boolean
,
cursor
:
OneCursor
,
toViewLineNumber
:
number
,
toViewVisualColumn
:
number
):
IColumnSelectResult
{
var
linesCount
=
isPaged
?
cursor
.
configuration
.
editor
.
pageSize
:
1
;
var
linesCount
=
isPaged
?
cursor
.
getPageSize
()
:
1
;
toViewLineNumber
+=
linesCount
;
if
(
toViewLineNumber
>
cursor
.
getViewLineCount
())
{
...
...
@@ -812,8 +817,8 @@ export class OneCursorOp {
return
true
;
}
public
static
moveDown
(
cursor
:
OneCursor
,
inSelectionMode
:
boolean
,
isPaged
:
boolean
,
ctx
:
IOneCursorOperationContext
):
boolean
{
var
linesCount
=
isPaged
?
cursor
.
configuration
.
editor
.
pageSize
:
1
;
public
static
moveDown
(
cursor
:
OneCursor
,
inSelectionMode
:
boolean
,
isPaged
:
boolean
,
usePageSize
:
number
,
ctx
:
IOneCursorOperationContext
):
boolean
{
var
linesCount
=
isPaged
?
(
usePageSize
||
cursor
.
getPageSize
())
:
1
;
var
viewLineNumber
:
number
,
viewColumn
:
number
;
...
...
@@ -853,8 +858,8 @@ export class OneCursorOp {
return
true
;
}
public
static
moveUp
(
cursor
:
OneCursor
,
inSelectionMode
:
boolean
,
isPaged
:
boolean
,
ctx
:
IOneCursorOperationContext
):
boolean
{
var
linesCount
=
isPaged
?
cursor
.
configuration
.
editor
.
pageSize
:
1
;
public
static
moveUp
(
cursor
:
OneCursor
,
inSelectionMode
:
boolean
,
isPaged
:
boolean
,
usePageSize
:
number
,
ctx
:
IOneCursorOperationContext
):
boolean
{
var
linesCount
=
isPaged
?
(
usePageSize
||
cursor
.
getPageSize
())
:
1
;
var
viewLineNumber
:
number
,
viewColumn
:
number
;
...
...
src/vs/editor/common/editorCommon.ts
浏览文件 @
8a0da20f
...
...
@@ -903,7 +903,6 @@ export interface IInternalEditorOptions {
wordSeparators
:
string
;
autoClosingBrackets
:
boolean
;
useTabStops
:
boolean
;
pageSize
:
number
;
tabFocusMode
:
boolean
;
// ---- model options
...
...
@@ -955,7 +954,6 @@ export interface IConfigurationChangedEvent {
wrappingInfo
:
boolean
;
contribInfo
:
boolean
;
lineHeight
:
boolean
;
pageSize
:
boolean
;
}
/**
...
...
src/vs/editor/test/common/controller/cursor.test.ts
浏览文件 @
8a0da20f
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录