Skip to content

Commit

Permalink
fix: render unicode gitmojis as image by default
Browse files Browse the repository at this point in the history
  • Loading branch information
seatonjiang committed May 8, 2021
1 parent 008273b commit 63ac33a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.0.6] - 2021-05-08

Render unicode gitmojis as image by default

## [1.0.5] - 2021-03-13

- Sync with official
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gitmoji-vscode",
"displayName": "Gitmoji",
"description": "An emoji tool for your git commit messages",
"version": "1.0.5",
"version": "1.0.6",
"author": {
"name": "Seaton Jiang",
"email": "[email protected]"
Expand Down
30 changes: 13 additions & 17 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export function activate(context: vscode.ExtensionContext) {
vscode.workspace.getConfiguration().get("gitmoji.additionalEmojis") ||
[];

const showEmojiCode: boolean | undefined = vscode.workspace.getConfiguration().get("gitmoji.showEmojiCode")
const showEmojiCode:
| boolean
| undefined = vscode.workspace
.getConfiguration()
.get("gitmoji.showEmojiCode");

let emojis = [];
let onlyUseAdditionalEmojis:
Expand All @@ -34,25 +38,17 @@ export function activate(context: vscode.ExtensionContext) {
}

const items = emojis.map((emojiObj) => {
const {
description,
description_zh_cn,
code,
emoji
} = emojiObj
const displayDescription = language === "zh-cn"
? description_zh_cn || description
: description
const displayCode = showEmojiCode
? code
: ''
const label = `${emoji} ${displayDescription} ${displayCode}`
const { description, description_zh_cn, code, emoji } = emojiObj;
const displayDescription =
language === "zh-cn" ? description_zh_cn || description : description;
const displayCode = showEmojiCode ? code : "";
const label = `${emoji} ${displayDescription} ${displayCode}`;
return {
label,
code,
emoji
}
})
emoji,
};
});

vscode.window.showQuickPick(items).then(function (selected) {
if (selected) {
Expand Down
8 changes: 4 additions & 4 deletions src/gitmoji/gitmoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ let Gitmoji: Array<Emoji> = [
description_zh_cn: "新增或更新测试",
},
{
emoji: "🔒",
emoji: "🔒",
code: ":lock:",
description: "Fix security issues",
description_zh_cn: "修复安全问题",
Expand Down Expand Up @@ -198,7 +198,7 @@ let Gitmoji: Array<Emoji> = [
description_zh_cn: "新增或更新已编译的文件或包",
},
{
emoji: "👽",
emoji: "👽",
code: ":alien:",
description: "Update code due to external API changes",
description_zh_cn: "由于外部API变化而更新代码",
Expand Down Expand Up @@ -282,7 +282,7 @@ let Gitmoji: Array<Emoji> = [
description_zh_cn: "提高用户体验 / 可用性",
},
{
emoji: "🏗",
emoji: "🏗",
code: ":building_construction:",
description: "Make architectural changes",
description_zh_cn: "进行架构更改",
Expand Down Expand Up @@ -318,7 +318,7 @@ let Gitmoji: Array<Emoji> = [
description_zh_cn: "新增或更新快照",
},
{
emoji: "⚗",
emoji: "⚗",
code: ":alembic:",
description: "Perform experiments",
description_zh_cn: "试验新功能",
Expand Down

0 comments on commit 63ac33a

Please sign in to comment.