本文整理汇总了TypeScript中extraterm-extension-api.TextViewer.getTab方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TextViewer.getTab方法的具体用法?TypeScript TextViewer.getTab怎么用?TypeScript TextViewer.getTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类extraterm-extension-api.TextViewer
的用法示例。
在下文中一共展示了TextViewer.getTab方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: tabCommand
async function tabCommand(textViewer: TextViewer): Promise<any> {
const selectedTabSize = await textViewer.getTab().showNumberInput({
title: "Tab Size",
value: textViewer.getTabSize(),
minimum: 0,
maximum: 32
});
if (selectedTabSize !== undefined) {
textViewer.setTabSize(selectedTabSize);
}
}
示例2: textViewerCommandExecutor
async function textViewerCommandExecutor(textViewer: TextViewer, commandId: string, commandArguments?: object): Promise<any> {
const selectedTabSize = await textViewer.getTab().showNumberInput({
title: "Tab Size",
value: textViewer.getTabSize(),
minimum: 0,
maximum: 32
});
if (selectedTabSize !== undefined) {
textViewer.setTabSize(selectedTabSize);
}
}
示例3: syntaxHighlightingCommandExecutor
async function syntaxHighlightingCommandExecutor(textViewer: TextViewer): Promise<any> {
const modesByNameObject = extensionContext.aceModule.ModeList.modesByName
const mimeList: {name: string, nameLower: string, mime: string}[] = [];
for (let key in modesByNameObject) {
const mode = modesByNameObject[key];
mimeList.push({name: mode.friendlyName, nameLower: mode.friendlyName.toLowerCase(), mime: mode.mimeTypes[0]});
}
sortArrayBy(mimeList, item => item.nameLower);
const items = mimeList.map(item => item.name + ' ' + item.mime);
const mimeTypeNames = mimeList.map(item => item.name);
const selectedItemIndex = mimeTypeNames.indexOf(getMimeTypeName(textViewer));
const newSelectedItemIndex = await textViewer.getTab().showListPicker({
title: "Syntax Highlighting",
items: items,
selectedItemIndex
});
if (newSelectedItemIndex !== undefined) {
textViewer.setMimeType(mimeList[newSelectedItemIndex].mime);
}
}