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


TypeScript config.findFocusedEditor函数代码示例

本文整理汇总了TypeScript中vs/editor/common/config/config.findFocusedEditor函数的典型用法代码示例。如果您正苦于以下问题:TypeScript findFocusedEditor函数的具体用法?TypeScript findFocusedEditor怎么用?TypeScript findFocusedEditor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了findFocusedEditor函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: execCommandToHandler

function execCommandToHandler(actionId: string, browserCommand: string, accessor: ServicesAccessor, args: any): void {
	let focusedEditor = findFocusedEditor(actionId, accessor, false);
	// Only if editor text focus (i.e. not if editor has widget focus).
	if (focusedEditor && focusedEditor.isFocused()) {
		focusedEditor.trigger('keyboard', actionId, args);
		return;
	}

	document.execCommand(browserCommand);
}
开发者ID:1Hgm,项目名称:vscode,代码行数:10,代码来源:clipboard.ts

示例2: runCommand

	public runCommand(accessor:ServicesAccessor, args: any): void {
		let focusedEditor = findFocusedEditor(this.id, accessor, false);
		// Only if editor text focus (i.e. not if editor has widget focus).
		if (focusedEditor && focusedEditor.isFocused()) {
			focusedEditor.trigger('keyboard', this.id, args);
			return;
		}

		document.execCommand(this.browserCommand);
	}
开发者ID:bobmagicii,项目名称:vscode,代码行数:10,代码来源:clipboard.ts

示例3: execCommandToHandler

function execCommandToHandler(actionId: string, browserCommand: string, accessor: ServicesAccessor, args: any): void {
	// If editor text focus
	if (args.context[editorCommon.KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS]) {
		var focusedEditor = findFocusedEditor(actionId, accessor, args, false);
		if (focusedEditor) {
			focusedEditor.trigger('keyboard', actionId, args);
			return;
		}
	}

	document.execCommand(browserCommand);
}
开发者ID:1833183060,项目名称:vscode,代码行数:12,代码来源:clipboard.ts


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