From 7d18a268547734daf19a740b6533e9c1697baf1a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 23:31:54 +0100 Subject: v1.2.1: track wrapped board lines and split the paytable --- src/bin/client/repl.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/bin') diff --git a/src/bin/client/repl.rs b/src/bin/client/repl.rs index 58cb541..1ed3073 100644 --- a/src/bin/client/repl.rs +++ b/src/bin/client/repl.rs @@ -17,6 +17,7 @@ use zagan_bet::client::core::{ClientCore, Effect, InteractiveCommand, Key}; use zagan_bet::client::database; use zagan_bet::client::ui::{ display_width, format_pong, host_lines, input_cursor_column, lines_to_move_up, + visual_line_count, }; use zagan_bet::protocol::io_failure_message; @@ -29,7 +30,7 @@ pub struct ClientState { pub default_port: u16, core: ClientCore, cleanup_done: Arc>, - /// Number of terminal lines currently occupied by the game board. + /// Number of visual terminal lines currently occupied by the game board. game_lines: usize, /// Text last drawn after the `> ` prompt, used to keep the command echo /// in the transcript before printing command output. @@ -255,7 +256,10 @@ impl ClientState { .collect(); print!("{}", rendered.join("\r\n")); stdout().flush().unwrap(); - self.game_lines = lines.len().max(1); + let width = crossterm::terminal::size() + .map(|(columns, _)| columns as usize) + .unwrap_or(80); + self.game_lines = visual_line_count(lines, width).max(1); } fn clear_region(&mut self) { -- cgit v1.2.3