提交 48e98191 编写于 作者: C Christof Marti

Fix item lookup (fixes #61663)

上级 07d5e289
......@@ -1236,13 +1236,14 @@ export class ChangeEncodingAction extends Action {
return { id: key, label: SUPPORTED_ENCODINGS[key].labelLong, description: key };
});
const items = picks.slice() as IQuickPickItem[];
// If we have a guessed encoding, show it first unless it matches the configured encoding
if (guessedEncoding && configuredEncoding !== guessedEncoding && SUPPORTED_ENCODINGS[guessedEncoding]) {
picks.unshift({ type: 'separator' });
picks.unshift({ id: guessedEncoding, label: SUPPORTED_ENCODINGS[guessedEncoding].labelLong, description: nls.localize('guessedEncoding', "Guessed from content") });
}
const items = picks.filter(p => p.type !== 'separator') as IQuickPickItem[];
return this.quickInputService.pick(picks, {
placeHolder: isReopenWithEncoding ? nls.localize('pickEncodingForReopen', "Select File Encoding to Reopen File") : nls.localize('pickEncodingForSave', "Select File Encoding to Save with"),
activeItem: items[typeof directMatchIndex === 'number' ? directMatchIndex : typeof aliasMatchIndex === 'number' ? aliasMatchIndex : -1]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册