summaryrefslogtreecommitdiffstats
path: root/src/client/core.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-28 22:31:18 +0100
committersalmonik <salmonik@tuta.io>2026-10-28 22:31:18 +0100
commit828470137cb4e806c31a26fa741d5d67c64f98c2 (patch)
tree45dbe92af0f61166559d73c21fabd7759eca4b11 /src/client/core.rs
parentv0.2.3: add ClientCore and fix the game board rendering (diff)
downloadzagan-bet-828470137cb4e806c31a26fa741d5d67c64f98c2.tar.gz
zagan-bet-828470137cb4e806c31a26fa741d5d67c64f98c2.zip
v0.2.4: fix command UX, completion wrapping and auth prompt cancellation
Diffstat (limited to '')
-rw-r--r--src/client/core.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/core.rs b/src/client/core.rs
index 0e54fba..a910a68 100644
--- a/src/client/core.rs
+++ b/src/client/core.rs
@@ -1,7 +1,8 @@
1use crate::client::games::manager::GameManager; 1use crate::client::games::manager::GameManager;
2use crate::client::games::response::parse_spin_response; 2use crate::client::games::response::parse_spin_response;
3use crate::client::ui::{ 3use crate::client::ui::{
4 command_names, help_lines, input_cursor_column, parse_bet_arg, record_history, 4 command_names, completion_lines, help_lines, input_cursor_column, parse_bet_arg,
5 record_history,
5}; 6};
6 7
7#[derive(Debug, Clone, Copy, PartialEq, Eq)] 8#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -439,9 +440,7 @@ impl ClientCore {
439 if matches.len() == 1 { 440 if matches.len() == 1 {
440 self.input = matches[0].to_string(); 441 self.input = matches[0].to_string();
441 } else if matches.len() > 1 { 442 } else if matches.len() > 1 {
442 let mut lines = vec!["Possible completions:".to_string()]; 443 effects.push(Effect::Print(completion_lines(&matches, 76)));
443 lines.push(matches.join(" "));
444 effects.push(Effect::Print(lines));
445 } 444 }
446 if let Some(prompt) = self.prompt_effect() { 445 if let Some(prompt) = self.prompt_effect() {
447 effects.push(prompt); 446 effects.push(prompt);