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
|
||||
|
||||
### Added
|
||||
|
@ -55,10 +55,11 @@ function generateOptionsBasedOnText(text: string, eol: EOL): Array<QuickPickItem
|
||||
if (text === recommendItem.conversionText) {
|
||||
continue; // 如果转换后与转换前相同,那么跳过这一项
|
||||
}
|
||||
const conversionTextForDisplay = recommendItem.conversionText.trim();
|
||||
let quickPickItem: QuickPickItemEx = {
|
||||
label: recommendItem.conversionText.length >= QuickPickLabelMaxLength
|
||||
? (recommendItem.conversionText.substring(0, QuickPickLabelMaxLength - 3) + '...')
|
||||
: recommendItem.conversionText,
|
||||
label: conversionTextForDisplay.length >= QuickPickLabelMaxLength
|
||||
? (conversionTextForDisplay.substring(0, QuickPickLabelMaxLength - 3) + '...')
|
||||
: conversionTextForDisplay,
|
||||
description: `转换为 ${recommendItem.transforTo.join(' / ')}`,
|
||||
detail: `关键词 ${recommendItem.keyword.join(' ')}`,
|
||||
value: recommendItem.conversionText,
|
||||
|
Loading…
Reference in New Issue
Block a user