Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7a15a509
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,发现更多精彩内容 >>
提交
7a15a509
编写于
5月 18, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove browser.enableEmptySelectionClipboard
上级
371000f2
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
50 addition
and
47 deletion
+50
-47
src/vs/base/browser/browser.ts
src/vs/base/browser/browser.ts
+0
-2
src/vs/editor/browser/config/configuration.ts
src/vs/editor/browser/config/configuration.ts
+1
-0
src/vs/editor/browser/controller/textAreaHandler.ts
src/vs/editor/browser/controller/textAreaHandler.ts
+9
-4
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+0
-5
src/vs/editor/common/commonCodeEditor.ts
src/vs/editor/common/commonCodeEditor.ts
+1
-4
src/vs/editor/common/config/commonEditorConfig.ts
src/vs/editor/common/config/commonEditorConfig.ts
+2
-0
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+2
-1
src/vs/editor/common/controller/cursor.ts
src/vs/editor/common/controller/cursor.ts
+2
-5
src/vs/editor/common/controller/cursorCommon.ts
src/vs/editor/common/controller/cursorCommon.ts
+3
-0
src/vs/editor/common/controller/cursorDeleteOperations.ts
src/vs/editor/common/controller/cursorDeleteOperations.ts
+2
-2
src/vs/editor/common/view/viewEvents.ts
src/vs/editor/common/view/viewEvents.ts
+2
-0
src/vs/editor/common/viewModel/viewModel.ts
src/vs/editor/common/viewModel/viewModel.ts
+2
-2
src/vs/editor/common/viewModel/viewModelImpl.ts
src/vs/editor/common/viewModel/viewModelImpl.ts
+4
-4
src/vs/editor/contrib/clipboard/browser/clipboard.ts
src/vs/editor/contrib/clipboard/browser/clipboard.ts
+6
-6
src/vs/editor/test/common/commands/commandTestUtils.ts
src/vs/editor/test/common/commands/commandTestUtils.ts
+1
-1
src/vs/editor/test/common/commands/sideEditing.test.ts
src/vs/editor/test/common/commands/sideEditing.test.ts
+1
-1
src/vs/editor/test/common/config/commonEditorConfig.test.ts
src/vs/editor/test/common/config/commonEditorConfig.test.ts
+1
-0
src/vs/editor/test/common/controller/cursor.test.ts
src/vs/editor/test/common/controller/cursor.test.ts
+9
-9
src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
...s/editor/test/common/controller/cursorMoveCommand.test.ts
+1
-1
src/vs/editor/test/common/mocks/testConfiguration.ts
src/vs/editor/test/common/mocks/testConfiguration.ts
+1
-0
未找到文件。
src/vs/base/browser/browser.ts
浏览文件 @
7a15a509
...
...
@@ -153,8 +153,6 @@ export function canUseTranslate3d(): boolean {
return
true
;
}
export
const
enableEmptySelectionClipboard
=
isWebKit
;
export
function
supportsExecCommand
(
command
:
string
):
boolean
{
return
(
(
isIE
||
Platform
.
isNative
)
...
...
src/vs/editor/browser/config/configuration.ts
浏览文件 @
7a15a509
...
...
@@ -351,6 +351,7 @@ export class Configuration extends CommonEditorConfiguration {
outerWidth
:
this
.
_elementSizeObserver
.
getWidth
(),
outerHeight
:
this
.
_elementSizeObserver
.
getHeight
(),
canUseTranslate3d
:
browser
.
canUseTranslate3d
(),
emptySelectionClipboard
:
browser
.
isWebKit
,
pixelRatio
:
browser
.
getPixelRatio
(),
zoomLevel
:
browser
.
getZoomLevel
()
};
...
...
src/vs/editor/browser/controller/textAreaHandler.ts
浏览文件 @
7a15a509
...
...
@@ -63,6 +63,7 @@ export class TextAreaHandler extends ViewPart {
private
_experimentalScreenReader
:
boolean
;
private
_fontInfo
:
BareFontInfo
;
private
_lineHeight
:
number
;
private
_emptySelectionClipboard
:
boolean
;
/**
* Defined only when the text area is visible (composition case).
...
...
@@ -93,6 +94,7 @@ export class TextAreaHandler extends ViewPart {
this
.
_experimentalScreenReader
=
conf
.
viewInfo
.
experimentalScreenReader
;
this
.
_fontInfo
=
conf
.
fontInfo
;
this
.
_lineHeight
=
conf
.
lineHeight
;
this
.
_emptySelectionClipboard
=
conf
.
emptySelectionClipboard
;
this
.
_visibleTextArea
=
null
;
this
.
_selections
=
[
new
Selection
(
1
,
1
,
1
,
1
)];
...
...
@@ -130,9 +132,9 @@ export class TextAreaHandler extends ViewPart {
const
textAreaInputHost
:
ITextAreaInputHost
=
{
getPlainTextToCopy
:
():
string
=>
{
const
whatToCopy
=
this
.
_context
.
model
.
getPlainTextToCopy
(
this
.
_selections
,
browser
.
enableE
mptySelectionClipboard
);
const
whatToCopy
=
this
.
_context
.
model
.
getPlainTextToCopy
(
this
.
_selections
,
this
.
_e
mptySelectionClipboard
);
if
(
browser
.
enableE
mptySelectionClipboard
)
{
if
(
this
.
_e
mptySelectionClipboard
)
{
if
(
browser
.
isFirefox
)
{
// When writing "LINE\r\n" to the clipboard and then pasting,
// Firefox pastes "LINE\n", so let's work around this quirk
...
...
@@ -149,7 +151,7 @@ export class TextAreaHandler extends ViewPart {
},
getHTMLToCopy
:
():
string
=>
{
return
this
.
_context
.
model
.
getHTMLToCopy
(
this
.
_selections
,
browser
.
enableE
mptySelectionClipboard
);
return
this
.
_context
.
model
.
getHTMLToCopy
(
this
.
_selections
,
this
.
_e
mptySelectionClipboard
);
},
getScreenReaderContent
:
(
currentState
:
TextAreaState
):
TextAreaState
=>
{
...
...
@@ -181,7 +183,7 @@ export class TextAreaHandler extends ViewPart {
this
.
_register
(
this
.
_textAreaInput
.
onPaste
((
e
:
IPasteData
)
=>
{
let
pasteOnNewLine
=
false
;
if
(
browser
.
enableE
mptySelectionClipboard
)
{
if
(
this
.
_e
mptySelectionClipboard
)
{
pasteOnNewLine
=
(
e
.
text
===
this
.
_lastCopiedValue
&&
this
.
_lastCopiedValueIsFromEmptySelection
);
}
this
.
_viewController
.
paste
(
'
keyboard
'
,
e
.
text
,
pasteOnNewLine
);
...
...
@@ -285,6 +287,9 @@ export class TextAreaHandler extends ViewPart {
if
(
e
.
pixelRatio
)
{
this
.
_pixelRatio
=
conf
.
pixelRatio
;
}
if
(
e
.
emptySelectionClipboard
)
{
this
.
_emptySelectionClipboard
=
conf
.
emptySelectionClipboard
;
}
return
true
;
}
...
...
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
7a15a509
...
...
@@ -9,7 +9,6 @@ import 'vs/editor/common/view/editorColorRegistry'; // initialze editor theming
import
'
vs/css!./media/tokens
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
...
...
@@ -415,10 +414,6 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito
}
}
protected
_enableEmptySelectionClipboard
():
boolean
{
return
browser
.
enableEmptySelectionClipboard
;
}
protected
_createView
():
void
{
this
.
_view
=
new
View
(
this
.
_commandService
,
...
...
src/vs/editor/common/commonCodeEditor.ts
浏览文件 @
7a15a509
...
...
@@ -902,8 +902,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
this
.
cursor
=
new
Cursor
(
this
.
_configuration
,
this
.
model
,
viewModelHelper
,
this
.
_enableEmptySelectionClipboard
()
viewModelHelper
);
this
.
viewCursor
=
new
ViewModelCursors
(
...
...
@@ -938,8 +937,6 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
}
}
protected
abstract
_enableEmptySelectionClipboard
():
boolean
;
protected
abstract
_createView
():
void
;
protected
_postDetachModelCleanup
(
detachedModel
:
editorCommon
.
IModel
):
void
{
...
...
src/vs/editor/common/config/commonEditorConfig.ts
浏览文件 @
7a15a509
...
...
@@ -56,6 +56,7 @@ export interface IEnvConfiguration {
outerWidth
:
number
;
outerHeight
:
number
;
canUseTranslate3d
:
boolean
;
emptySelectionClipboard
:
boolean
;
pixelRatio
:
number
;
zoomLevel
:
number
;
}
...
...
@@ -119,6 +120,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed
isDominatedByLongLines
:
this
.
_isDominatedByLongLines
,
lineNumbersDigitCount
:
this
.
_lineNumbersDigitCount
,
canUseTranslate3d
:
partialEnv
.
canUseTranslate3d
,
emptySelectionClipboard
:
partialEnv
.
emptySelectionClipboard
,
pixelRatio
:
partialEnv
.
pixelRatio
,
tabFocusMode
:
TabFocus
.
getTabFocusMode
()
};
...
...
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
7a15a509
...
...
@@ -1219,6 +1219,7 @@ export interface IEnvironmentalOptions {
readonly
isDominatedByLongLines
:
boolean
;
readonly
lineNumbersDigitCount
:
number
;
readonly
canUseTranslate3d
:
boolean
;
readonly
emptySelectionClipboard
:
boolean
;
readonly
pixelRatio
:
number
;
readonly
tabFocusMode
:
boolean
;
}
...
...
@@ -1665,7 +1666,7 @@ export class InternalEditorOptionsFactory {
useTabStops
:
opts
.
useTabStops
,
tabFocusMode
:
opts
.
readOnly
?
true
:
env
.
tabFocusMode
,
dragAndDrop
:
opts
.
dragAndDrop
,
emptySelectionClipboard
:
opts
.
emptySelectionClipboard
,
emptySelectionClipboard
:
opts
.
emptySelectionClipboard
&&
env
.
emptySelectionClipboard
,
layoutInfo
:
layoutInfo
,
fontInfo
:
env
.
fontInfo
,
viewInfo
:
opts
.
viewInfo
,
...
...
src/vs/editor/common/controller/cursor.ts
浏览文件 @
7a15a509
...
...
@@ -77,19 +77,16 @@ export class Cursor extends Disposable implements ICursors {
private
_isDoingComposition
:
boolean
;
private
_columnSelectData
:
IColumnSelectData
;
private
enableEmptySelectionClipboard
:
boolean
;
private
_handlers
:
{
[
key
:
string
]:
(
ctx
:
IMultipleCursorOperationContext
)
=>
void
;
};
constructor
(
configuration
:
editorCommon
.
IConfiguration
,
model
:
editorCommon
.
IModel
,
viewModelHelper
:
IViewModelHelper
,
enableEmptySelectionClipboard
:
boolean
)
{
constructor
(
configuration
:
editorCommon
.
IConfiguration
,
model
:
editorCommon
.
IModel
,
viewModelHelper
:
IViewModelHelper
)
{
super
();
this
.
_eventEmitter
=
this
.
_register
(
new
EventEmitter
());
this
.
configuration
=
configuration
;
this
.
model
=
model
;
this
.
viewModelHelper
=
viewModelHelper
;
this
.
enableEmptySelectionClipboard
=
enableEmptySelectionClipboard
;
const
createCursorContext
=
()
=>
{
const
config
=
new
CursorConfiguration
(
...
...
@@ -1062,7 +1059,7 @@ export class Cursor extends Disposable implements ICursors {
}
private
_cut
(
ctx
:
IMultipleCursorOperationContext
):
void
{
this
.
_applyEdits
(
ctx
,
DeleteOperations
.
cut
(
this
.
context
.
config
,
this
.
context
.
model
,
this
.
_getAllCursorsModelState
()
,
this
.
enableEmptySelectionClipboard
));
this
.
_applyEdits
(
ctx
,
DeleteOperations
.
cut
(
this
.
context
.
config
,
this
.
context
.
model
,
this
.
_getAllCursorsModelState
()));
}
// -------------------- END editing operations
...
...
src/vs/editor/common/controller/cursorCommon.ts
浏览文件 @
7a15a509
...
...
@@ -61,6 +61,7 @@ export class CursorConfiguration {
public
readonly
lineHeight
:
number
;
public
readonly
useTabStops
:
boolean
;
public
readonly
wordSeparators
:
string
;
public
readonly
emptySelectionClipboard
:
boolean
;
public
readonly
autoClosingBrackets
:
boolean
;
public
readonly
autoClosingPairsOpen
:
CharacterMap
;
public
readonly
autoClosingPairsClose
:
CharacterMap
;
...
...
@@ -71,6 +72,7 @@ export class CursorConfiguration {
return
(
e
.
layoutInfo
||
e
.
wordSeparators
||
e
.
emptySelectionClipboard
||
e
.
autoClosingBrackets
||
e
.
useTabStops
||
e
.
lineHeight
...
...
@@ -94,6 +96,7 @@ export class CursorConfiguration {
this
.
lineHeight
=
c
.
lineHeight
;
this
.
useTabStops
=
c
.
useTabStops
;
this
.
wordSeparators
=
c
.
wordSeparators
;
this
.
emptySelectionClipboard
=
c
.
emptySelectionClipboard
;
this
.
autoClosingBrackets
=
c
.
autoClosingBrackets
;
this
.
autoClosingPairsOpen
=
{};
...
...
src/vs/editor/common/controller/cursorDeleteOperations.ts
浏览文件 @
7a15a509
...
...
@@ -163,14 +163,14 @@ export class DeleteOperations {
});
}
public
static
cut
(
config
:
CursorConfiguration
,
model
:
ICursorSimpleModel
,
cursors
:
SingleCursorState
[]
,
enableEmptySelectionClipboard
:
boolean
):
EditOperationResult
{
public
static
cut
(
config
:
CursorConfiguration
,
model
:
ICursorSimpleModel
,
cursors
:
SingleCursorState
[]):
EditOperationResult
{
let
commands
:
CommandResult
[]
=
[];
for
(
let
i
=
0
,
len
=
cursors
.
length
;
i
<
len
;
i
++
)
{
const
cursor
=
cursors
[
i
];
let
selection
=
cursor
.
selection
;
if
(
selection
.
isEmpty
())
{
if
(
enableE
mptySelectionClipboard
)
{
if
(
config
.
e
mptySelectionClipboard
)
{
// This is a full line cut
let
position
=
cursor
.
position
;
...
...
src/vs/editor/common/view/viewEvents.ts
浏览文件 @
7a15a509
...
...
@@ -39,6 +39,7 @@ export class ViewConfigurationChangedEvent {
public
readonly
editorClassName
:
boolean
;
public
readonly
lineHeight
:
boolean
;
public
readonly
readOnly
:
boolean
;
public
readonly
emptySelectionClipboard
:
boolean
;
public
readonly
layoutInfo
:
boolean
;
public
readonly
fontInfo
:
boolean
;
public
readonly
viewInfo
:
boolean
;
...
...
@@ -50,6 +51,7 @@ export class ViewConfigurationChangedEvent {
this
.
editorClassName
=
source
.
editorClassName
;
this
.
lineHeight
=
source
.
lineHeight
;
this
.
readOnly
=
source
.
readOnly
;
this
.
emptySelectionClipboard
=
source
.
emptySelectionClipboard
;
this
.
layoutInfo
=
source
.
layoutInfo
;
this
.
fontInfo
=
source
.
fontInfo
;
this
.
viewInfo
=
source
.
viewInfo
;
...
...
src/vs/editor/common/viewModel/viewModel.ts
浏览文件 @
7a15a509
...
...
@@ -137,8 +137,8 @@ export interface IViewModel {
getModelLineMaxColumn
(
modelLineNumber
:
number
):
number
;
validateModelPosition
(
modelPosition
:
IPosition
):
Position
;
getPlainTextToCopy
(
ranges
:
Range
[],
e
nableE
mptySelectionClipboard
:
boolean
):
string
;
getHTMLToCopy
(
ranges
:
Range
[],
e
nableE
mptySelectionClipboard
:
boolean
):
string
;
getPlainTextToCopy
(
ranges
:
Range
[],
emptySelectionClipboard
:
boolean
):
string
;
getHTMLToCopy
(
ranges
:
Range
[],
emptySelectionClipboard
:
boolean
):
string
;
}
export
class
MinimapLinesRenderingData
{
...
...
src/vs/editor/common/viewModel/viewModelImpl.ts
浏览文件 @
7a15a509
...
...
@@ -520,13 +520,13 @@ export class ViewModel extends ViewEventEmitter implements IViewModel {
return
this
.
model
.
validatePosition
(
position
);
}
public
getPlainTextToCopy
(
ranges
:
Range
[],
e
nableE
mptySelectionClipboard
:
boolean
):
string
{
public
getPlainTextToCopy
(
ranges
:
Range
[],
emptySelectionClipboard
:
boolean
):
string
{
let
newLineCharacter
=
this
.
model
.
getEOL
();
if
(
ranges
.
length
===
1
)
{
let
range
:
Range
=
ranges
[
0
];
if
(
range
.
isEmpty
())
{
if
(
e
nableE
mptySelectionClipboard
)
{
if
(
emptySelectionClipboard
)
{
let
modelLineNumber
=
this
.
coordinatesConverter
.
convertViewPositionToModelPosition
(
new
Position
(
range
.
startLineNumber
,
1
)).
lineNumber
;
return
this
.
model
.
getLineContent
(
modelLineNumber
)
+
newLineCharacter
;
}
else
{
...
...
@@ -546,7 +546,7 @@ export class ViewModel extends ViewEventEmitter implements IViewModel {
}
}
public
getHTMLToCopy
(
viewRanges
:
Range
[],
e
nableE
mptySelectionClipboard
:
boolean
):
string
{
public
getHTMLToCopy
(
viewRanges
:
Range
[],
emptySelectionClipboard
:
boolean
):
string
{
if
(
this
.
model
.
getLanguageIdentifier
().
id
===
LanguageId
.
PlainText
)
{
return
null
;
}
...
...
@@ -558,7 +558,7 @@ export class ViewModel extends ViewEventEmitter implements IViewModel {
let
range
=
this
.
coordinatesConverter
.
convertViewRangeToModelRange
(
viewRanges
[
0
]);
if
(
range
.
isEmpty
())
{
if
(
!
e
nableE
mptySelectionClipboard
)
{
if
(
!
emptySelectionClipboard
)
{
// nothing to copy
return
null
;
}
...
...
src/vs/editor/contrib/clipboard/browser/clipboard.ts
浏览文件 @
7a15a509
...
...
@@ -81,9 +81,9 @@ class ExecCommandCutAction extends ExecCommandAction {
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
):
void
{
var
enableEmptySelectionClipboard
=
editor
.
getConfiguration
().
emptySelectionClipboard
&&
browser
.
enableE
mptySelectionClipboard
;
const
emptySelectionClipboard
=
editor
.
getConfiguration
().
e
mptySelectionClipboard
;
if
(
!
e
nableE
mptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
if
(
!
emptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
return
;
}
...
...
@@ -113,9 +113,9 @@ class ExecCommandCopyAction extends ExecCommandAction {
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
):
void
{
var
enableEmptySelectionClipboard
=
editor
.
getConfiguration
().
emptySelectionClipboard
&&
browser
.
enableE
mptySelectionClipboard
;
const
emptySelectionClipboard
=
editor
.
getConfiguration
().
e
mptySelectionClipboard
;
if
(
!
e
nableE
mptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
if
(
!
emptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
return
;
}
...
...
@@ -162,9 +162,9 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
editorCommon
.
ICommonCodeEditor
):
void
{
var
enableEmptySelectionClipboard
=
editor
.
getConfiguration
().
emptySelectionClipboard
&&
browser
.
enableE
mptySelectionClipboard
;
const
emptySelectionClipboard
=
editor
.
getConfiguration
().
e
mptySelectionClipboard
;
if
(
!
e
nableE
mptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
if
(
!
emptySelectionClipboard
&&
editor
.
getSelection
().
isEmpty
())
{
return
;
}
...
...
src/vs/editor/test/common/commands/commandTestUtils.ts
浏览文件 @
7a15a509
...
...
@@ -25,7 +25,7 @@ export function testCommand(
let
model
=
Model
.
createFromString
(
lines
.
join
(
'
\n
'
),
undefined
,
languageIdentifier
);
let
config
=
new
TestConfiguration
(
null
);
let
cursor
=
new
Cursor
(
config
,
model
,
viewModelHelper
(
model
)
,
false
);
let
cursor
=
new
Cursor
(
config
,
model
,
viewModelHelper
(
model
));
cursor
.
setSelections
(
'
tests
'
,
[
selection
]);
...
...
src/vs/editor/test/common/commands/sideEditing.test.ts
浏览文件 @
7a15a509
...
...
@@ -21,7 +21,7 @@ const NO_TAB_SIZE = 0;
function
testCommand
(
lines
:
string
[],
selections
:
Selection
[],
edits
:
IIdentifiedSingleEditOperation
[],
expectedLines
:
string
[],
expectedSelections
:
Selection
[]):
void
{
let
model
=
Model
.
createFromString
(
lines
.
join
(
'
\n
'
));
let
config
=
new
TestConfiguration
(
null
);
let
cursor
=
new
Cursor
(
config
,
model
,
viewModelHelper
(
model
)
,
false
);
let
cursor
=
new
Cursor
(
config
,
model
,
viewModelHelper
(
model
));
cursor
.
setSelections
(
'
tests
'
,
selections
);
...
...
src/vs/editor/test/common/config/commonEditorConfig.test.ts
浏览文件 @
7a15a509
...
...
@@ -59,6 +59,7 @@ suite('Common Editor Config', () => {
outerWidth
:
1000
,
outerHeight
:
100
,
canUseTranslate3d
:
true
,
emptySelectionClipboard
:
true
,
pixelRatio
:
1
,
zoomLevel
:
0
};
...
...
src/vs/editor/test/common/controller/cursor.test.ts
浏览文件 @
7a15a509
...
...
@@ -146,7 +146,7 @@ suite('Editor Controller - Cursor', () => {
thisModel
=
Model
.
createFromString
(
text
);
thisConfiguration
=
new
TestConfiguration
(
null
);
thisCursor
=
new
Cursor
(
thisConfiguration
,
thisModel
,
viewModelHelper
(
thisModel
)
,
false
);
thisCursor
=
new
Cursor
(
thisConfiguration
,
thisModel
,
viewModelHelper
(
thisModel
));
});
teardown
(()
=>
{
...
...
@@ -705,7 +705,7 @@ suite('Editor Controller - Cursor', () => {
'
\t\t
}
'
,
'
\t
}
'
].
join
(
'
\n
'
));
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
1
,
7
,
false
);
assertCursor
(
cursor
,
new
Position
(
1
,
7
));
...
...
@@ -739,7 +739,7 @@ suite('Editor Controller - Cursor', () => {
'
var concat = require("gulp-concat");
'
,
'
var newer = require("gulp-newer");
'
,
].
join
(
'
\n
'
));
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
1
,
4
,
false
);
assertCursor
(
cursor
,
new
Position
(
1
,
4
));
...
...
@@ -774,7 +774,7 @@ suite('Editor Controller - Cursor', () => {
'
<property id="SomeThing" key="SomeKey" value="000"/>
'
,
'
<property id="SomeThing" key="SomeKey" value="00X"/>
'
,
].
join
(
'
\n
'
));
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
10
,
10
,
false
);
assertCursor
(
cursor
,
new
Position
(
10
,
10
));
...
...
@@ -832,7 +832,7 @@ suite('Editor Controller - Cursor', () => {
'
<property id="SomeThing" key="SomeKey" value="000"/>
'
,
'
<property id="SomeThing" key="SomeKey" value="00X"/>
'
,
].
join
(
'
\n
'
));
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
10
,
10
,
false
);
assertCursor
(
cursor
,
new
Position
(
10
,
10
));
...
...
@@ -877,7 +877,7 @@ suite('Editor Controller - Cursor', () => {
'
var concat = require("gulp-concat");
'
,
'
var newer = require("gulp-newer");
'
,
].
join
(
'
\n
'
));
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
1
,
4
,
false
);
assertCursor
(
cursor
,
new
Position
(
1
,
4
));
...
...
@@ -1421,7 +1421,7 @@ suite('Editor Controller - Regression tests', () => {
'
qwerty
'
];
let
model
=
Model
.
createFromString
(
text
.
join
(
'
\n
'
));
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
let
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
2
,
1
,
false
);
assertCursor
(
cursor
,
new
Selection
(
2
,
1
,
2
,
1
));
...
...
@@ -1439,7 +1439,7 @@ suite('Editor Controller - Regression tests', () => {
''
];
model
=
Model
.
createFromString
(
text
.
join
(
'
\n
'
));
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
)
,
true
);
cursor
=
new
Cursor
(
new
TestConfiguration
(
null
),
model
,
viewModelHelper
(
model
));
moveTo
(
cursor
,
2
,
1
,
false
);
assertCursor
(
cursor
,
new
Selection
(
2
,
1
,
2
,
1
));
...
...
@@ -2719,7 +2719,7 @@ interface ICursorOpts {
function
usingCursor
(
opts
:
ICursorOpts
,
callback
:
(
model
:
Model
,
cursor
:
Cursor
)
=>
void
):
void
{
let
model
=
Model
.
createFromString
(
opts
.
text
.
join
(
'
\n
'
),
opts
.
modelOpts
,
opts
.
languageIdentifier
);
let
config
=
new
TestConfiguration
(
opts
.
editorOpts
);
let
cursor
=
new
Cursor
(
config
,
model
,
viewModelHelper
(
model
)
,
false
);
let
cursor
=
new
Cursor
(
config
,
model
,
viewModelHelper
(
model
));
callback
(
model
,
cursor
);
...
...
src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
浏览文件 @
7a15a509
...
...
@@ -454,7 +454,7 @@ suite('Cursor move command test', () => {
});
function
aCursor
(
viewModelHelper
?:
IViewModelHelper
):
Cursor
{
return
new
Cursor
(
thisConfiguration
,
thisModel
,
viewModelHelper
||
aViewModelHelper
(
thisModel
)
,
false
);
return
new
Cursor
(
thisConfiguration
,
thisModel
,
viewModelHelper
||
aViewModelHelper
(
thisModel
));
}
});
...
...
src/vs/editor/test/common/mocks/testConfiguration.ts
浏览文件 @
7a15a509
...
...
@@ -21,6 +21,7 @@ export class TestConfiguration extends CommonEditorConfiguration {
outerWidth
:
100
,
outerHeight
:
100
,
canUseTranslate3d
:
true
,
emptySelectionClipboard
:
true
,
pixelRatio
:
1
,
zoomLevel
:
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录