1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 13:21:38 +03:00

charselect: add emoji variations and new short codes section

Move the shortcode aliases out from the various emoji category
pages and into a new shortcode page.

Add variations, such as skin tones, to the different emoji
category pages.
This commit is contained in:
Wez Furlong 2023-08-22 22:53:14 -07:00
parent c7cc3e4d81
commit 7c88c179e1
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
3 changed files with 33 additions and 12 deletions

View File

@ -365,6 +365,7 @@ pub enum CharSelectGroup {
Flags,
NerdFonts,
UnicodeNames,
ShortCodes,
}
// next is default, previous is the reverse
@ -398,7 +399,8 @@ char_select_group_impl_next_prev! (
Symbols => Flags,
Flags => NerdFonts,
NerdFonts => UnicodeNames,
UnicodeNames => RecentlyUsed,
UnicodeNames => ShortCodes,
ShortCodes => RecentlyUsed,
);
impl Default for CharSelectGroup {

View File

@ -23,6 +23,10 @@ As features stabilize some brief notes about them will accumulate here.
#### Changed
* The default for [front_end](config/lua/config/front_end.md) is now `WebGpu`.
* Added split out github short codes from the various charselect sections into
their own new Short Codes section.
* CharSelect now shows emoji variations such as skin tones
* Improved fuzzy matching performance in CharSelect
#### New
* [wezterm imgcat](cli/imgcat.md) now has `--position`, `--no-move-cursor` and

View File

@ -168,26 +168,40 @@ fn build_aliases() -> Vec<Alias> {
Group::Symbols => CharSelectGroup::Symbols,
Group::Flags => CharSelectGroup::Flags,
};
push(
&mut aliases,
Alias {
name: Cow::Borrowed(emoji.name()),
character: Character::Emoji(emoji),
group,
},
);
if let Some(short) = emoji.shortcode() {
if short != emoji.name() {
match emoji.skin_tones() {
Some(iter) => {
for entry in iter {
push(
&mut aliases,
Alias {
name: Cow::Borrowed(entry.name()),
character: Character::Emoji(entry),
group,
},
);
}
}
None => {
push(
&mut aliases,
Alias {
name: Cow::Borrowed(short),
name: Cow::Borrowed(emoji.name()),
character: Character::Emoji(emoji),
group,
},
);
}
}
for short in emoji.shortcodes() {
push(
&mut aliases,
Alias {
name: Cow::Borrowed(short),
character: Character::Emoji(emoji),
group: CharSelectGroup::ShortCodes,
},
);
}
}
for (name, value) in crate::unicode_names::NAMES {
@ -400,6 +414,7 @@ impl CharSelector {
CharSelectGroup::Flags => "Flags",
CharSelectGroup::NerdFonts => "NerdFonts",
CharSelectGroup::UnicodeNames => "Unicode",
CharSelectGroup::ShortCodes => "Short Codes",
};
let mut elements = vec![Element::new(