Skip to content

Commit

Permalink
Replace unmaintained lexical-sort with ICU
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuamegnauth54 authored and jackpot51 committed Jul 15, 2024
1 parent 24cacb0 commit 3caea33
Show file tree
Hide file tree
Showing 6 changed files with 290 additions and 8 deletions.
261 changes: 260 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ env_logger = "0.10"
hex_color = { version = "3", features = ["serde"] }
indexmap = "2"
lazy_static = "1"
lexical-sort = "0.3.1"
log = "0.4"
open = "5.0.2"
palette = { version = "0.7", features = ["serde"] }
Expand All @@ -30,6 +29,8 @@ i18n-embed = { version = "0.14", features = [
"desktop-requester",
] }
i18n-embed-fl = "0.7"
icu_collator = "1.5"
icu_provider = { version = "1.5", features = ["sync"] }
rust-embed = "8"

[dependencies.cosmic-files]
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use std::sync::OnceLock;

use crate::fl;
use crate::{fl, localize::LANGUAGE_SORTER};

pub const CONFIG_VERSION: u64 = 1;
pub const COSMIC_THEME_DARK: &str = "COSMIC Dark";
Expand Down Expand Up @@ -311,7 +311,7 @@ impl Config {

color_scheme_names.push((name, *color_scheme_id));
}
color_scheme_names.sort_by(|a, b| lexical_sort::natural_lexical_cmp(&a.0, &b.0));
color_scheme_names.sort_by(|a, b| LANGUAGE_SORTER.compare(&a.0, &b.0));
color_scheme_names
}

Expand Down Expand Up @@ -347,7 +347,7 @@ impl Config {

profile_names.push((name, *profile_id));
}
profile_names.sort_by(|a, b| lexical_sort::natural_lexical_cmp(&a.0, &b.0));
profile_names.sort_by(|a, b| LANGUAGE_SORTER.compare(&a.0, &b.0));
profile_names
}

Expand Down
2 changes: 1 addition & 1 deletion src/key_bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn key_binds() -> HashMap<KeyBind, Action> {
bind!([Ctrl], Key::Character("-".into()), ZoomOut);
bind!([Ctrl], Key::Character("=".into()), ZoomIn);
bind!([Ctrl], Key::Character("+".into()), ZoomIn);

// Ctrl+Arrows and Ctrl+HJKL move between splits
bind!([Ctrl, Shift], Key::Named(Named::ArrowLeft), PaneFocusLeft);
bind!([Ctrl, Shift], Key::Character("H".into()), PaneFocusLeft);
Expand Down
Loading

0 comments on commit 3caea33

Please sign in to comment.