Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
73e190e3
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,发现更多精彩内容 >>
提交
73e190e3
编写于
1月 13, 2016
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #1448: reveal editor cursor position only if contextmenu is triggered via keyboard
上级
66bb68f5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
7 deletion
+23
-7
src/vs/editor/browser/editorBrowser.ts
src/vs/editor/browser/editorBrowser.ts
+7
-1
src/vs/editor/browser/view/viewImpl.ts
src/vs/editor/browser/view/viewImpl.ts
+4
-1
src/vs/editor/browser/widget/codeEditorWidget.ts
src/vs/editor/browser/widget/codeEditorWidget.ts
+8
-1
src/vs/editor/contrib/contextmenu/browser/contextmenu.ts
src/vs/editor/contrib/contextmenu/browser/contextmenu.ts
+3
-3
src/vs/editor/contrib/hover/browser/hoverWidgets.ts
src/vs/editor/contrib/hover/browser/hoverWidgets.ts
+1
-1
未找到文件。
src/vs/editor/browser/editorBrowser.ts
浏览文件 @
73e190e3
...
...
@@ -88,7 +88,7 @@ export interface IView extends Lifecycle.IDisposable {
getWhitespaces
():
EditorCommon
.
IEditorWhitespace
[];
renderOnce
(
callback
:()
=>
any
):
any
;
render
():
void
;
render
(
now
:
boolean
):
void
;
focus
():
void
;
isFocused
():
boolean
;
...
...
@@ -584,6 +584,7 @@ export interface ICodeEditor extends EditorCommon.ICommonCodeEditor {
* Get the view zones.
*/
getWhitespaces
():
EditorCommon
.
IEditorWhitespace
[];
/**
* Get the horizontal position (left offset) for the column w.r.t to the beginning of the line.
* This method works only if the line `lineNumber` is currently rendered (in the editor's viewport).
...
...
@@ -591,6 +592,11 @@ export interface ICodeEditor extends EditorCommon.ICommonCodeEditor {
*/
getOffsetForColumn
(
lineNumber
:
number
,
column
:
number
):
number
;
/**
* Force an editor render now.
*/
render
():
void
;
/**
* Get the vertical position (top offset) for the line w.r.t. to the first line.
*/
...
...
src/vs/editor/browser/view/viewImpl.ts
浏览文件 @
73e190e3
...
...
@@ -763,12 +763,15 @@ export class View extends ViewEventHandler implements EditorBrowser.IView, Lifec
});
}
public
render
():
void
{
public
render
(
now
:
boolean
):
void
{
if
(
this
.
_isDisposed
)
{
throw
new
Error
(
'
ViewImpl.render: View is disposed
'
);
}
// Force a render with a layout event
this
.
layoutProvider
.
emitLayoutChangedEvent
();
if
(
now
)
{
this
.
_flushAccumulatedAndRenderNow
();
}
}
public
renderOnce
(
callback
:
()
=>
any
):
any
{
...
...
src/vs/editor/browser/widget/codeEditorWidget.ts
浏览文件 @
73e190e3
...
...
@@ -360,6 +360,13 @@ export class CodeEditorWidget extends CommonCodeEditor implements EditorBrowser.
return
this
.
_view
.
getCodeEditorHelper
().
getOffsetForColumn
(
lineNumber
,
column
);
}
public
render
():
void
{
if
(
!
this
.
hasView
)
{
return
;
}
this
.
_view
.
render
(
true
);
}
_attachModel
(
model
:
EditorCommon
.
IModel
):
void
{
this
.
_view
=
null
;
...
...
@@ -383,7 +390,7 @@ export class CodeEditorWidget extends CommonCodeEditor implements EditorBrowser.
}
}
this
.
_view
.
render
();
this
.
_view
.
render
(
false
);
this
.
hasView
=
true
;
});
}
...
...
src/vs/editor/contrib/contextmenu/browser/contextmenu.ts
浏览文件 @
73e190e3
...
...
@@ -113,9 +113,6 @@ class ContextMenuController implements EditorCommon.IEditorContribution {
return
;
}
// Ensure selection is visible
this
.
_editor
.
revealPosition
(
position
);
// Find actions available for menu
var
menuActions
=
this
.
_getMenuActions
();
...
...
@@ -182,7 +179,10 @@ class ContextMenuController implements EditorCommon.IEditorContribution {
var
menuPosition
=
forcedPosition
;
if
(
!
menuPosition
)
{
// Ensure selection is visible
this
.
_editor
.
revealPosition
(
this
.
_editor
.
getPosition
());
this
.
_editor
.
render
();
var
cursorCoords
=
this
.
_editor
.
getScrolledVisiblePosition
(
this
.
_editor
.
getPosition
());
// Translate to absolute editor position
...
...
src/vs/editor/contrib/hover/browser/hoverWidgets.ts
浏览文件 @
73e190e3
...
...
@@ -66,7 +66,7 @@ export class ContentHoverWidget implements EditorBrowser.IContentWidget {
this
.
_editor
.
layoutContentWidget
(
this
);
// Simply force a synchronous render on the editor
// such that the widget does not really render with left = '0px'
this
.
_editor
.
getOffsetForColumn
(
this
.
_showAtPosition
.
lineNumber
,
this
.
_showAtPosition
.
column
);
this
.
_editor
.
render
(
);
}
public
hide
():
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录