Optimize: 优化 QickPick 转换值展示 (trim 前后空格及换行)
This commit is contained in:
parent
741bf562ab
commit
ef42f97944
@ -24,6 +24,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
-- Optimize QickPick conversion value display (优化 QickPick 转换值展示)
|
||||||
|
|
||||||
## 1.0.6
|
## 1.0.6
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -55,10 +55,11 @@ function generateOptionsBasedOnText(text: string, eol: EOL): Array<QuickPickItem
|
|||||||
if (text === recommendItem.conversionText) {
|
if (text === recommendItem.conversionText) {
|
||||||
continue; // 如果转换后与转换前相同,那么跳过这一项
|
continue; // 如果转换后与转换前相同,那么跳过这一项
|
||||||
}
|
}
|
||||||
|
const conversionTextForDisplay = recommendItem.conversionText.trim();
|
||||||
let quickPickItem: QuickPickItemEx = {
|
let quickPickItem: QuickPickItemEx = {
|
||||||
label: recommendItem.conversionText.length >= QuickPickLabelMaxLength
|
label: conversionTextForDisplay.length >= QuickPickLabelMaxLength
|
||||||
? (recommendItem.conversionText.substring(0, QuickPickLabelMaxLength - 3) + '...')
|
? (conversionTextForDisplay.substring(0, QuickPickLabelMaxLength - 3) + '...')
|
||||||
: recommendItem.conversionText,
|
: conversionTextForDisplay,
|
||||||
description: `转换为 ${recommendItem.transforTo.join(' / ')}`,
|
description: `转换为 ${recommendItem.transforTo.join(' / ')}`,
|
||||||
detail: `关键词 ${recommendItem.keyword.join(' ')}`,
|
detail: `关键词 ${recommendItem.keyword.join(' ')}`,
|
||||||
value: recommendItem.conversionText,
|
value: recommendItem.conversionText,
|
||||||
|
Loading…
Reference in New Issue
Block a user