From d89cdc324e1cc2b2185cf4b6eab0198e83501118 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Tue, 26 Nov 2024 21:53:42 +0100 Subject: [PATCH 1/6] Dont tab back to initial word --- src/buffer/input_view/completion.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer/input_view/completion.rs b/src/buffer/input_view/completion.rs index d28d7365..f6796d27 100644 --- a/src/buffer/input_view/completion.rs +++ b/src/buffer/input_view/completion.rs @@ -694,7 +694,7 @@ impl Text { if let Some(index) = self.selected { self.filtered.get(index).cloned() } else { - (!self.prompt.is_empty()).then(|| self.prompt.clone()) + None } } } From 5b56b93a2efc30b8e5697097b80fcd5ea52766e4 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Thu, 9 Jan 2025 19:54:42 +0100 Subject: [PATCH 2/6] adding config --- data/src/buffer.rs | 16 ++++++++++++++++ src/buffer/input_view/completion.rs | 2 ++ 2 files changed, 18 insertions(+) diff --git a/data/src/buffer.rs b/data/src/buffer.rs index 6c130aaf..301f7ee1 100644 --- a/data/src/buffer.rs +++ b/data/src/buffer.rs @@ -111,6 +111,22 @@ pub struct TextInput { pub visibility: TextInputVisibility, #[serde(default)] pub auto_format: AutoFormat, + #[serde(default)] + pub nickname_autocomplete: Autocomplete, +} + +#[derive(Debug, Clone, Copy, Default, Deserialize)] +#[serde(rename_all = "kebab-case")] +pub enum SortDirection { + #[default] + Asc, + Desc, +} + +#[derive(Debug, Clone, Copy, Default, Deserialize)] +pub struct Autocomplete { + pub sort_direction: SortDirection, + pub case_sensitive: bool, } #[derive(Debug, Clone, Copy, Default, Deserialize)] diff --git a/src/buffer/input_view/completion.rs b/src/buffer/input_view/completion.rs index f6796d27..b98929d6 100644 --- a/src/buffer/input_view/completion.rs +++ b/src/buffer/input_view/completion.rs @@ -5,6 +5,7 @@ use data::user::User; use data::{isupport, target}; use iced::widget::{column, container, row, text, tooltip}; use iced::Length; +use itertools::Itertools; use once_cell::sync::Lazy; use crate::theme; @@ -638,6 +639,7 @@ impl Text { self.prompt = rest.to_string(); self.filtered = users .iter() + .sorted_by(|a, b| a.nickname().cmp(&b.nickname())) .filter_map(|user| { let lower_nick = user.nickname().as_ref().to_lowercase(); lower_nick From f65c9ce67c0a024f643660059d9a883b19612345 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Fri, 10 Jan 2025 10:17:44 +0100 Subject: [PATCH 3/6] added configuration for autocomplete --- book/src/SUMMARY.md | 3 +- .../{text_input.md => text_input/README.md} | 1 - .../buffer/text_input/autocomplete.md | 27 +++++++++++ data/src/buffer.rs | 25 ++++++++-- src/buffer/input_view.rs | 10 ++-- src/buffer/input_view/completion.rs | 47 ++++++++++++------- 6 files changed, 86 insertions(+), 27 deletions(-) rename book/src/configuration/buffer/{text_input.md => text_input/README.md} (99%) create mode 100644 book/src/configuration/buffer/text_input/autocomplete.md diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index 9fff6abe..40ed63ca 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -37,7 +37,8 @@ - [Part](configuration/buffer/server_messages/part.md) - [Quit](configuration/buffer/server_messages/quit.md) - [Topic](configuration/buffer/server_messages/topic.md) - - [Text Input](configuration/buffer/text_input.md) + - [Text Input](configuration/buffer/text_input/README.md) + - [Autocomplete](configuration/buffer/text_input/autocomplete.md) - [Timestamp](configuration/buffer/timestamp.md) - [Chat History](configuration/buffer/chat_history.md) - [File Transfer](configuration/file_transfer/README.md) diff --git a/book/src/configuration/buffer/text_input.md b/book/src/configuration/buffer/text_input/README.md similarity index 99% rename from book/src/configuration/buffer/text_input.md rename to book/src/configuration/buffer/text_input/README.md index 053a873b..65649ab2 100644 --- a/book/src/configuration/buffer/text_input.md +++ b/book/src/configuration/buffer/text_input/README.md @@ -26,5 +26,4 @@ Control if the text input should auto format the input. By default text is only - **values**: `"disabled"`, `"markdown"`, `"all"` - **default**: `"disabled"` - > 💡 Read more about [text formatting](../../guides/text-formatting.html). diff --git a/book/src/configuration/buffer/text_input/autocomplete.md b/book/src/configuration/buffer/text_input/autocomplete.md new file mode 100644 index 00000000..9b934e32 --- /dev/null +++ b/book/src/configuration/buffer/text_input/autocomplete.md @@ -0,0 +1,27 @@ +# `[buffer.text_input_autocomplete]` + +Customize autocomplete. + +**Example** + +```toml +[buffer.text_input.autocomplete] +sort_direction = "asc" +completion_suffixes = [": ", ""] +``` + +## `sort_direction` + +Sort direction when autocompleting. + +- **type**: string +- **values**: `"asc"`, `"desc"` +- **default**: `"asc"` + +## `completion_suffixes` + +Sets what suffix is added after autocompleting. The first option is for when a nickname is autocompleted at the beginning of a sentence. The second is for when it's autocompleted in the middle of a sentence. + +- **type**: array of 2 strings +- **values**: array of 2 strings +- **default**: `"[": ", " "]"` diff --git a/data/src/buffer.rs b/data/src/buffer.rs index 301f7ee1..70291b95 100644 --- a/data/src/buffer.rs +++ b/data/src/buffer.rs @@ -105,14 +105,14 @@ impl From for Settings { } } -#[derive(Debug, Clone, Copy, Default, Deserialize)] +#[derive(Debug, Clone, Default, Deserialize)] pub struct TextInput { #[serde(default)] pub visibility: TextInputVisibility, #[serde(default)] pub auto_format: AutoFormat, #[serde(default)] - pub nickname_autocomplete: Autocomplete, + pub autocomplete: Autocomplete, } #[derive(Debug, Clone, Copy, Default, Deserialize)] @@ -123,12 +123,24 @@ pub enum SortDirection { Desc, } -#[derive(Debug, Clone, Copy, Default, Deserialize)] +#[derive(Debug, Clone, Deserialize)] pub struct Autocomplete { + #[serde(default)] pub sort_direction: SortDirection, - pub case_sensitive: bool, + #[serde(default = "default_completion_suffixes")] + pub completion_suffixes: [String; 2] } +impl Default for Autocomplete { + fn default() -> Self { + Self { + sort_direction: SortDirection::default(), + completion_suffixes: default_completion_suffixes(), + } + } +} + + #[derive(Debug, Clone, Copy, Default, Deserialize)] #[serde(rename_all = "kebab-case")] pub enum TextInputVisibility { @@ -255,3 +267,8 @@ fn default_timestamp() -> String { fn default_bool_true() -> bool { true } + +fn default_completion_suffixes() -> [String; 2] { + [": ".to_string(), " ".to_string()] +} + diff --git a/src/buffer/input_view.rs b/src/buffer/input_view.rs index 7f313e87..9452d79c 100644 --- a/src/buffer/input_view.rs +++ b/src/buffer/input_view.rs @@ -138,7 +138,7 @@ impl State { let channels = clients.get_channels(buffer.server()); let isupport = clients.get_isupport(buffer.server()); - self.completion.process(&input, users, channels, &isupport); + self.completion.process(&input, users, channels, &isupport, config); history.record_draft(Draft { buffer: buffer.clone(), @@ -157,7 +157,7 @@ impl State { if let Some(entry) = self.completion.select() { let chantypes = clients.get_chantypes(buffer.server()); - let new_input = entry.complete_input(input, chantypes); + let new_input = entry.complete_input(input, chantypes, config); self.on_completion(buffer, history, new_input) } else if !input.is_empty() { @@ -225,7 +225,7 @@ impl State { if let Some(entry) = self.completion.tab(reverse) { let chantypes = clients.get_chantypes(buffer.server()); - let new_input = entry.complete_input(input, chantypes); + let new_input = entry.complete_input(input, chantypes, config); self.on_completion(buffer, history, new_input) } else { @@ -258,7 +258,7 @@ impl State { let isupport = clients.get_isupport(buffer.server()); self.completion - .process(&new_input, users, channels, &isupport); + .process(&new_input, users, channels, &isupport, config); return self.on_completion(buffer, history, new_input); } @@ -286,7 +286,7 @@ impl State { let isupport = clients.get_isupport(buffer.server()); self.completion - .process(&new_input, users, channels, &isupport); + .process(&new_input, users, channels, &isupport, config); new_input }; diff --git a/src/buffer/input_view/completion.rs b/src/buffer/input_view/completion.rs index b98929d6..7219863a 100644 --- a/src/buffer/input_view/completion.rs +++ b/src/buffer/input_view/completion.rs @@ -1,8 +1,9 @@ use std::collections::HashMap; use std::fmt; +use data::buffer::SortDirection; use data::user::User; -use data::{isupport, target}; +use data::{isupport, target, Config}; use iced::widget::{column, container, row, text, tooltip}; use iced::Length; use itertools::Itertools; @@ -31,6 +32,7 @@ impl Completion { users: &[User], channels: &[target::Channel], isupport: &HashMap, + config: &Config, ) { let is_command = input.starts_with('/'); @@ -49,10 +51,12 @@ impl Completion { if matches!(self.commands, Commands::Selecting { .. }) { self.text = Text::default(); } else { - self.text.process(input, casemapping, users, channels); + self.text + .process(input, casemapping, users, channels, config); } } else { - self.text.process(input, casemapping, users, channels); + self.text + .process(input, casemapping, users, channels, config); self.commands = Commands::default(); } } @@ -81,15 +85,13 @@ pub enum Entry { } impl Entry { - pub fn complete_input(&self, input: &str, chantypes: &[char]) -> String { + pub fn complete_input(&self, input: &str, chantypes: &[char], config: &Config) -> String { match self { Entry::Command(command) => format!("/{}", command.title.to_lowercase()), Entry::Text(next) => { + let autocomplete = &config.buffer.text_input.autocomplete; let is_channel = next.starts_with(chantypes); - let colon_space = ": "; - - let trimmed_input = input.trim_end_matches(colon_space); - let mut words: Vec<_> = trimmed_input.split_whitespace().collect(); + let mut words: Vec<_> = input.split_whitespace().collect(); // Replace the last word with the next word if let Some(last_word) = words.last_mut() { @@ -101,11 +103,13 @@ impl Entry { let mut new_input = words.join(" "); if words.len() == 1 && !is_channel { - // If completed at the beginning of the input line, ': ' (colon space) is appended. - new_input.push_str(colon_space); + // If completed at the beginning of the input line and not a channel. + let suffix = &autocomplete.completion_suffixes[0]; + new_input.push_str(suffix); } else { - // Otherwise, a space is appended to the completion. - new_input.push(' '); + // Otherwise, use second suffix. + let suffix = &autocomplete.completion_suffixes[1]; + new_input.push_str(suffix); } new_input @@ -619,13 +623,15 @@ impl Text { casemapping: isupport::CaseMap, users: &[User], channels: &[target::Channel], + config: &Config, ) { - if !self.process_channels(input, casemapping, channels) { - self.process_users(input, users); + if !self.process_channels(input, casemapping, channels, config) { + self.process_users(input, users, config); } } - fn process_users(&mut self, input: &str, users: &[User]) { + fn process_users(&mut self, input: &str, users: &[User], config: &Config) { + let autocomplete = &config.buffer.text_input.autocomplete; let (_, rest) = input.rsplit_once(' ').unwrap_or(("", input)); if rest.is_empty() { @@ -639,7 +645,10 @@ impl Text { self.prompt = rest.to_string(); self.filtered = users .iter() - .sorted_by(|a, b| a.nickname().cmp(&b.nickname())) + .sorted_by(|a, b| match autocomplete.sort_direction { + SortDirection::Asc => a.nickname().cmp(&b.nickname()), + SortDirection::Desc => b.nickname().cmp(&a.nickname()), + }) .filter_map(|user| { let lower_nick = user.nickname().as_ref().to_lowercase(); lower_nick @@ -654,7 +663,9 @@ impl Text { input: &str, casemapping: isupport::CaseMap, channels: &[target::Channel], + config: &Config, ) -> bool { + let autocomplete = &config.buffer.text_input.autocomplete; let (_, last) = input.rsplit_once(' ').unwrap_or(("", input)); let Some((_, rest)) = last.split_once('#') else { *self = Self::default(); @@ -667,6 +678,10 @@ impl Text { self.prompt = format!("#{rest}"); self.filtered = channels .iter() + .sorted_by(|a, b: &&target::Channel| match autocomplete.sort_direction { + SortDirection::Asc => a.as_normalized_str().cmp(&b.as_normalized_str()), + SortDirection::Desc => b.as_normalized_str().cmp(&a.as_normalized_str()), + }) .filter(|&channel| channel.as_str().starts_with(input_channel.as_str())) .map(|channel| channel.to_string()) .collect(); From 0fe23905581b97f1e60d58ef69595d5e4b36dca8 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Fri, 10 Jan 2025 10:23:13 +0100 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05d8c628..88f4edd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ Added: - New configuration options - - Ability to disable dimming of away usernames. See [buffer configuartion](https://halloy.squidowl.org/configuration/buffer/away.html). + - Ability to disable dimming of away usernames. See [configuartion](https://halloy.squidowl.org/configuration/buffer/away.html). + - Autocomplete. See [configuration](https://halloy.squidowl.org/configuration/buffer/text_input/autocomplete.html). - Enable support for IRCv3 `chathistory` - Highlight notifications for `/me` actions - Timeout delay for notifications @@ -11,6 +12,7 @@ Added: Fixed: - Long username & password combinations could cause SASL authentication to fail - `nick_password_command` is now working as intended +- Don't add suffix (`: `) to prompt if there is no valid nick to autocomplete Changed: - Changed focus buffer shortcuts to include `Ctrl` (`⌘` on macOS) to avoid interfering with default text input shortcuts for word navigation (`⌥ + ←`, `⌥ + →`) From 6e725b76d528bab04d7dc3ac7b36d7d4ac2bad3d Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Fri, 10 Jan 2025 10:27:07 +0100 Subject: [PATCH 5/6] Update Cargo.lock --- Cargo.lock | 114 ++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8dba9dae..d2c3167b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" dependencies = [ "alsa-sys", - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "libc", ] @@ -90,7 +90,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.6.0", + "bitflags 2.7.0", "cc", "cesu8", "jni", @@ -419,7 +419,7 @@ version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cexpr", "clang-sys", "itertools 0.13.0", @@ -460,9 +460,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "block" @@ -557,7 +557,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "log", "polling", "rustix", @@ -571,7 +571,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "log", "polling", "rustix", @@ -827,7 +827,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "core-graphics-types 0.2.0", "foreign-types 0.5.0", @@ -851,7 +851,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "libc", ] @@ -882,7 +882,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59fd57d82eb4bfe7ffa9b1cec0c05e2fd378155b47f255a67983cb4afe0e80c2" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "fontdb", "log", "rangemap", @@ -1169,7 +1169,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98888c4bbd601524c11a7ed63f814b8825f420514f78e96f752c437ae9cbb5d1" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytemuck", "drm-ffi", "drm-fourcc", @@ -1696,7 +1696,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "gpu-alloc-types", ] @@ -1706,7 +1706,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -1727,7 +1727,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "gpu-descriptor-types", "hashbrown", ] @@ -1738,7 +1738,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -2018,7 +2018,7 @@ name = "iced_core" version = "0.14.0-dev" source = "git+https://github.com/iced-rs/iced?rev=e722c4ee4f80833ba0b1013cadd546ebc3f490ce#e722c4ee4f80833ba0b1013cadd546ebc3f490ce" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "glam", "log", @@ -2049,7 +2049,7 @@ name = "iced_graphics" version = "0.14.0-dev" source = "git+https://github.com/iced-rs/iced?rev=e722c4ee4f80833ba0b1013cadd546ebc3f490ce#e722c4ee4f80833ba0b1013cadd546ebc3f490ce" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytemuck", "cosmic-text", "half", @@ -2108,7 +2108,7 @@ name = "iced_wgpu" version = "0.14.0-dev" source = "git+https://github.com/iced-rs/iced?rev=e722c4ee4f80833ba0b1013cadd546ebc3f490ce#e722c4ee4f80833ba0b1013cadd546ebc3f490ce" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytemuck", "futures", "glam", @@ -2592,7 +2592,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", "redox_syscall 0.5.8", ] @@ -2704,7 +2704,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block", "core-graphics-types 0.1.3", "foreign-types 0.5.0", @@ -2760,7 +2760,7 @@ checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f" dependencies = [ "arrayvec", "bit-set", - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg_aliases 0.1.1", "codespan-reporting", "hexf-parse", @@ -2796,7 +2796,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "jni-sys", "log", "ndk-sys 0.5.0+25.2.9519653", @@ -2810,7 +2810,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "jni-sys", "log", "ndk-sys 0.6.0+11769913", @@ -2849,7 +2849,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "cfg_aliases 0.2.1", "libc", @@ -2978,7 +2978,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "libc", "objc2", @@ -2994,7 +2994,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "objc2", "objc2-core-location", @@ -3018,7 +3018,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "objc2", "objc2-foundation", @@ -3060,7 +3060,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "dispatch", "libc", @@ -3085,7 +3085,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "objc2", "objc2-foundation", @@ -3097,7 +3097,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "objc2", "objc2-foundation", @@ -3120,7 +3120,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "objc2", "objc2-cloud-kit", @@ -3152,7 +3152,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "objc2", "objc2-core-location", @@ -3232,7 +3232,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -3740,7 +3740,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -3924,7 +3924,7 @@ version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", "linux-raw-sys 0.4.15", @@ -3996,7 +3996,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytemuck", "libm", "smallvec", @@ -4068,7 +4068,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -4250,7 +4250,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "calloop 0.12.4", "calloop-wayland-source 0.2.0", "cursor-icon", @@ -4275,7 +4275,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "calloop 0.13.0", "calloop-wayland-source 0.3.0", "cursor-icon", @@ -4377,7 +4377,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -4494,9 +4494,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -4538,7 +4538,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -5022,9 +5022,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" dependencies = [ "getrandom", ] @@ -5188,7 +5188,7 @@ version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "rustix", "wayland-backend", "wayland-scanner", @@ -5200,7 +5200,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cursor-icon", "wayland-backend", ] @@ -5222,7 +5222,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -5234,7 +5234,7 @@ version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -5246,7 +5246,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "wayland-backend", "wayland-client", "wayland-protocols 0.31.2", @@ -5259,7 +5259,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "wayland-backend", "wayland-client", "wayland-protocols 0.31.2", @@ -5272,7 +5272,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "wayland-backend", "wayland-client", "wayland-protocols 0.32.5", @@ -5361,7 +5361,7 @@ checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg_aliases 0.1.1", "document-features", "indexmap", @@ -5388,7 +5388,7 @@ dependencies = [ "arrayvec", "ash", "bit-set", - "bitflags 2.6.0", + "bitflags 2.7.0", "block", "bytemuck", "cfg_aliases 0.1.1", @@ -5429,7 +5429,7 @@ version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "js-sys", "web-sys", ] @@ -5940,7 +5940,7 @@ dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.6.0", + "bitflags 2.7.0", "block2", "bytemuck", "calloop 0.12.4", @@ -6074,7 +6074,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "dlib", "log", "once_cell", From 6f3f9c6298fc41e0bca761346d1440f5b5c89983 Mon Sep 17 00:00:00 2001 From: Casper Rogild Storm Date: Fri, 10 Jan 2025 10:31:01 +0100 Subject: [PATCH 6/6] Clippy --- src/buffer/input_view/completion.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer/input_view/completion.rs b/src/buffer/input_view/completion.rs index 7219863a..4c481fb2 100644 --- a/src/buffer/input_view/completion.rs +++ b/src/buffer/input_view/completion.rs @@ -679,8 +679,8 @@ impl Text { self.filtered = channels .iter() .sorted_by(|a, b: &&target::Channel| match autocomplete.sort_direction { - SortDirection::Asc => a.as_normalized_str().cmp(&b.as_normalized_str()), - SortDirection::Desc => b.as_normalized_str().cmp(&a.as_normalized_str()), + SortDirection::Asc => a.as_normalized_str().cmp(b.as_normalized_str()), + SortDirection::Desc => b.as_normalized_str().cmp(a.as_normalized_str()), }) .filter(|&channel| channel.as_str().starts_with(input_channel.as_str())) .map(|channel| channel.to_string())