当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript TextEditor.revealRange方法代码示例

本文整理汇总了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);
    }
}
开发者ID:sgryjp,项目名称:japanese-word-handler,代码行数:12,代码来源:extension.ts

示例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);
    }
}
开发者ID:sgryjp,项目名称:japanese-word-handler,代码行数:13,代码来源:extension.ts

示例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());
}
开发者ID:yasuyuky,项目名称:transient-emacs,代码行数:21,代码来源:extension.ts

示例4: revealPosition

function revealPosition(editor: TextEditor, line: number, char: number): void {
	editor.revealRange(new Range(line, char, line, char), TextEditorRevealType.Default);
}
开发者ID:DanEEStar,项目名称:vscode-vim,代码行数:3,代码来源:controller.ts

示例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);
	}
开发者ID:DanEEStar,项目名称:vscode-vim,代码行数:4,代码来源:operators.ts

示例6:

 }).then(() => {
     if (editor.selections.length === 1) {
         editor.revealRange(editor.selection);
     }
 });
开发者ID:sgryjp,项目名称:japanese-word-handler,代码行数:5,代码来源:extension.ts

示例7:

 .then( (val) => { 
     editor.revealRange( editor.selection, TextEditorRevealType.InCenterIfOutsideViewport );
 }, 
开发者ID:docura-io,项目名称:vscode-cm,代码行数:3,代码来源:commands.ts

示例8: selection

 set selection(range: FlatRange) {
     this.editor.revealRange(this.getRange(range), TextEditorRevealType.InCenterIfOutsideViewport);
     this.editor.selection = this.getSelection(range);
 }
开发者ID:ryu1kn,项目名称:vscode-text-marker,代码行数:4,代码来源:text-editor.ts


注:本文中的vscode.TextEditor.revealRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。