Fix linux zeta modifiers display (#24764)
Improves rendering of Zeta keybind shortcuts on Linux Before:  After: (with muting modifier changes merged)  Release Notes: - N/A --------- Co-authored-by: Michael <michael@zed.dev> Co-authored-by: Agus <agus@zed.dev>
This commit is contained in:
parent
522b8d662c
commit
df8adc8b11
6 changed files with 89 additions and 49 deletions
|
@ -787,6 +787,28 @@ impl<'a> PartialOrd for NumericPrefixWithSuffix<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Capitalizes the first character of a string.
|
||||
///
|
||||
/// This function takes a string slice as input and returns a new `String` with the first character
|
||||
/// capitalized.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use util::capitalize;
|
||||
///
|
||||
/// assert_eq!(capitalize("hello"), "Hello");
|
||||
/// assert_eq!(capitalize("WORLD"), "WORLD");
|
||||
/// assert_eq!(capitalize(""), "");
|
||||
/// ```
|
||||
pub fn capitalize(str: &str) -> String {
|
||||
let mut chars = str.chars();
|
||||
match chars.next() {
|
||||
None => String::new(),
|
||||
Some(first_char) => first_char.to_uppercase().collect::<String>() + chars.as_str(),
|
||||
}
|
||||
}
|
||||
|
||||
fn emoji_regex() -> &'static Regex {
|
||||
static EMOJI_REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new("(\\p{Emoji}|\u{200D})").unwrap());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue