本文整理汇总了TypeScript中vscode.TextEditor.revealRange方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TextEditor.revealRange方法的具体用法?TypeScript TextEditor.revealRange怎么用?TypeScript TextEditor.revealRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode.TextEditor
的用法示例。
在下文中一共展示了TextEditor.revealRange方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: cursorPrevWordStartJa
export function cursorPrevWordStartJa(
editor: TextEditor,
wordSeparators: string
) {
const document = editor.document;
editor.selections = editor.selections
.map(s => positionOfPrevWordStart(document, s.active, wordSeparators))
.map(p => new Selection(p, p));
if (editor.selections.length === 1) {
editor.revealRange(editor.selection);
}
}
示例2: cursorNextWordEndSelectJa
export function cursorNextWordEndSelectJa(
editor: TextEditor,
wordSeparators: string
) {
editor.selections = editor.selections
.map(s => new Selection(
s.anchor,
positionOfNextWordEnd(editor.document, s.active, wordSeparators))
);
if (editor.selections.length === 1) {
editor.revealRange(editor.selection);
}
}
示例3: cursorParagraphMove
function cursorParagraphMove(
editor: TextEditor,
next: (l: number) => number,
limit: (l: number) => boolean,
end: Position,
select: boolean
) {
const doc = editor.document;
editor.selections = editor.selections.map(s => {
var l = s.active.line;
for (var flag = false; limit(l); l = next(l)) {
if (!doc.lineAt(l).isEmptyOrWhitespace) flag = true;
if (flag && doc.lineAt(l).isEmptyOrWhitespace) {
const p = new vscode.Position(l, 0);
return new vscode.Selection(select ? s.anchor : p, p);
}
}
return new Selection(select ? s.anchor : end, end);
});
editor.revealRange(editor.selections[editor.selections.length - 1].with());
}
示例4: revealPosition
function revealPosition(editor: TextEditor, line: number, char: number): void {
editor.revealRange(new Range(line, char, line, char), TextEditorRevealType.Default);
}
示例5: setPosReveal
protected setPosReveal(ed:TextEditor, line: number, char: number): void {
ed.selection = new Selection(new Position(line, char), new Position(line, char));
ed.revealRange(ed.selection, TextEditorRevealType.Default);
}
示例6:
}).then(() => {
if (editor.selections.length === 1) {
editor.revealRange(editor.selection);
}
});
示例7:
.then( (val) => {
editor.revealRange( editor.selection, TextEditorRevealType.InCenterIfOutsideViewport );
},
示例8: selection
set selection(range: FlatRange) {
this.editor.revealRange(this.getRange(range), TextEditorRevealType.InCenterIfOutsideViewport);
this.editor.selection = this.getSelection(range);
}