@@ -5,7 +5,7 @@ use crossterm::{ |
| 5 | 5 | DisableMouseCapture, EnableMouseCapture, |
| 6 | 6 | KeyboardEnhancementFlags, PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags, |
| 7 | 7 | }, |
| 8 | | - execute, |
| 8 | + execute, queue, |
| 9 | 9 | style::{Attribute, Color, Print, ResetColor, SetAttribute, SetBackgroundColor, SetForegroundColor}, |
| 10 | 10 | terminal::{self, Clear, ClearType, EnterAlternateScreen, LeaveAlternateScreen}, |
| 11 | 11 | }; |
@@ -153,25 +153,31 @@ impl Screen { |
| 153 | 153 | |
| 154 | 154 | /// Position and show the hardware cursor at the given screen coordinates |
| 155 | 155 | pub fn show_cursor_at(&mut self, col: u16, row: u16) -> Result<()> { |
| 156 | | - execute!(self.stdout, MoveTo(col, row), Show)?; |
| 156 | + queue!(self.stdout, MoveTo(col, row), Show)?; |
| 157 | 157 | self.stdout.flush()?; |
| 158 | 158 | Ok(()) |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | + /// Hide the hardware cursor (call at start of render pass) |
| 162 | + pub fn hide_cursor(&mut self) -> Result<()> { |
| 163 | + queue!(self.stdout, Hide)?; |
| 164 | + Ok(()) |
| 165 | + } |
| 166 | + |
| 161 | 167 | #[allow(dead_code)] |
| 162 | 168 | pub fn clear(&mut self) -> Result<()> { |
| 163 | | - execute!(self.stdout, Clear(ClearType::All))?; |
| 169 | + queue!(self.stdout, Clear(ClearType::All))?; |
| 164 | 170 | Ok(()) |
| 165 | 171 | } |
| 166 | 172 | |
| 167 | 173 | /// Render the tab bar |
| 168 | 174 | /// Returns the height of the tab bar (always 1) |
| 169 | 175 | pub fn render_tab_bar(&mut self, tabs: &[TabInfo], left_offset: u16) -> Result<u16> { |
| 170 | | - execute!(self.stdout, MoveTo(left_offset, 0))?; |
| 176 | + queue!(self.stdout, MoveTo(left_offset, 0))?; |
| 171 | 177 | |
| 172 | 178 | // Fill the tab bar background |
| 173 | 179 | let available_width = self.cols.saturating_sub(left_offset) as usize; |
| 174 | | - execute!( |
| 180 | + queue!( |
| 175 | 181 | self.stdout, |
| 176 | 182 | SetBackgroundColor(TAB_BAR_BG), |
| 177 | 183 | SetForegroundColor(TAB_INACTIVE_FG), |
@@ -214,7 +220,7 @@ impl Screen { |
| 214 | 220 | (TAB_BAR_BG, TAB_INACTIVE_FG) |
| 215 | 221 | }; |
| 216 | 222 | |
| 217 | | - execute!( |
| 223 | + queue!( |
| 218 | 224 | self.stdout, |
| 219 | 225 | MoveTo(current_col as u16, 0), |
| 220 | 226 | SetBackgroundColor(bg), |
@@ -222,7 +228,7 @@ impl Screen { |
| 222 | 228 | |
| 223 | 229 | // Print index number (for Alt+N shortcut hint) |
| 224 | 230 | if !index_str.is_empty() { |
| 225 | | - execute!( |
| 231 | + queue!( |
| 226 | 232 | self.stdout, |
| 227 | 233 | SetForegroundColor(LINE_NUM_COLOR), |
| 228 | 234 | Print(&index_str), |
@@ -231,7 +237,7 @@ impl Screen { |
| 231 | 237 | } |
| 232 | 238 | |
| 233 | 239 | // Print tab name |
| 234 | | - execute!( |
| 240 | + queue!( |
| 235 | 241 | self.stdout, |
| 236 | 242 | SetForegroundColor(fg), |
| 237 | 243 | Print(&display_name), |
@@ -239,7 +245,7 @@ impl Screen { |
| 239 | 245 | |
| 240 | 246 | // Print modified indicator |
| 241 | 247 | if tab.is_modified { |
| 242 | | - execute!( |
| 248 | + queue!( |
| 243 | 249 | self.stdout, |
| 244 | 250 | SetForegroundColor(TAB_MODIFIED_FG), |
| 245 | 251 | Print(modified_str), |
@@ -250,7 +256,7 @@ impl Screen { |
| 250 | 256 | |
| 251 | 257 | // Add separator between tabs |
| 252 | 258 | if i + 1 < tab_count { |
| 253 | | - execute!( |
| 259 | + queue!( |
| 254 | 260 | self.stdout, |
| 255 | 261 | SetBackgroundColor(TAB_BAR_BG), |
| 256 | 262 | SetForegroundColor(LINE_NUM_COLOR), |
@@ -261,7 +267,7 @@ impl Screen { |
| 261 | 267 | } |
| 262 | 268 | |
| 263 | 269 | // Fill the rest of the line |
| 264 | | - execute!( |
| 270 | + queue!( |
| 265 | 271 | self.stdout, |
| 266 | 272 | SetBackgroundColor(TAB_BAR_BG), |
| 267 | 273 | Clear(ClearType::UntilNewLine), |
@@ -281,8 +287,6 @@ impl Screen { |
| 281 | 287 | left_offset: u16, |
| 282 | 288 | top_offset: u16, |
| 283 | 289 | ) -> Result<()> { |
| 284 | | - execute!(self.stdout, Hide)?; |
| 285 | | - |
| 286 | 290 | // Calculate available screen area |
| 287 | 291 | let available_width = self.cols.saturating_sub(left_offset) as f32; |
| 288 | 292 | let available_height = self.rows.saturating_sub(2 + top_offset) as f32; // -2 for gap + status bar |
@@ -316,7 +320,7 @@ impl Screen { |
| 316 | 320 | let sep_x = pane_x.saturating_sub(1); |
| 317 | 321 | let sep_color = if pane.is_active { PANE_ACTIVE_SEPARATOR_FG } else { PANE_SEPARATOR_FG }; |
| 318 | 322 | for row in 0..pane_height { |
| 319 | | - execute!( |
| 323 | + queue!( |
| 320 | 324 | self.stdout, |
| 321 | 325 | MoveTo(sep_x, pane_y + row), |
| 322 | 326 | SetBackgroundColor(BG_COLOR), |
@@ -331,7 +335,7 @@ impl Screen { |
| 331 | 335 | let sep_y = pane_y.saturating_sub(1); |
| 332 | 336 | let sep_color = if pane.is_active { PANE_ACTIVE_SEPARATOR_FG } else { PANE_SEPARATOR_FG }; |
| 333 | 337 | for col in 0..pane_width { |
| 334 | | - execute!( |
| 338 | + queue!( |
| 335 | 339 | self.stdout, |
| 336 | 340 | MoveTo(pane_x + col, sep_y), |
| 337 | 341 | SetBackgroundColor(BG_COLOR), |
@@ -344,7 +348,7 @@ impl Screen { |
| 344 | 348 | |
| 345 | 349 | // Render the gap row (empty line between text and status bar) |
| 346 | 350 | let gap_row = top_offset + available_height as u16; |
| 347 | | - execute!( |
| 351 | + queue!( |
| 348 | 352 | self.stdout, |
| 349 | 353 | MoveTo(left_offset, gap_row), |
| 350 | 354 | SetBackgroundColor(BG_COLOR), |
@@ -363,12 +367,11 @@ impl Screen { |
| 363 | 367 | )?; |
| 364 | 368 | } |
| 365 | 369 | |
| 366 | | - // Position hardware cursor |
| 370 | + // Position hardware cursor (but don't show - caller handles that) |
| 367 | 371 | if let Some((col, row)) = cursor_screen_pos { |
| 368 | | - execute!(self.stdout, MoveTo(col, row), Show)?; |
| 372 | + queue!(self.stdout, MoveTo(col, row))?; |
| 369 | 373 | } |
| 370 | 374 | |
| 371 | | - self.stdout.flush()?; |
| 372 | 375 | Ok(()) |
| 373 | 376 | } |
| 374 | 377 | |
@@ -423,7 +426,7 @@ impl Screen { |
| 423 | 426 | for row in 0..height as usize { |
| 424 | 427 | let line_idx = pane.viewport_line + row; |
| 425 | 428 | let is_current_line = line_idx == primary.line; |
| 426 | | - execute!(self.stdout, MoveTo(x, y + row as u16))?; |
| 429 | + queue!(self.stdout, MoveTo(x, y + row as u16))?; |
| 427 | 430 | |
| 428 | 431 | if line_idx < buffer.line_count() { |
| 429 | 432 | let line_num_fg = if is_current_line { |
@@ -433,7 +436,7 @@ impl Screen { |
| 433 | 436 | }; |
| 434 | 437 | let line_bg = if is_current_line { current_line_bg } else { bg_color }; |
| 435 | 438 | |
| 436 | | - execute!( |
| 439 | + queue!( |
| 437 | 440 | self.stdout, |
| 438 | 441 | SetBackgroundColor(line_bg), |
| 439 | 442 | SetForegroundColor(line_num_fg), |
@@ -464,7 +467,7 @@ impl Screen { |
| 464 | 467 | } else { |
| 465 | 468 | // Inactive pane: simple dimmed text |
| 466 | 469 | let chars: String = line.chars().take(text_cols).collect(); |
| 467 | | - execute!( |
| 470 | + queue!( |
| 468 | 471 | self.stdout, |
| 469 | 472 | SetBackgroundColor(line_bg), |
| 470 | 473 | SetForegroundColor(text_color), |
@@ -474,7 +477,7 @@ impl Screen { |
| 474 | 477 | } |
| 475 | 478 | |
| 476 | 479 | // Fill rest of pane width |
| 477 | | - execute!( |
| 480 | + queue!( |
| 478 | 481 | self.stdout, |
| 479 | 482 | SetBackgroundColor(line_bg), |
| 480 | 483 | )?; |
@@ -482,11 +485,11 @@ impl Screen { |
| 482 | 485 | let current_col = x + line_num_width as u16 + 1 + text_cols.min(line_len) as u16; |
| 483 | 486 | let remaining = (x + width).saturating_sub(current_col); |
| 484 | 487 | if remaining > 0 { |
| 485 | | - execute!(self.stdout, Print(" ".repeat(remaining as usize)))?; |
| 488 | + queue!(self.stdout, Print(" ".repeat(remaining as usize)))?; |
| 486 | 489 | } |
| 487 | | - execute!(self.stdout, ResetColor)?; |
| 490 | + queue!(self.stdout, ResetColor)?; |
| 488 | 491 | } else { |
| 489 | | - execute!( |
| 492 | + queue!( |
| 490 | 493 | self.stdout, |
| 491 | 494 | SetBackgroundColor(bg_color), |
| 492 | 495 | SetForegroundColor(if is_active { Color::DarkBlue } else { INACTIVE_LINE_NUM_COLOR }), |
@@ -494,7 +497,7 @@ impl Screen { |
| 494 | 497 | )?; |
| 495 | 498 | // Fill rest of line within pane bounds |
| 496 | 499 | let remaining = width.saturating_sub(line_num_width as u16 + 1); |
| 497 | | - execute!(self.stdout, Print(" ".repeat(remaining as usize)), ResetColor)?; |
| 500 | + queue!(self.stdout, Print(" ".repeat(remaining as usize)), ResetColor)?; |
| 498 | 501 | } |
| 499 | 502 | } |
| 500 | 503 | |
@@ -545,9 +548,6 @@ impl Screen { |
| 545 | 548 | message: Option<&str>, |
| 546 | 549 | bracket_match: Option<(usize, usize)>, |
| 547 | 550 | ) -> Result<()> { |
| 548 | | - // Hide cursor during render to prevent flicker |
| 549 | | - execute!(self.stdout, Hide)?; |
| 550 | | - |
| 551 | 551 | let line_num_width = self.line_number_width(buffer.line_count()); |
| 552 | 552 | let text_cols = self.cols as usize - line_num_width - 1; |
| 553 | 553 | |
@@ -575,7 +575,7 @@ impl Screen { |
| 575 | 575 | for row in 0..text_rows { |
| 576 | 576 | let line_idx = viewport_line + row; |
| 577 | 577 | let is_current_line = line_idx == primary.line; |
| 578 | | - execute!(self.stdout, MoveTo(0, row as u16))?; |
| 578 | + queue!(self.stdout, MoveTo(0, row as u16))?; |
| 579 | 579 | |
| 580 | 580 | if line_idx < buffer.line_count() { |
| 581 | 581 | // Line number with appropriate color |
@@ -586,7 +586,7 @@ impl Screen { |
| 586 | 586 | }; |
| 587 | 587 | let line_bg = if is_current_line { CURRENT_LINE_BG } else { BG_COLOR }; |
| 588 | 588 | |
| 589 | | - execute!( |
| 589 | + queue!( |
| 590 | 590 | self.stdout, |
| 591 | 591 | SetBackgroundColor(line_bg), |
| 592 | 592 | SetForegroundColor(line_num_fg), |
@@ -618,7 +618,7 @@ impl Screen { |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | // Fill rest of line with background color |
| 621 | | - execute!( |
| 621 | + queue!( |
| 622 | 622 | self.stdout, |
| 623 | 623 | SetBackgroundColor(line_bg), |
| 624 | 624 | Clear(ClearType::UntilNewLine), |
@@ -626,7 +626,7 @@ impl Screen { |
| 626 | 626 | )?; |
| 627 | 627 | } else { |
| 628 | 628 | // Empty line indicator |
| 629 | | - execute!( |
| 629 | + queue!( |
| 630 | 630 | self.stdout, |
| 631 | 631 | SetBackgroundColor(BG_COLOR), |
| 632 | 632 | SetForegroundColor(Color::DarkBlue), |
@@ -639,7 +639,7 @@ impl Screen { |
| 639 | 639 | |
| 640 | 640 | // Render the gap row (empty line between text and status bar) |
| 641 | 641 | let gap_row = text_rows as u16; |
| 642 | | - execute!( |
| 642 | + queue!( |
| 643 | 643 | self.stdout, |
| 644 | 644 | MoveTo(0, gap_row), |
| 645 | 645 | SetBackgroundColor(BG_COLOR), |
@@ -650,16 +650,14 @@ impl Screen { |
| 650 | 650 | // Status bar |
| 651 | 651 | self.render_status_bar(buffer, cursors, filename, message)?; |
| 652 | 652 | |
| 653 | | - // Position hardware cursor at primary cursor |
| 653 | + // Position hardware cursor at primary cursor (but don't show - caller handles that) |
| 654 | 654 | let cursor_row = primary.line.saturating_sub(viewport_line); |
| 655 | 655 | let cursor_col = line_num_width + 1 + primary.col; |
| 656 | | - execute!( |
| 656 | + queue!( |
| 657 | 657 | self.stdout, |
| 658 | 658 | MoveTo(cursor_col as u16, cursor_row as u16), |
| 659 | | - Show |
| 660 | 659 | )?; |
| 661 | 660 | |
| 662 | | - self.stdout.flush()?; |
| 663 | 661 | Ok(()) |
| 664 | 662 | } |
| 665 | 663 | |
@@ -774,7 +772,7 @@ impl Screen { |
| 774 | 772 | |
| 775 | 773 | // Apply styling |
| 776 | 774 | if bold { |
| 777 | | - execute!( |
| 775 | + queue!( |
| 778 | 776 | self.stdout, |
| 779 | 777 | SetBackgroundColor(bg), |
| 780 | 778 | SetForegroundColor(fg), |
@@ -783,7 +781,7 @@ impl Screen { |
| 783 | 781 | SetAttribute(Attribute::NoBold), |
| 784 | 782 | )?; |
| 785 | 783 | } else { |
| 786 | | - execute!( |
| 784 | + queue!( |
| 787 | 785 | self.stdout, |
| 788 | 786 | SetBackgroundColor(bg), |
| 789 | 787 | SetForegroundColor(fg), |
@@ -793,7 +791,7 @@ impl Screen { |
| 793 | 791 | } |
| 794 | 792 | |
| 795 | 793 | // Reset to line background for rest of line |
| 796 | | - execute!(self.stdout, SetBackgroundColor(line_bg), SetForegroundColor(default_fg))?; |
| 794 | + queue!(self.stdout, SetBackgroundColor(line_bg), SetForegroundColor(default_fg))?; |
| 797 | 795 | |
| 798 | 796 | // Handle secondary cursors at end of line (past text content) |
| 799 | 797 | let max_cursor_past_text = secondary_cursors.iter() |
@@ -805,21 +803,21 @@ impl Screen { |
| 805 | 803 | if max_cursor < max_cols { |
| 806 | 804 | for col in char_count..=max_cursor { |
| 807 | 805 | if secondary_cursors.contains(&col) { |
| 808 | | - execute!( |
| 806 | + queue!( |
| 809 | 807 | self.stdout, |
| 810 | 808 | SetBackgroundColor(Color::Magenta), |
| 811 | 809 | SetForegroundColor(Color::White), |
| 812 | 810 | Print(" ") |
| 813 | 811 | )?; |
| 814 | 812 | } else { |
| 815 | | - execute!( |
| 813 | + queue!( |
| 816 | 814 | self.stdout, |
| 817 | 815 | SetBackgroundColor(line_bg), |
| 818 | 816 | Print(" ") |
| 819 | 817 | )?; |
| 820 | 818 | } |
| 821 | 819 | } |
| 822 | | - execute!(self.stdout, SetBackgroundColor(line_bg), SetForegroundColor(default_fg))?; |
| 820 | + queue!(self.stdout, SetBackgroundColor(line_bg), SetForegroundColor(default_fg))?; |
| 823 | 821 | } |
| 824 | 822 | } |
| 825 | 823 | |
@@ -835,10 +833,10 @@ impl Screen { |
| 835 | 833 | message: Option<&str>, |
| 836 | 834 | ) -> Result<()> { |
| 837 | 835 | let status_row = self.rows.saturating_sub(1); |
| 838 | | - execute!(self.stdout, MoveTo(0, status_row))?; |
| 836 | + queue!(self.stdout, MoveTo(0, status_row))?; |
| 839 | 837 | |
| 840 | 838 | // Status bar background |
| 841 | | - execute!( |
| 839 | + queue!( |
| 842 | 840 | self.stdout, |
| 843 | 841 | SetBackgroundColor(Color::DarkGrey), |
| 844 | 842 | SetForegroundColor(Color::White) |
@@ -867,7 +865,7 @@ impl Screen { |
| 867 | 865 | let padding = (self.cols as usize).saturating_sub(left.len() + right.len()); |
| 868 | 866 | let middle = " ".repeat(padding); |
| 869 | 867 | |
| 870 | | - execute!( |
| 868 | + queue!( |
| 871 | 869 | self.stdout, |
| 872 | 870 | Print(&left), |
| 873 | 871 | Print(&middle), |
@@ -907,7 +905,7 @@ impl Screen { |
| 907 | 905 | let tree_rows = text_rows.saturating_sub(hint_rows + header_rows); |
| 908 | 906 | |
| 909 | 907 | // Draw header: repo_name:branch |
| 910 | | - execute!(self.stdout, MoveTo(0, 0))?; |
| 908 | + queue!(self.stdout, MoveTo(0, 0))?; |
| 911 | 909 | let header_text = if let Some(b) = branch { |
| 912 | 910 | format!("{}:{}", repo_name, b) |
| 913 | 911 | } else { |
@@ -917,15 +915,15 @@ impl Screen { |
| 917 | 915 | let padded = format!("{:<width$}", truncated, width = width); |
| 918 | 916 | |
| 919 | 917 | // Render header with cyan repo name, yellow branch |
| 920 | | - execute!( |
| 918 | + queue!( |
| 921 | 919 | self.stdout, |
| 922 | 920 | SetBackgroundColor(BG_COLOR), |
| 923 | 921 | SetForegroundColor(Color::Cyan), |
| 924 | 922 | )?; |
| 925 | 923 | if let Some(b) = branch { |
| 926 | 924 | let repo_display: String = repo_name.chars().take(width.saturating_sub(1)).collect(); |
| 927 | | - execute!(self.stdout, Print(&repo_display))?; |
| 928 | | - execute!( |
| 925 | + queue!(self.stdout, Print(&repo_display))?; |
| 926 | + queue!( |
| 929 | 927 | self.stdout, |
| 930 | 928 | SetForegroundColor(Color::DarkGrey), |
| 931 | 929 | Print(":"), |
@@ -934,16 +932,16 @@ impl Screen { |
| 934 | 932 | let remaining = width.saturating_sub(repo_display.len() + 1); |
| 935 | 933 | let branch_display: String = b.chars().take(remaining).collect(); |
| 936 | 934 | let branch_padded = format!("{:<width$}", branch_display, width = remaining); |
| 937 | | - execute!(self.stdout, Print(&branch_padded))?; |
| 935 | + queue!(self.stdout, Print(&branch_padded))?; |
| 938 | 936 | } else { |
| 939 | | - execute!(self.stdout, Print(&padded))?; |
| 937 | + queue!(self.stdout, Print(&padded))?; |
| 940 | 938 | } |
| 941 | | - execute!(self.stdout, ResetColor)?; |
| 939 | + queue!(self.stdout, ResetColor)?; |
| 942 | 940 | |
| 943 | 941 | // Draw separator |
| 944 | | - execute!(self.stdout, MoveTo(0, 1))?; |
| 942 | + queue!(self.stdout, MoveTo(0, 1))?; |
| 945 | 943 | let separator = "─".repeat(width); |
| 946 | | - execute!( |
| 944 | + queue!( |
| 947 | 945 | self.stdout, |
| 948 | 946 | SetBackgroundColor(BG_COLOR), |
| 949 | 947 | SetForegroundColor(Color::DarkGrey), |
@@ -954,10 +952,10 @@ impl Screen { |
| 954 | 952 | // Draw git mode indicator line |
| 955 | 953 | if git_mode { |
| 956 | 954 | let git_row = 2u16; |
| 957 | | - execute!(self.stdout, MoveTo(0, git_row))?; |
| 955 | + queue!(self.stdout, MoveTo(0, git_row))?; |
| 958 | 956 | let git_hint = "Git: a/u/d/m/p/l/f/t"; |
| 959 | 957 | let padded = format!("{:<width$}", git_hint, width = width); |
| 960 | | - execute!( |
| 958 | + queue!( |
| 961 | 959 | self.stdout, |
| 962 | 960 | SetBackgroundColor(Color::AnsiValue(235)), |
| 963 | 961 | SetForegroundColor(Color::Yellow), |
@@ -969,7 +967,7 @@ impl Screen { |
| 969 | 967 | // Draw file tree (starting after header) |
| 970 | 968 | for row in 0..tree_rows { |
| 971 | 969 | let screen_row = (row + header_rows) as u16; |
| 972 | | - execute!(self.stdout, MoveTo(0, screen_row))?; |
| 970 | + queue!(self.stdout, MoveTo(0, screen_row))?; |
| 973 | 971 | |
| 974 | 972 | let item_idx = scroll + row; |
| 975 | 973 | if item_idx < items.len() { |
@@ -1010,7 +1008,7 @@ impl Screen { |
| 1010 | 1008 | // Highlight selected - need to handle git indicator specially |
| 1011 | 1009 | let padded_len = width.saturating_sub(indicator_display_len); |
| 1012 | 1010 | let padded = format!("{:<width$}", display_base, width = padded_len); |
| 1013 | | - execute!( |
| 1011 | + queue!( |
| 1014 | 1012 | self.stdout, |
| 1015 | 1013 | SetBackgroundColor(Color::DarkGrey), |
| 1016 | 1014 | SetForegroundColor(Color::White), |
@@ -1019,21 +1017,21 @@ impl Screen { |
| 1019 | 1017 | if !git_indicator.is_empty() { |
| 1020 | 1018 | // Git indicator with selection background |
| 1021 | 1019 | if item.git_status.staged { |
| 1022 | | - execute!(self.stdout, SetForegroundColor(Color::Green), Print(" ↑"))?; |
| 1020 | + queue!(self.stdout, SetForegroundColor(Color::Green), Print(" ↑"))?; |
| 1023 | 1021 | } else if item.git_status.unstaged { |
| 1024 | | - execute!(self.stdout, SetForegroundColor(Color::Red), Print(" ✗"))?; |
| 1022 | + queue!(self.stdout, SetForegroundColor(Color::Red), Print(" ✗"))?; |
| 1025 | 1023 | } else if item.git_status.untracked { |
| 1026 | | - execute!(self.stdout, SetForegroundColor(Color::DarkGrey), Print(" ?"))?; |
| 1024 | + queue!(self.stdout, SetForegroundColor(Color::DarkGrey), Print(" ?"))?; |
| 1027 | 1025 | } else if item.git_status.incoming { |
| 1028 | | - execute!(self.stdout, SetForegroundColor(Color::Blue), Print(" ↓"))?; |
| 1026 | + queue!(self.stdout, SetForegroundColor(Color::Blue), Print(" ↓"))?; |
| 1029 | 1027 | } |
| 1030 | 1028 | } |
| 1031 | | - execute!(self.stdout, ResetColor)?; |
| 1029 | + queue!(self.stdout, ResetColor)?; |
| 1032 | 1030 | } else if item.is_dir { |
| 1033 | 1031 | // Directories in blue |
| 1034 | 1032 | let padded_len = width.saturating_sub(indicator_display_len); |
| 1035 | 1033 | let padded = format!("{:<width$}", display_base, width = padded_len); |
| 1036 | | - execute!( |
| 1034 | + queue!( |
| 1037 | 1035 | self.stdout, |
| 1038 | 1036 | SetBackgroundColor(BG_COLOR), |
| 1039 | 1037 | SetForegroundColor(Color::Blue), |
@@ -1043,7 +1041,7 @@ impl Screen { |
| 1043 | 1041 | } else if item.git_status.gitignored { |
| 1044 | 1042 | // Gitignored files in dark gray |
| 1045 | 1043 | let padded = format!("{:<width$}", display_base, width = width); |
| 1046 | | - execute!( |
| 1044 | + queue!( |
| 1047 | 1045 | self.stdout, |
| 1048 | 1046 | SetBackgroundColor(BG_COLOR), |
| 1049 | 1047 | SetForegroundColor(Color::DarkGrey), |
@@ -1054,7 +1052,7 @@ impl Screen { |
| 1054 | 1052 | // Files in default color with git status |
| 1055 | 1053 | let padded_len = width.saturating_sub(indicator_display_len); |
| 1056 | 1054 | let padded = format!("{:<width$}", display_base, width = padded_len); |
| 1057 | | - execute!( |
| 1055 | + queue!( |
| 1058 | 1056 | self.stdout, |
| 1059 | 1057 | SetBackgroundColor(BG_COLOR), |
| 1060 | 1058 | SetForegroundColor(Color::Reset), |
@@ -1062,20 +1060,20 @@ impl Screen { |
| 1062 | 1060 | )?; |
| 1063 | 1061 | // Add git status indicator |
| 1064 | 1062 | if item.git_status.staged { |
| 1065 | | - execute!(self.stdout, SetForegroundColor(Color::Green), Print(" ↑"))?; |
| 1063 | + queue!(self.stdout, SetForegroundColor(Color::Green), Print(" ↑"))?; |
| 1066 | 1064 | } else if item.git_status.unstaged { |
| 1067 | | - execute!(self.stdout, SetForegroundColor(Color::Red), Print(" ✗"))?; |
| 1065 | + queue!(self.stdout, SetForegroundColor(Color::Red), Print(" ✗"))?; |
| 1068 | 1066 | } else if item.git_status.untracked { |
| 1069 | | - execute!(self.stdout, SetForegroundColor(Color::DarkGrey), Print(" ?"))?; |
| 1067 | + queue!(self.stdout, SetForegroundColor(Color::DarkGrey), Print(" ?"))?; |
| 1070 | 1068 | } else if item.git_status.incoming { |
| 1071 | | - execute!(self.stdout, SetForegroundColor(Color::Blue), Print(" ↓"))?; |
| 1069 | + queue!(self.stdout, SetForegroundColor(Color::Blue), Print(" ↓"))?; |
| 1072 | 1070 | } |
| 1073 | | - execute!(self.stdout, ResetColor)?; |
| 1071 | + queue!(self.stdout, ResetColor)?; |
| 1074 | 1072 | } |
| 1075 | 1073 | } else { |
| 1076 | 1074 | // Empty row |
| 1077 | 1075 | let empty = " ".repeat(width); |
| 1078 | | - execute!( |
| 1076 | + queue!( |
| 1079 | 1077 | self.stdout, |
| 1080 | 1078 | SetBackgroundColor(BG_COLOR), |
| 1081 | 1079 | Print(&empty), |
@@ -1095,9 +1093,9 @@ impl Screen { |
| 1095 | 1093 | ]; |
| 1096 | 1094 | for (i, hint) in hints.iter().enumerate() { |
| 1097 | 1095 | if hint_start + i < text_rows { |
| 1098 | | - execute!(self.stdout, MoveTo(0, (hint_start + i) as u16))?; |
| 1096 | + queue!(self.stdout, MoveTo(0, (hint_start + i) as u16))?; |
| 1099 | 1097 | let padded = format!("{:<width$}", hint, width = width); |
| 1100 | | - execute!( |
| 1098 | + queue!( |
| 1101 | 1099 | self.stdout, |
| 1102 | 1100 | SetBackgroundColor(BG_COLOR), |
| 1103 | 1101 | SetForegroundColor(Color::DarkGrey), |
@@ -1108,10 +1106,10 @@ impl Screen { |
| 1108 | 1106 | } |
| 1109 | 1107 | } else { |
| 1110 | 1108 | if hint_start < text_rows { |
| 1111 | | - execute!(self.stdout, MoveTo(0, hint_start as u16))?; |
| 1109 | + queue!(self.stdout, MoveTo(0, hint_start as u16))?; |
| 1112 | 1110 | let hint = "ctrl-/:hints"; |
| 1113 | 1111 | let padded = format!("{:<width$}", hint, width = width); |
| 1114 | | - execute!( |
| 1112 | + queue!( |
| 1115 | 1113 | self.stdout, |
| 1116 | 1114 | SetBackgroundColor(BG_COLOR), |
| 1117 | 1115 | SetForegroundColor(Color::DarkGrey), |
@@ -1123,9 +1121,9 @@ impl Screen { |
| 1123 | 1121 | |
| 1124 | 1122 | // Fill the status bar row for fuss mode column (prevents terminal bleed-through) |
| 1125 | 1123 | let status_row = self.rows.saturating_sub(1); |
| 1126 | | - execute!(self.stdout, MoveTo(0, status_row))?; |
| 1124 | + queue!(self.stdout, MoveTo(0, status_row))?; |
| 1127 | 1125 | let status_fill = " ".repeat(width); |
| 1128 | | - execute!( |
| 1126 | + queue!( |
| 1129 | 1127 | self.stdout, |
| 1130 | 1128 | SetBackgroundColor(BG_COLOR), |
| 1131 | 1129 | Print(&status_fill), |
@@ -1149,9 +1147,6 @@ impl Screen { |
| 1149 | 1147 | top_offset: u16, |
| 1150 | 1148 | is_modified: bool, |
| 1151 | 1149 | ) -> Result<()> { |
| 1152 | | - // Hide cursor during render to prevent flicker |
| 1153 | | - execute!(self.stdout, Hide)?; |
| 1154 | | - |
| 1155 | 1150 | let available_cols = self.cols.saturating_sub(left_offset) as usize; |
| 1156 | 1151 | let line_num_width = self.line_number_width(buffer.line_count()); |
| 1157 | 1152 | let text_cols = available_cols.saturating_sub(line_num_width + 1); |
@@ -1180,7 +1175,7 @@ impl Screen { |
| 1180 | 1175 | for row in 0..text_rows { |
| 1181 | 1176 | let line_idx = viewport_line + row; |
| 1182 | 1177 | let is_current_line = line_idx == primary.line; |
| 1183 | | - execute!(self.stdout, MoveTo(left_offset, (row as u16) + top_offset))?; |
| 1178 | + queue!(self.stdout, MoveTo(left_offset, (row as u16) + top_offset))?; |
| 1184 | 1179 | |
| 1185 | 1180 | if line_idx < buffer.line_count() { |
| 1186 | 1181 | let line_num_fg = if is_current_line { |
@@ -1190,7 +1185,7 @@ impl Screen { |
| 1190 | 1185 | }; |
| 1191 | 1186 | let line_bg = if is_current_line { CURRENT_LINE_BG } else { BG_COLOR }; |
| 1192 | 1187 | |
| 1193 | | - execute!( |
| 1188 | + queue!( |
| 1194 | 1189 | self.stdout, |
| 1195 | 1190 | SetBackgroundColor(line_bg), |
| 1196 | 1191 | SetForegroundColor(line_num_fg), |
@@ -1218,14 +1213,14 @@ impl Screen { |
| 1218 | 1213 | )?; |
| 1219 | 1214 | } |
| 1220 | 1215 | |
| 1221 | | - execute!( |
| 1216 | + queue!( |
| 1222 | 1217 | self.stdout, |
| 1223 | 1218 | SetBackgroundColor(line_bg), |
| 1224 | 1219 | Clear(ClearType::UntilNewLine), |
| 1225 | 1220 | ResetColor |
| 1226 | 1221 | )?; |
| 1227 | 1222 | } else { |
| 1228 | | - execute!( |
| 1223 | + queue!( |
| 1229 | 1224 | self.stdout, |
| 1230 | 1225 | SetBackgroundColor(BG_COLOR), |
| 1231 | 1226 | SetForegroundColor(Color::DarkBlue), |
@@ -1238,7 +1233,7 @@ impl Screen { |
| 1238 | 1233 | |
| 1239 | 1234 | // Render the gap row (empty line between text and status bar) |
| 1240 | 1235 | let gap_row = text_rows as u16 + top_offset; |
| 1241 | | - execute!( |
| 1236 | + queue!( |
| 1242 | 1237 | self.stdout, |
| 1243 | 1238 | MoveTo(left_offset, gap_row), |
| 1244 | 1239 | SetBackgroundColor(BG_COLOR), |
@@ -1249,16 +1244,14 @@ impl Screen { |
| 1249 | 1244 | // Status bar |
| 1250 | 1245 | self.render_status_bar_with_offset(cursors, filename, message, left_offset, is_modified)?; |
| 1251 | 1246 | |
| 1252 | | - // Position hardware cursor at primary cursor |
| 1247 | + // Position hardware cursor at primary cursor (but don't show - caller handles that) |
| 1253 | 1248 | let cursor_row = (primary.line.saturating_sub(viewport_line) as u16) + top_offset; |
| 1254 | 1249 | let cursor_col = left_offset as usize + line_num_width + 1 + primary.col; |
| 1255 | | - execute!( |
| 1250 | + queue!( |
| 1256 | 1251 | self.stdout, |
| 1257 | 1252 | MoveTo(cursor_col as u16, cursor_row), |
| 1258 | | - Show |
| 1259 | 1253 | )?; |
| 1260 | 1254 | |
| 1261 | | - self.stdout.flush()?; |
| 1262 | 1255 | Ok(()) |
| 1263 | 1256 | } |
| 1264 | 1257 | |
@@ -1278,8 +1271,6 @@ impl Screen { |
| 1278 | 1271 | highlighter: &mut Highlighter, |
| 1279 | 1272 | ghost_text: Option<&str>, |
| 1280 | 1273 | ) -> Result<()> { |
| 1281 | | - execute!(self.stdout, Hide)?; |
| 1282 | | - |
| 1283 | 1274 | let available_cols = self.cols.saturating_sub(left_offset) as usize; |
| 1284 | 1275 | let line_num_width = self.line_number_width(buffer.line_count()); |
| 1285 | 1276 | let text_cols = available_cols.saturating_sub(line_num_width + 1); |
@@ -1327,7 +1318,7 @@ impl Screen { |
| 1327 | 1318 | for row in 0..text_rows { |
| 1328 | 1319 | let line_idx = viewport_line + row; |
| 1329 | 1320 | let is_current_line = line_idx == primary.line; |
| 1330 | | - execute!(self.stdout, MoveTo(left_offset, (row as u16) + top_offset))?; |
| 1321 | + queue!(self.stdout, MoveTo(left_offset, (row as u16) + top_offset))?; |
| 1331 | 1322 | |
| 1332 | 1323 | if line_idx < buffer.line_count() { |
| 1333 | 1324 | let line_num_fg = if is_current_line { |
@@ -1337,7 +1328,7 @@ impl Screen { |
| 1337 | 1328 | }; |
| 1338 | 1329 | let line_bg = if is_current_line { CURRENT_LINE_BG } else { BG_COLOR }; |
| 1339 | 1330 | |
| 1340 | | - execute!( |
| 1331 | + queue!( |
| 1341 | 1332 | self.stdout, |
| 1342 | 1333 | SetBackgroundColor(line_bg), |
| 1343 | 1334 | SetForegroundColor(line_num_fg), |
@@ -1400,7 +1391,7 @@ impl Screen { |
| 1400 | 1391 | if remaining_cols > 0 { |
| 1401 | 1392 | // Truncate ghost text if it doesn't fit |
| 1402 | 1393 | let ghost_display: String = ghost.chars().take(remaining_cols).collect(); |
| 1403 | | - execute!( |
| 1394 | + queue!( |
| 1404 | 1395 | self.stdout, |
| 1405 | 1396 | SetBackgroundColor(line_bg), |
| 1406 | 1397 | SetForegroundColor(Color::AnsiValue(240)), // Dim gray |
@@ -1411,14 +1402,14 @@ impl Screen { |
| 1411 | 1402 | } |
| 1412 | 1403 | } |
| 1413 | 1404 | |
| 1414 | | - execute!( |
| 1405 | + queue!( |
| 1415 | 1406 | self.stdout, |
| 1416 | 1407 | SetBackgroundColor(line_bg), |
| 1417 | 1408 | Clear(ClearType::UntilNewLine), |
| 1418 | 1409 | ResetColor |
| 1419 | 1410 | )?; |
| 1420 | 1411 | } else { |
| 1421 | | - execute!( |
| 1412 | + queue!( |
| 1422 | 1413 | self.stdout, |
| 1423 | 1414 | SetBackgroundColor(BG_COLOR), |
| 1424 | 1415 | SetForegroundColor(Color::DarkBlue), |
@@ -1431,7 +1422,7 @@ impl Screen { |
| 1431 | 1422 | |
| 1432 | 1423 | // Render the gap row (empty line between text and status bar) |
| 1433 | 1424 | let gap_row = text_rows as u16 + top_offset; |
| 1434 | | - execute!( |
| 1425 | + queue!( |
| 1435 | 1426 | self.stdout, |
| 1436 | 1427 | MoveTo(left_offset, gap_row), |
| 1437 | 1428 | SetBackgroundColor(BG_COLOR), |
@@ -1442,16 +1433,14 @@ impl Screen { |
| 1442 | 1433 | // Status bar |
| 1443 | 1434 | self.render_status_bar_with_offset(cursors, filename, message, left_offset, is_modified)?; |
| 1444 | 1435 | |
| 1445 | | - // Position hardware cursor (adjusted for horizontal scroll) |
| 1436 | + // Position hardware cursor (adjusted for horizontal scroll, but don't show - caller handles that) |
| 1446 | 1437 | let cursor_row = (primary.line.saturating_sub(viewport_line) as u16) + top_offset; |
| 1447 | 1438 | let cursor_col = left_offset as usize + line_num_width + 1 + primary.col.saturating_sub(viewport_col); |
| 1448 | | - execute!( |
| 1439 | + queue!( |
| 1449 | 1440 | self.stdout, |
| 1450 | 1441 | MoveTo(cursor_col as u16, cursor_row), |
| 1451 | | - Show |
| 1452 | 1442 | )?; |
| 1453 | 1443 | |
| 1454 | | - self.stdout.flush()?; |
| 1455 | 1444 | Ok(()) |
| 1456 | 1445 | } |
| 1457 | 1446 | |
@@ -1465,9 +1454,9 @@ impl Screen { |
| 1465 | 1454 | ) -> Result<()> { |
| 1466 | 1455 | let status_row = self.rows.saturating_sub(1); |
| 1467 | 1456 | let available_cols = self.cols.saturating_sub(offset) as usize; |
| 1468 | | - execute!(self.stdout, MoveTo(offset, status_row))?; |
| 1457 | + queue!(self.stdout, MoveTo(offset, status_row))?; |
| 1469 | 1458 | |
| 1470 | | - execute!( |
| 1459 | + queue!( |
| 1471 | 1460 | self.stdout, |
| 1472 | 1461 | SetBackgroundColor(Color::DarkGrey), |
| 1473 | 1462 | SetForegroundColor(Color::White) |
@@ -1493,7 +1482,7 @@ impl Screen { |
| 1493 | 1482 | let padding = available_cols.saturating_sub(left.len() + right.len()); |
| 1494 | 1483 | let middle = " ".repeat(padding); |
| 1495 | 1484 | |
| 1496 | | - execute!( |
| 1485 | + queue!( |
| 1497 | 1486 | self.stdout, |
| 1498 | 1487 | Print(&left), |
| 1499 | 1488 | Print(&middle), |
@@ -1510,14 +1499,14 @@ impl Screen { |
| 1510 | 1499 | items: &[(String, String, bool, bool)], // (label, path, is_selected, is_current_dir) |
| 1511 | 1500 | scroll: usize, |
| 1512 | 1501 | ) -> Result<()> { |
| 1513 | | - execute!(self.stdout, Hide)?; |
| 1502 | + queue!(self.stdout, Hide)?; |
| 1514 | 1503 | |
| 1515 | 1504 | let cols = self.cols as usize; |
| 1516 | 1505 | let rows = self.rows as usize; |
| 1517 | 1506 | |
| 1518 | 1507 | // Fill background |
| 1519 | 1508 | for row in 0..rows { |
| 1520 | | - execute!( |
| 1509 | + queue!( |
| 1521 | 1510 | self.stdout, |
| 1522 | 1511 | MoveTo(0, row as u16), |
| 1523 | 1512 | SetBackgroundColor(BG_COLOR), |
@@ -1535,7 +1524,7 @@ impl Screen { |
| 1535 | 1524 | let top_border = format!("╭{}╮", "─".repeat(box_width.saturating_sub(2))); |
| 1536 | 1525 | let bottom_border = format!("╰{}╯", "─".repeat(box_width.saturating_sub(2))); |
| 1537 | 1526 | |
| 1538 | | - execute!( |
| 1527 | + queue!( |
| 1539 | 1528 | self.stdout, |
| 1540 | 1529 | MoveTo(box_x as u16, box_y as u16), |
| 1541 | 1530 | SetBackgroundColor(BG_COLOR), |
@@ -1547,7 +1536,7 @@ impl Screen { |
| 1547 | 1536 | let title = "Welcome to fackr"; |
| 1548 | 1537 | let title_row = box_y + 1; |
| 1549 | 1538 | let title_x = box_x + (box_width.saturating_sub(title.len())) / 2; |
| 1550 | | - execute!( |
| 1539 | + queue!( |
| 1551 | 1540 | self.stdout, |
| 1552 | 1541 | MoveTo(box_x as u16, title_row as u16), |
| 1553 | 1542 | SetForegroundColor(Color::DarkGrey), |
@@ -1556,7 +1545,7 @@ impl Screen { |
| 1556 | 1545 | )?; |
| 1557 | 1546 | let padding_left = title_x.saturating_sub(box_x + 1); |
| 1558 | 1547 | let padding_right = box_width.saturating_sub(2).saturating_sub(padding_left + title.len()); |
| 1559 | | - execute!( |
| 1548 | + queue!( |
| 1560 | 1549 | self.stdout, |
| 1561 | 1550 | Print(&" ".repeat(padding_left)), |
| 1562 | 1551 | Print(title), |
@@ -1568,7 +1557,7 @@ impl Screen { |
| 1568 | 1557 | // Subtitle |
| 1569 | 1558 | let subtitle = "Select a workspace:"; |
| 1570 | 1559 | let subtitle_row = box_y + 2; |
| 1571 | | - execute!( |
| 1560 | + queue!( |
| 1572 | 1561 | self.stdout, |
| 1573 | 1562 | MoveTo(box_x as u16, subtitle_row as u16), |
| 1574 | 1563 | SetForegroundColor(Color::DarkGrey), |
@@ -1577,7 +1566,7 @@ impl Screen { |
| 1577 | 1566 | )?; |
| 1578 | 1567 | let padding_left = (box_width.saturating_sub(2).saturating_sub(subtitle.len())) / 2; |
| 1579 | 1568 | let padding_right = box_width.saturating_sub(2).saturating_sub(padding_left + subtitle.len()); |
| 1580 | | - execute!( |
| 1569 | + queue!( |
| 1581 | 1570 | self.stdout, |
| 1582 | 1571 | Print(&" ".repeat(padding_left)), |
| 1583 | 1572 | Print(subtitle), |
@@ -1588,7 +1577,7 @@ impl Screen { |
| 1588 | 1577 | |
| 1589 | 1578 | // Separator |
| 1590 | 1579 | let separator_row = box_y + 3; |
| 1591 | | - execute!( |
| 1580 | + queue!( |
| 1592 | 1581 | self.stdout, |
| 1593 | 1582 | MoveTo(box_x as u16, separator_row as u16), |
| 1594 | 1583 | SetForegroundColor(Color::DarkGrey), |
@@ -1606,7 +1595,7 @@ impl Screen { |
| 1606 | 1595 | let row = list_start_row + i; |
| 1607 | 1596 | let item_idx = scroll + i; |
| 1608 | 1597 | |
| 1609 | | - execute!( |
| 1598 | + queue!( |
| 1610 | 1599 | self.stdout, |
| 1611 | 1600 | MoveTo(box_x as u16, row as u16), |
| 1612 | 1601 | SetForegroundColor(Color::DarkGrey), |
@@ -1621,7 +1610,7 @@ impl Screen { |
| 1621 | 1610 | let padded = format!("{:<width$}", display_label, width = inner_width); |
| 1622 | 1611 | |
| 1623 | 1612 | if *is_selected { |
| 1624 | | - execute!( |
| 1613 | + queue!( |
| 1625 | 1614 | self.stdout, |
| 1626 | 1615 | SetBackgroundColor(Color::DarkGrey), |
| 1627 | 1616 | SetForegroundColor(Color::White), |
@@ -1629,13 +1618,13 @@ impl Screen { |
| 1629 | 1618 | SetBackgroundColor(BG_COLOR), |
| 1630 | 1619 | )?; |
| 1631 | 1620 | } else if *is_current_dir { |
| 1632 | | - execute!( |
| 1621 | + queue!( |
| 1633 | 1622 | self.stdout, |
| 1634 | 1623 | SetForegroundColor(Color::Cyan), |
| 1635 | 1624 | Print(&padded), |
| 1636 | 1625 | )?; |
| 1637 | 1626 | } else { |
| 1638 | | - execute!( |
| 1627 | + queue!( |
| 1639 | 1628 | self.stdout, |
| 1640 | 1629 | SetForegroundColor(Color::Reset), |
| 1641 | 1630 | Print(&padded), |
@@ -1647,14 +1636,14 @@ impl Screen { |
| 1647 | 1636 | // Clear and show path below |
| 1648 | 1637 | } |
| 1649 | 1638 | } else { |
| 1650 | | - execute!( |
| 1639 | + queue!( |
| 1651 | 1640 | self.stdout, |
| 1652 | 1641 | SetForegroundColor(Color::Reset), |
| 1653 | 1642 | Print(&" ".repeat(inner_width)), |
| 1654 | 1643 | )?; |
| 1655 | 1644 | } |
| 1656 | 1645 | |
| 1657 | | - execute!( |
| 1646 | + queue!( |
| 1658 | 1647 | self.stdout, |
| 1659 | 1648 | SetForegroundColor(Color::DarkGrey), |
| 1660 | 1649 | Print(" │"), |
@@ -1663,7 +1652,7 @@ impl Screen { |
| 1663 | 1652 | |
| 1664 | 1653 | // Path display row (show selected path) |
| 1665 | 1654 | let path_row = list_start_row + list_height; |
| 1666 | | - execute!( |
| 1655 | + queue!( |
| 1667 | 1656 | self.stdout, |
| 1668 | 1657 | MoveTo(box_x as u16, path_row as u16), |
| 1669 | 1658 | SetForegroundColor(Color::DarkGrey), |
@@ -1675,7 +1664,7 @@ impl Screen { |
| 1675 | 1664 | // Show selected path |
| 1676 | 1665 | let selected_item = items.iter().find(|(_, _, sel, _)| *sel); |
| 1677 | 1666 | let path_display_row = path_row + 1; |
| 1678 | | - execute!( |
| 1667 | + queue!( |
| 1679 | 1668 | self.stdout, |
| 1680 | 1669 | MoveTo(box_x as u16, path_display_row as u16), |
| 1681 | 1670 | SetForegroundColor(Color::DarkGrey), |
@@ -1684,18 +1673,18 @@ impl Screen { |
| 1684 | 1673 | if let Some((_, path, _, _)) = selected_item { |
| 1685 | 1674 | let truncated_path: String = path.chars().take(inner_width).collect(); |
| 1686 | 1675 | let padded_path = format!("{:<width$}", truncated_path, width = inner_width); |
| 1687 | | - execute!( |
| 1676 | + queue!( |
| 1688 | 1677 | self.stdout, |
| 1689 | 1678 | SetForegroundColor(Color::AnsiValue(240)), |
| 1690 | 1679 | Print(&padded_path), |
| 1691 | 1680 | )?; |
| 1692 | 1681 | } else { |
| 1693 | | - execute!( |
| 1682 | + queue!( |
| 1694 | 1683 | self.stdout, |
| 1695 | 1684 | Print(&" ".repeat(inner_width)), |
| 1696 | 1685 | )?; |
| 1697 | 1686 | } |
| 1698 | | - execute!( |
| 1687 | + queue!( |
| 1699 | 1688 | self.stdout, |
| 1700 | 1689 | SetForegroundColor(Color::DarkGrey), |
| 1701 | 1690 | Print(" │"), |
@@ -1703,7 +1692,7 @@ impl Screen { |
| 1703 | 1692 | |
| 1704 | 1693 | // Bottom border |
| 1705 | 1694 | let bottom_row = path_display_row + 1; |
| 1706 | | - execute!( |
| 1695 | + queue!( |
| 1707 | 1696 | self.stdout, |
| 1708 | 1697 | MoveTo(box_x as u16, bottom_row as u16), |
| 1709 | 1698 | SetForegroundColor(Color::DarkGrey), |
@@ -1714,7 +1703,7 @@ impl Screen { |
| 1714 | 1703 | let hint_row = bottom_row + 1; |
| 1715 | 1704 | let hints = "↑/↓: navigate Enter: select ESC: quit"; |
| 1716 | 1705 | let hints_x = (cols.saturating_sub(hints.len())) / 2; |
| 1717 | | - execute!( |
| 1706 | + queue!( |
| 1718 | 1707 | self.stdout, |
| 1719 | 1708 | MoveTo(hints_x as u16, hint_row as u16), |
| 1720 | 1709 | SetForegroundColor(Color::AnsiValue(240)), |
@@ -1769,7 +1758,7 @@ impl Screen { |
| 1769 | 1758 | let is_selected = i + scroll_offset == selected_index; |
| 1770 | 1759 | let bg = if is_selected { selected_bg } else { popup_bg }; |
| 1771 | 1760 | |
| 1772 | | - execute!( |
| 1761 | + queue!( |
| 1773 | 1762 | self.stdout, |
| 1774 | 1763 | MoveTo(popup_col, row), |
| 1775 | 1764 | SetBackgroundColor(bg), |
@@ -1792,7 +1781,7 @@ impl Screen { |
| 1792 | 1781 | write!(self.stdout, "{:<width$}", truncated_label, width = label_width - detail.len().min(15))?; |
| 1793 | 1782 | |
| 1794 | 1783 | if !detail.is_empty() { |
| 1795 | | - execute!(self.stdout, SetForegroundColor(detail_fg))?; |
| 1784 | + queue!(self.stdout, SetForegroundColor(detail_fg))?; |
| 1796 | 1785 | let truncated_detail: String = if detail.len() > 12 { |
| 1797 | 1786 | format!("{}...", &detail[..9]) |
| 1798 | 1787 | } else { |
@@ -1802,13 +1791,13 @@ impl Screen { |
| 1802 | 1791 | } |
| 1803 | 1792 | |
| 1804 | 1793 | // Clear to popup width |
| 1805 | | - execute!(self.stdout, ResetColor)?; |
| 1794 | + queue!(self.stdout, ResetColor)?; |
| 1806 | 1795 | } |
| 1807 | 1796 | |
| 1808 | 1797 | // Show scroll indicator if needed |
| 1809 | 1798 | if completions.len() > max_items { |
| 1810 | 1799 | let indicator_row = popup_row + max_items as u16; |
| 1811 | | - execute!( |
| 1800 | + queue!( |
| 1812 | 1801 | self.stdout, |
| 1813 | 1802 | MoveTo(popup_col, indicator_row), |
| 1814 | 1803 | SetBackgroundColor(popup_bg), |
@@ -1849,7 +1838,7 @@ impl Screen { |
| 1849 | 1838 | }; |
| 1850 | 1839 | |
| 1851 | 1840 | // Draw indicator at the start of the line (before line number) |
| 1852 | | - execute!( |
| 1841 | + queue!( |
| 1853 | 1842 | self.stdout, |
| 1854 | 1843 | MoveTo(left_offset, row), |
| 1855 | 1844 | SetForegroundColor(color), |
@@ -1910,7 +1899,7 @@ impl Screen { |
| 1910 | 1899 | let row = popup_row + i as u16; |
| 1911 | 1900 | |
| 1912 | 1901 | // Background and border |
| 1913 | | - execute!( |
| 1902 | + queue!( |
| 1914 | 1903 | self.stdout, |
| 1915 | 1904 | MoveTo(popup_col, row), |
| 1916 | 1905 | SetBackgroundColor(Color::AnsiValue(238)), |
@@ -1924,13 +1913,13 @@ impl Screen { |
| 1924 | 1913 | format!(" {:width$} ", line, width = popup_width) |
| 1925 | 1914 | }; |
| 1926 | 1915 | |
| 1927 | | - execute!(self.stdout, Print(&display_line), ResetColor)?; |
| 1916 | + queue!(self.stdout, Print(&display_line), ResetColor)?; |
| 1928 | 1917 | } |
| 1929 | 1918 | |
| 1930 | 1919 | // Show indicator if content is truncated |
| 1931 | 1920 | if lines.len() > popup_height { |
| 1932 | 1921 | let row = popup_row + popup_height as u16; |
| 1933 | | - execute!( |
| 1922 | + queue!( |
| 1934 | 1923 | self.stdout, |
| 1935 | 1924 | MoveTo(popup_col, row), |
| 1936 | 1925 | SetBackgroundColor(Color::AnsiValue(238)), |
@@ -1969,7 +1958,7 @@ impl Screen { |
| 1969 | 1958 | let input_bg = Color::AnsiValue(238); |
| 1970 | 1959 | |
| 1971 | 1960 | // Draw top border |
| 1972 | | - execute!( |
| 1961 | + queue!( |
| 1973 | 1962 | self.stdout, |
| 1974 | 1963 | MoveTo(start_col as u16, start_row as u16), |
| 1975 | 1964 | SetBackgroundColor(bg), |
@@ -1979,7 +1968,7 @@ impl Screen { |
| 1979 | 1968 | |
| 1980 | 1969 | // Draw title row |
| 1981 | 1970 | let title_padding = (modal_width - 2 - title.len()) / 2; |
| 1982 | | - execute!( |
| 1971 | + queue!( |
| 1983 | 1972 | self.stdout, |
| 1984 | 1973 | MoveTo(start_col as u16, start_row as u16 + 1), |
| 1985 | 1974 | SetBackgroundColor(bg), |
@@ -1992,7 +1981,7 @@ impl Screen { |
| 1992 | 1981 | )?; |
| 1993 | 1982 | |
| 1994 | 1983 | // Draw separator |
| 1995 | | - execute!( |
| 1984 | + queue!( |
| 1996 | 1985 | self.stdout, |
| 1997 | 1986 | MoveTo(start_col as u16, start_row as u16 + 2), |
| 1998 | 1987 | SetBackgroundColor(bg), |
@@ -2001,7 +1990,7 @@ impl Screen { |
| 2001 | 1990 | )?; |
| 2002 | 1991 | |
| 2003 | 1992 | // Draw "From:" row |
| 2004 | | - execute!( |
| 1993 | + queue!( |
| 2005 | 1994 | self.stdout, |
| 2006 | 1995 | MoveTo(start_col as u16, start_row as u16 + 3), |
| 2007 | 1996 | SetBackgroundColor(bg), |
@@ -2017,7 +2006,7 @@ impl Screen { |
| 2017 | 2006 | |
| 2018 | 2007 | // Draw "To:" row with input field |
| 2019 | 2008 | let input_width = modal_width - 4 - to_label.len(); |
| 2020 | | - execute!( |
| 2009 | + queue!( |
| 2021 | 2010 | self.stdout, |
| 2022 | 2011 | MoveTo(start_col as u16, start_row as u16 + 4), |
| 2023 | 2012 | SetBackgroundColor(bg), |
@@ -2034,7 +2023,7 @@ impl Screen { |
| 2034 | 2023 | )?; |
| 2035 | 2024 | |
| 2036 | 2025 | // Draw bottom border |
| 2037 | | - execute!( |
| 2026 | + queue!( |
| 2038 | 2027 | self.stdout, |
| 2039 | 2028 | MoveTo(start_col as u16, start_row as u16 + 5), |
| 2040 | 2029 | SetBackgroundColor(bg), |
@@ -2045,12 +2034,13 @@ impl Screen { |
| 2045 | 2034 | |
| 2046 | 2035 | // Position cursor in the input field |
| 2047 | 2036 | let cursor_col = start_col + 2 + to_label.len() + new_name.len(); |
| 2048 | | - execute!( |
| 2037 | + queue!( |
| 2049 | 2038 | self.stdout, |
| 2050 | 2039 | MoveTo(cursor_col as u16, start_row as u16 + 4), |
| 2051 | 2040 | SetBackgroundColor(input_bg), |
| 2052 | 2041 | crossterm::cursor::Show, |
| 2053 | 2042 | )?; |
| 2043 | + self.stdout.flush()?; |
| 2054 | 2044 | |
| 2055 | 2045 | Ok(()) |
| 2056 | 2046 | } |
@@ -2070,7 +2060,7 @@ impl Screen { |
| 2070 | 2060 | let status_row = self.rows.saturating_sub(1); |
| 2071 | 2061 | let available_cols = (self.cols.saturating_sub(left_offset)) as usize; |
| 2072 | 2062 | |
| 2073 | | - execute!(self.stdout, MoveTo(left_offset, status_row))?; |
| 2063 | + queue!(self.stdout, MoveTo(left_offset, status_row))?; |
| 2074 | 2064 | |
| 2075 | 2065 | // Colors |
| 2076 | 2066 | let bg = Color::DarkGrey; |
@@ -2090,13 +2080,13 @@ impl Screen { |
| 2090 | 2080 | let input_width = input_width.max(10).min(40); |
| 2091 | 2081 | |
| 2092 | 2082 | // Start with background |
| 2093 | | - execute!(self.stdout, SetBackgroundColor(bg))?; |
| 2083 | + queue!(self.stdout, SetBackgroundColor(bg))?; |
| 2094 | 2084 | |
| 2095 | 2085 | // Find label and input |
| 2096 | 2086 | let find_bg = if active_field { active_bg } else { inactive_bg }; |
| 2097 | 2087 | let find_label_color = if active_field { active_label } else { label_color }; |
| 2098 | 2088 | |
| 2099 | | - execute!( |
| 2089 | + queue!( |
| 2100 | 2090 | self.stdout, |
| 2101 | 2091 | SetForegroundColor(find_label_color), |
| 2102 | 2092 | Print(find_label), |
@@ -2110,13 +2100,13 @@ impl Screen { |
| 2110 | 2100 | } else { |
| 2111 | 2101 | format!("{:<width$}", find_query, width = input_width) |
| 2112 | 2102 | }; |
| 2113 | | - execute!(self.stdout, Print(&find_display))?; |
| 2103 | + queue!(self.stdout, Print(&find_display))?; |
| 2114 | 2104 | |
| 2115 | 2105 | // Replace label and input |
| 2116 | 2106 | let replace_bg = if !active_field { active_bg } else { inactive_bg }; |
| 2117 | 2107 | let replace_label_color = if !active_field { active_label } else { label_color }; |
| 2118 | 2108 | |
| 2119 | | - execute!( |
| 2109 | + queue!( |
| 2120 | 2110 | self.stdout, |
| 2121 | 2111 | SetBackgroundColor(bg), |
| 2122 | 2112 | SetForegroundColor(replace_label_color), |
@@ -2131,14 +2121,14 @@ impl Screen { |
| 2131 | 2121 | } else { |
| 2132 | 2122 | format!("{:<width$}", replace_text, width = input_width) |
| 2133 | 2123 | }; |
| 2134 | | - execute!(self.stdout, Print(&replace_display))?; |
| 2124 | + queue!(self.stdout, Print(&replace_display))?; |
| 2135 | 2125 | |
| 2136 | 2126 | // Toggle buttons |
| 2137 | | - execute!(self.stdout, SetBackgroundColor(bg))?; |
| 2127 | + queue!(self.stdout, SetBackgroundColor(bg))?; |
| 2138 | 2128 | |
| 2139 | 2129 | // Regex toggle [.*] |
| 2140 | 2130 | let regex_color = if regex_mode { toggle_on } else { toggle_off }; |
| 2141 | | - execute!( |
| 2131 | + queue!( |
| 2142 | 2132 | self.stdout, |
| 2143 | 2133 | Print(" "), |
| 2144 | 2134 | SetForegroundColor(regex_color), |
@@ -2147,7 +2137,7 @@ impl Screen { |
| 2147 | 2137 | |
| 2148 | 2138 | // Case sensitivity toggle [Aa] |
| 2149 | 2139 | let case_color = if case_insensitive { toggle_on } else { toggle_off }; |
| 2150 | | - execute!( |
| 2140 | + queue!( |
| 2151 | 2141 | self.stdout, |
| 2152 | 2142 | Print(" "), |
| 2153 | 2143 | SetForegroundColor(case_color), |
@@ -2155,14 +2145,14 @@ impl Screen { |
| 2155 | 2145 | )?; |
| 2156 | 2146 | |
| 2157 | 2147 | // Match count |
| 2158 | | - execute!(self.stdout, SetForegroundColor(label_color))?; |
| 2148 | + queue!(self.stdout, SetForegroundColor(label_color))?; |
| 2159 | 2149 | if match_count > 0 { |
| 2160 | | - execute!( |
| 2150 | + queue!( |
| 2161 | 2151 | self.stdout, |
| 2162 | 2152 | Print(format!(" {}/{}", current_match + 1, match_count)), |
| 2163 | 2153 | )?; |
| 2164 | 2154 | } else if !find_query.is_empty() { |
| 2165 | | - execute!(self.stdout, Print(" No matches"))?; |
| 2155 | + queue!(self.stdout, Print(" No matches"))?; |
| 2166 | 2156 | } |
| 2167 | 2157 | |
| 2168 | 2158 | // Fill remaining space |
@@ -2171,7 +2161,7 @@ impl Screen { |
| 2171 | 2161 | else if !find_query.is_empty() { 11 } |
| 2172 | 2162 | else { 0 }; |
| 2173 | 2163 | let remaining = available_cols.saturating_sub(used); |
| 2174 | | - execute!( |
| 2164 | + queue!( |
| 2175 | 2165 | self.stdout, |
| 2176 | 2166 | Print(" ".repeat(remaining)), |
| 2177 | 2167 | ResetColor, |
@@ -2183,11 +2173,12 @@ impl Screen { |
| 2183 | 2173 | } else { |
| 2184 | 2174 | left_offset as usize + find_label.len() + input_width + replace_label.len() + replace_text.len().min(input_width) |
| 2185 | 2175 | }; |
| 2186 | | - execute!( |
| 2176 | + queue!( |
| 2187 | 2177 | self.stdout, |
| 2188 | 2178 | MoveTo(cursor_col as u16, status_row), |
| 2189 | 2179 | crossterm::cursor::Show, |
| 2190 | 2180 | )?; |
| 2181 | + self.stdout.flush()?; |
| 2191 | 2182 | |
| 2192 | 2183 | Ok(()) |
| 2193 | 2184 | } |
@@ -2237,7 +2228,7 @@ impl Screen { |
| 2237 | 2228 | path_str.to_string() |
| 2238 | 2229 | }; |
| 2239 | 2230 | let title = format!(" {} ", display_path); |
| 2240 | | - execute!( |
| 2231 | + queue!( |
| 2241 | 2232 | self.stdout, |
| 2242 | 2233 | MoveTo(start_col as u16, start_row as u16), |
| 2243 | 2234 | SetBackgroundColor(bg), |
@@ -2251,7 +2242,7 @@ impl Screen { |
| 2251 | 2242 | )?; |
| 2252 | 2243 | |
| 2253 | 2244 | // Draw filter input row |
| 2254 | | - execute!( |
| 2245 | + queue!( |
| 2255 | 2246 | self.stdout, |
| 2256 | 2247 | MoveTo(start_col as u16, (start_row + 1) as u16), |
| 2257 | 2248 | SetBackgroundColor(bg), |
@@ -2269,7 +2260,7 @@ impl Screen { |
| 2269 | 2260 | )?; |
| 2270 | 2261 | |
| 2271 | 2262 | // Draw separator |
| 2272 | | - execute!( |
| 2263 | + queue!( |
| 2273 | 2264 | self.stdout, |
| 2274 | 2265 | MoveTo(start_col as u16, (start_row + 2) as u16), |
| 2275 | 2266 | SetBackgroundColor(bg), |
@@ -2307,7 +2298,7 @@ impl Screen { |
| 2307 | 2298 | name.clone() |
| 2308 | 2299 | }; |
| 2309 | 2300 | |
| 2310 | | - execute!( |
| 2301 | + queue!( |
| 2311 | 2302 | self.stdout, |
| 2312 | 2303 | MoveTo(start_col as u16, row), |
| 2313 | 2304 | SetBackgroundColor(item_bg), |
@@ -2326,7 +2317,7 @@ impl Screen { |
| 2326 | 2317 | let items_drawn = filtered.len().saturating_sub(scroll).min(visible_rows); |
| 2327 | 2318 | for i in items_drawn..visible_rows { |
| 2328 | 2319 | let row = (start_row + 3 + i) as u16; |
| 2329 | | - execute!( |
| 2320 | + queue!( |
| 2330 | 2321 | self.stdout, |
| 2331 | 2322 | MoveTo(start_col as u16, row), |
| 2332 | 2323 | SetBackgroundColor(bg), |
@@ -2339,7 +2330,7 @@ impl Screen { |
| 2339 | 2330 | // Draw help text row |
| 2340 | 2331 | let help_row = (start_row + 3 + visible_rows) as u16; |
| 2341 | 2332 | let help_text = "←:up →/Enter:open ↑↓:nav Esc:close"; |
| 2342 | | - execute!( |
| 2333 | + queue!( |
| 2343 | 2334 | self.stdout, |
| 2344 | 2335 | MoveTo(start_col as u16, help_row), |
| 2345 | 2336 | SetBackgroundColor(bg), |
@@ -2353,7 +2344,7 @@ impl Screen { |
| 2353 | 2344 | )?; |
| 2354 | 2345 | |
| 2355 | 2346 | // Draw bottom border |
| 2356 | | - execute!( |
| 2347 | + queue!( |
| 2357 | 2348 | self.stdout, |
| 2358 | 2349 | MoveTo(start_col as u16, help_row + 1), |
| 2359 | 2350 | SetBackgroundColor(bg), |
@@ -2363,7 +2354,7 @@ impl Screen { |
| 2363 | 2354 | )?; |
| 2364 | 2355 | |
| 2365 | 2356 | // Hide cursor when in fortress modal |
| 2366 | | - execute!(self.stdout, Hide)?; |
| 2357 | + queue!(self.stdout, Hide)?; |
| 2367 | 2358 | |
| 2368 | 2359 | self.stdout.flush()?; |
| 2369 | 2360 | Ok(()) |
@@ -2398,7 +2389,7 @@ impl Screen { |
| 2398 | 2389 | |
| 2399 | 2390 | // Draw top border with title |
| 2400 | 2391 | let title = " Search in Files (F4) "; |
| 2401 | | - execute!( |
| 2392 | + queue!( |
| 2402 | 2393 | self.stdout, |
| 2403 | 2394 | MoveTo(start_col as u16, start_row as u16), |
| 2404 | 2395 | SetBackgroundColor(bg), |
@@ -2422,7 +2413,7 @@ impl Screen { |
| 2422 | 2413 | "Type query, press Enter" |
| 2423 | 2414 | }; |
| 2424 | 2415 | let input_width = modal_width.saturating_sub(14 + status.len()); |
| 2425 | | - execute!( |
| 2416 | + queue!( |
| 2426 | 2417 | self.stdout, |
| 2427 | 2418 | MoveTo(start_col as u16, (start_row + 1) as u16), |
| 2428 | 2419 | SetBackgroundColor(bg), |
@@ -2447,7 +2438,7 @@ impl Screen { |
| 2447 | 2438 | } else { |
| 2448 | 2439 | format!(" {} results ", results.len()) |
| 2449 | 2440 | }; |
| 2450 | | - execute!( |
| 2441 | + queue!( |
| 2451 | 2442 | self.stdout, |
| 2452 | 2443 | MoveTo(start_col as u16, (start_row + 2) as u16), |
| 2453 | 2444 | SetBackgroundColor(bg), |
@@ -2501,7 +2492,7 @@ impl Screen { |
| 2501 | 2492 | content.clone() |
| 2502 | 2493 | }; |
| 2503 | 2494 | |
| 2504 | | - execute!( |
| 2495 | + queue!( |
| 2505 | 2496 | self.stdout, |
| 2506 | 2497 | MoveTo(start_col as u16, row), |
| 2507 | 2498 | SetBackgroundColor(item_bg), |
@@ -2521,7 +2512,7 @@ impl Screen { |
| 2521 | 2512 | // Calculate remaining width and print content with padding |
| 2522 | 2513 | let used = display_path.len() + 1 + line_str.len() + 2 + 2; |
| 2523 | 2514 | let remaining = modal_width.saturating_sub(used + 2); |
| 2524 | | - execute!( |
| 2515 | + queue!( |
| 2525 | 2516 | self.stdout, |
| 2526 | 2517 | Print(format!("{:<width$}", display_content, width = remaining)), |
| 2527 | 2518 | SetForegroundColor(border_color), |
@@ -2534,7 +2525,7 @@ impl Screen { |
| 2534 | 2525 | let items_drawn = results.len().saturating_sub(scroll).min(visible_rows); |
| 2535 | 2526 | for i in items_drawn..visible_rows { |
| 2536 | 2527 | let row = (start_row + 3 + i) as u16; |
| 2537 | | - execute!( |
| 2528 | + queue!( |
| 2538 | 2529 | self.stdout, |
| 2539 | 2530 | MoveTo(start_col as u16, row), |
| 2540 | 2531 | SetBackgroundColor(bg), |
@@ -2547,7 +2538,7 @@ impl Screen { |
| 2547 | 2538 | // Draw help text row |
| 2548 | 2539 | let help_row = (start_row + 3 + visible_rows) as u16; |
| 2549 | 2540 | let help_text = "Enter:search/open ↑↓:nav PgUp/Dn:scroll Esc:close"; |
| 2550 | | - execute!( |
| 2541 | + queue!( |
| 2551 | 2542 | self.stdout, |
| 2552 | 2543 | MoveTo(start_col as u16, help_row), |
| 2553 | 2544 | SetBackgroundColor(bg), |
@@ -2561,7 +2552,7 @@ impl Screen { |
| 2561 | 2552 | )?; |
| 2562 | 2553 | |
| 2563 | 2554 | // Draw bottom border |
| 2564 | | - execute!( |
| 2555 | + queue!( |
| 2565 | 2556 | self.stdout, |
| 2566 | 2557 | MoveTo(start_col as u16, help_row + 1), |
| 2567 | 2558 | SetBackgroundColor(bg), |
@@ -2571,7 +2562,7 @@ impl Screen { |
| 2571 | 2562 | )?; |
| 2572 | 2563 | |
| 2573 | 2564 | // Hide cursor when in modal |
| 2574 | | - execute!(self.stdout, Hide)?; |
| 2565 | + queue!(self.stdout, Hide)?; |
| 2575 | 2566 | |
| 2576 | 2567 | self.stdout.flush()?; |
| 2577 | 2568 | Ok(()) |
@@ -2606,7 +2597,7 @@ impl Screen { |
| 2606 | 2597 | let prompt_color = Color::Yellow; |
| 2607 | 2598 | |
| 2608 | 2599 | // Draw top border with subtle styling |
| 2609 | | - execute!( |
| 2600 | + queue!( |
| 2610 | 2601 | self.stdout, |
| 2611 | 2602 | MoveTo(start_col as u16, start_row as u16), |
| 2612 | 2603 | SetBackgroundColor(bg), |
@@ -2618,7 +2609,7 @@ impl Screen { |
| 2618 | 2609 | // Draw search input row with > prefix |
| 2619 | 2610 | let display_query = if query.is_empty() { "" } else { query }; |
| 2620 | 2611 | let input_display_width = modal_width.saturating_sub(6); |
| 2621 | | - execute!( |
| 2612 | + queue!( |
| 2622 | 2613 | self.stdout, |
| 2623 | 2614 | MoveTo(start_col as u16, (start_row + 1) as u16), |
| 2624 | 2615 | SetBackgroundColor(bg), |
@@ -2638,7 +2629,7 @@ impl Screen { |
| 2638 | 2629 | )?; |
| 2639 | 2630 | |
| 2640 | 2631 | // Draw separator |
| 2641 | | - execute!( |
| 2632 | + queue!( |
| 2642 | 2633 | self.stdout, |
| 2643 | 2634 | MoveTo(start_col as u16, (start_row + 2) as u16), |
| 2644 | 2635 | SetBackgroundColor(bg), |
@@ -2684,7 +2675,7 @@ impl Screen { |
| 2684 | 2675 | name.clone() |
| 2685 | 2676 | }; |
| 2686 | 2677 | |
| 2687 | | - execute!( |
| 2678 | + queue!( |
| 2688 | 2679 | self.stdout, |
| 2689 | 2680 | MoveTo(start_col as u16, row), |
| 2690 | 2681 | SetBackgroundColor(item_bg), |
@@ -2697,7 +2688,7 @@ impl Screen { |
| 2697 | 2688 | |
| 2698 | 2689 | // Print name with padding |
| 2699 | 2690 | let name_padding = name_width.saturating_sub(display_name.len()); |
| 2700 | | - execute!( |
| 2691 | + queue!( |
| 2701 | 2692 | self.stdout, |
| 2702 | 2693 | Print(&display_name), |
| 2703 | 2694 | Print(format!("{:width$}", "", width = name_padding)), |
@@ -2713,7 +2704,7 @@ impl Screen { |
| 2713 | 2704 | let items_drawn = commands.len().saturating_sub(scroll).min(visible_rows); |
| 2714 | 2705 | for i in items_drawn..visible_rows { |
| 2715 | 2706 | let row = (start_row + 3 + i) as u16; |
| 2716 | | - execute!( |
| 2707 | + queue!( |
| 2717 | 2708 | self.stdout, |
| 2718 | 2709 | MoveTo(start_col as u16, row), |
| 2719 | 2710 | SetBackgroundColor(bg), |
@@ -2731,7 +2722,7 @@ impl Screen { |
| 2731 | 2722 | } else { |
| 2732 | 2723 | format!("{} commands", commands.len()) |
| 2733 | 2724 | }; |
| 2734 | | - execute!( |
| 2725 | + queue!( |
| 2735 | 2726 | self.stdout, |
| 2736 | 2727 | MoveTo(start_col as u16, help_row), |
| 2737 | 2728 | SetBackgroundColor(bg), |
@@ -2746,7 +2737,7 @@ impl Screen { |
| 2746 | 2737 | )?; |
| 2747 | 2738 | |
| 2748 | 2739 | // Draw bottom border |
| 2749 | | - execute!( |
| 2740 | + queue!( |
| 2750 | 2741 | self.stdout, |
| 2751 | 2742 | MoveTo(start_col as u16, help_row + 1), |
| 2752 | 2743 | SetBackgroundColor(bg), |
@@ -2756,7 +2747,7 @@ impl Screen { |
| 2756 | 2747 | )?; |
| 2757 | 2748 | |
| 2758 | 2749 | // Show help in lighter text at bottom |
| 2759 | | - execute!( |
| 2750 | + queue!( |
| 2760 | 2751 | self.stdout, |
| 2761 | 2752 | MoveTo(start_col as u16, help_row + 2), |
| 2762 | 2753 | SetForegroundColor(Color::AnsiValue(243)), |
@@ -2765,7 +2756,7 @@ impl Screen { |
| 2765 | 2756 | )?; |
| 2766 | 2757 | |
| 2767 | 2758 | // Hide cursor when in modal |
| 2768 | | - execute!(self.stdout, Hide)?; |
| 2759 | + queue!(self.stdout, Hide)?; |
| 2769 | 2760 | |
| 2770 | 2761 | self.stdout.flush()?; |
| 2771 | 2762 | Ok(()) |
@@ -2801,7 +2792,7 @@ impl Screen { |
| 2801 | 2792 | // Draw top border with title (show indicator when viewing alternates) |
| 2802 | 2793 | let title = if show_alt { " Keybindings [/] " } else { " Keybindings " }; |
| 2803 | 2794 | let title_padding = (modal_width.saturating_sub(title.len() + 2)) / 2; |
| 2804 | | - execute!( |
| 2795 | + queue!( |
| 2805 | 2796 | self.stdout, |
| 2806 | 2797 | MoveTo(start_col as u16, start_row as u16), |
| 2807 | 2798 | SetBackgroundColor(bg), |
@@ -2822,7 +2813,7 @@ impl Screen { |
| 2822 | 2813 | let display_query = if query.is_empty() { "Type to filter..." } else { query }; |
| 2823 | 2814 | let input_display_width = modal_width.saturating_sub(5); |
| 2824 | 2815 | let placeholder_color = if query.is_empty() { Color::AnsiValue(243) } else { Color::White }; |
| 2825 | | - execute!( |
| 2816 | + queue!( |
| 2826 | 2817 | self.stdout, |
| 2827 | 2818 | MoveTo(start_col as u16, (start_row + 1) as u16), |
| 2828 | 2819 | SetBackgroundColor(bg), |
@@ -2838,7 +2829,7 @@ impl Screen { |
| 2838 | 2829 | )?; |
| 2839 | 2830 | |
| 2840 | 2831 | // Draw separator |
| 2841 | | - execute!( |
| 2832 | + queue!( |
| 2842 | 2833 | self.stdout, |
| 2843 | 2834 | MoveTo(start_col as u16, (start_row + 2) as u16), |
| 2844 | 2835 | SetBackgroundColor(bg), |
@@ -2890,7 +2881,7 @@ impl Screen { |
| 2890 | 2881 | shortcut.clone() |
| 2891 | 2882 | }; |
| 2892 | 2883 | |
| 2893 | | - execute!( |
| 2884 | + queue!( |
| 2894 | 2885 | self.stdout, |
| 2895 | 2886 | MoveTo(start_col as u16, row), |
| 2896 | 2887 | SetBackgroundColor(item_bg), |
@@ -2916,7 +2907,7 @@ impl Screen { |
| 2916 | 2907 | // Fill remaining rows |
| 2917 | 2908 | for i in row_offset..visible_rows { |
| 2918 | 2909 | let row = (start_row + 3 + i) as u16; |
| 2919 | | - execute!( |
| 2910 | + queue!( |
| 2920 | 2911 | self.stdout, |
| 2921 | 2912 | MoveTo(start_col as u16, row), |
| 2922 | 2913 | SetBackgroundColor(bg), |
@@ -2933,7 +2924,7 @@ impl Screen { |
| 2933 | 2924 | } else { |
| 2934 | 2925 | format!("{} keybinds", keybinds.len()) |
| 2935 | 2926 | }; |
| 2936 | | - execute!( |
| 2927 | + queue!( |
| 2937 | 2928 | self.stdout, |
| 2938 | 2929 | MoveTo(start_col as u16, info_row), |
| 2939 | 2930 | SetBackgroundColor(bg), |
@@ -2948,7 +2939,7 @@ impl Screen { |
| 2948 | 2939 | )?; |
| 2949 | 2940 | |
| 2950 | 2941 | // Draw bottom border |
| 2951 | | - execute!( |
| 2942 | + queue!( |
| 2952 | 2943 | self.stdout, |
| 2953 | 2944 | MoveTo(start_col as u16, info_row + 1), |
| 2954 | 2945 | SetBackgroundColor(bg), |
@@ -2963,7 +2954,7 @@ impl Screen { |
| 2963 | 2954 | } else { |
| 2964 | 2955 | "↑↓:scroll PgUp/PgDn:page Home/End:jump /:alt binds Esc:close" |
| 2965 | 2956 | }; |
| 2966 | | - execute!( |
| 2957 | + queue!( |
| 2967 | 2958 | self.stdout, |
| 2968 | 2959 | MoveTo(start_col as u16, info_row + 2), |
| 2969 | 2960 | SetForegroundColor(Color::AnsiValue(243)), |
@@ -2972,7 +2963,7 @@ impl Screen { |
| 2972 | 2963 | )?; |
| 2973 | 2964 | |
| 2974 | 2965 | // Hide cursor when in modal |
| 2975 | | - execute!(self.stdout, Hide)?; |
| 2966 | + queue!(self.stdout, Hide)?; |
| 2976 | 2967 | |
| 2977 | 2968 | self.stdout.flush()?; |
| 2978 | 2969 | Ok(()) |
@@ -3015,7 +3006,7 @@ impl Screen { |
| 3015 | 3006 | |
| 3016 | 3007 | // Draw top border with title |
| 3017 | 3008 | let title = format!(" References ({}) ", filtered.len()); |
| 3018 | | - execute!( |
| 3009 | + queue!( |
| 3019 | 3010 | self.stdout, |
| 3020 | 3011 | MoveTo(start_col as u16, start_row), |
| 3021 | 3012 | SetBackgroundColor(bg), |
@@ -3029,7 +3020,7 @@ impl Screen { |
| 3029 | 3020 | )?; |
| 3030 | 3021 | |
| 3031 | 3022 | // Draw filter input row |
| 3032 | | - execute!( |
| 3023 | + queue!( |
| 3033 | 3024 | self.stdout, |
| 3034 | 3025 | MoveTo(start_col as u16, start_row + 1), |
| 3035 | 3026 | SetBackgroundColor(bg), |
@@ -3047,7 +3038,7 @@ impl Screen { |
| 3047 | 3038 | )?; |
| 3048 | 3039 | |
| 3049 | 3040 | // Draw separator |
| 3050 | | - execute!( |
| 3041 | + queue!( |
| 3051 | 3042 | self.stdout, |
| 3052 | 3043 | MoveTo(start_col as u16, start_row + 2), |
| 3053 | 3044 | SetBackgroundColor(bg), |
@@ -3103,7 +3094,7 @@ impl Screen { |
| 3103 | 3094 | // The remaining padding goes after line_info |
| 3104 | 3095 | let remaining = panel_width.saturating_sub(max_path_width + line_info.len() + 4); |
| 3105 | 3096 | |
| 3106 | | - execute!( |
| 3097 | + queue!( |
| 3107 | 3098 | self.stdout, |
| 3108 | 3099 | MoveTo(start_col as u16, row), |
| 3109 | 3100 | SetBackgroundColor(item_bg), |
@@ -3124,7 +3115,7 @@ impl Screen { |
| 3124 | 3115 | let items_drawn = filtered.len().saturating_sub(scroll_offset).min(visible_rows); |
| 3125 | 3116 | for i in items_drawn..visible_rows { |
| 3126 | 3117 | let row = start_row + 3 + i as u16; |
| 3127 | | - execute!( |
| 3118 | + queue!( |
| 3128 | 3119 | self.stdout, |
| 3129 | 3120 | MoveTo(start_col as u16, row), |
| 3130 | 3121 | SetBackgroundColor(bg), |
@@ -3137,7 +3128,7 @@ impl Screen { |
| 3137 | 3128 | // Draw help text row |
| 3138 | 3129 | let help_row = start_row + 3 + visible_rows as u16; |
| 3139 | 3130 | let help_text = "↑↓:nav Enter:go Esc:close"; |
| 3140 | | - execute!( |
| 3131 | + queue!( |
| 3141 | 3132 | self.stdout, |
| 3142 | 3133 | MoveTo(start_col as u16, help_row), |
| 3143 | 3134 | SetBackgroundColor(bg), |
@@ -3151,7 +3142,7 @@ impl Screen { |
| 3151 | 3142 | )?; |
| 3152 | 3143 | |
| 3153 | 3144 | // Draw bottom border |
| 3154 | | - execute!( |
| 3145 | + queue!( |
| 3155 | 3146 | self.stdout, |
| 3156 | 3147 | MoveTo(start_col as u16, help_row + 1), |
| 3157 | 3148 | SetBackgroundColor(bg), |
@@ -3161,7 +3152,7 @@ impl Screen { |
| 3161 | 3152 | )?; |
| 3162 | 3153 | |
| 3163 | 3154 | // Hide cursor when in references panel |
| 3164 | | - execute!(self.stdout, Hide)?; |
| 3155 | + queue!(self.stdout, Hide)?; |
| 3165 | 3156 | |
| 3166 | 3157 | self.stdout.flush()?; |
| 3167 | 3158 | Ok(()) |
@@ -3194,7 +3185,7 @@ impl Screen { |
| 3194 | 3185 | } |
| 3195 | 3186 | |
| 3196 | 3187 | // Top border |
| 3197 | | - execute!( |
| 3188 | + queue!( |
| 3198 | 3189 | self.stdout, |
| 3199 | 3190 | MoveTo(start_col as u16, start_row), |
| 3200 | 3191 | SetForegroundColor(Color::Cyan), |
@@ -3205,7 +3196,7 @@ impl Screen { |
| 3205 | 3196 | )?; |
| 3206 | 3197 | |
| 3207 | 3198 | // Header |
| 3208 | | - execute!( |
| 3199 | + queue!( |
| 3209 | 3200 | self.stdout, |
| 3210 | 3201 | MoveTo(start_col as u16, start_row + 1), |
| 3211 | 3202 | SetForegroundColor(Color::Cyan), |
@@ -3218,7 +3209,7 @@ impl Screen { |
| 3218 | 3209 | )?; |
| 3219 | 3210 | let header_len = 25; |
| 3220 | 3211 | let padding = panel_width - header_len - 7; |
| 3221 | | - execute!( |
| 3212 | + queue!( |
| 3222 | 3213 | self.stdout, |
| 3223 | 3214 | Print(" ".repeat(padding)), |
| 3224 | 3215 | Print("Alt+M"), |
@@ -3228,7 +3219,7 @@ impl Screen { |
| 3228 | 3219 | )?; |
| 3229 | 3220 | |
| 3230 | 3221 | // Header separator |
| 3231 | | - execute!( |
| 3222 | + queue!( |
| 3232 | 3223 | self.stdout, |
| 3233 | 3224 | MoveTo(start_col as u16, start_row + 2), |
| 3234 | 3225 | SetForegroundColor(Color::Cyan), |
@@ -3245,7 +3236,7 @@ impl Screen { |
| 3245 | 3236 | let row = start_row + 3 + i as u16; |
| 3246 | 3237 | let is_selected = idx == panel.selected_index; |
| 3247 | 3238 | |
| 3248 | | - execute!( |
| 3239 | + queue!( |
| 3249 | 3240 | self.stdout, |
| 3250 | 3241 | MoveTo(start_col as u16, row), |
| 3251 | 3242 | SetForegroundColor(Color::Cyan), |
@@ -3254,19 +3245,19 @@ impl Screen { |
| 3254 | 3245 | |
| 3255 | 3246 | // Highlight selected row |
| 3256 | 3247 | if is_selected { |
| 3257 | | - execute!(self.stdout, SetAttribute(Attribute::Reverse))?; |
| 3248 | + queue!(self.stdout, SetAttribute(Attribute::Reverse))?; |
| 3258 | 3249 | } |
| 3259 | 3250 | |
| 3260 | 3251 | // Status icon |
| 3261 | | - execute!(self.stdout, Print(" "))?; |
| 3252 | + queue!(self.stdout, Print(" "))?; |
| 3262 | 3253 | if server.is_installed { |
| 3263 | | - execute!( |
| 3254 | + queue!( |
| 3264 | 3255 | self.stdout, |
| 3265 | 3256 | SetForegroundColor(Color::Green), |
| 3266 | 3257 | Print("✓"), |
| 3267 | 3258 | )?; |
| 3268 | 3259 | } else { |
| 3269 | | - execute!( |
| 3260 | + queue!( |
| 3270 | 3261 | self.stdout, |
| 3271 | 3262 | SetForegroundColor(Color::Red), |
| 3272 | 3263 | Print("✗"), |
@@ -3281,7 +3272,7 @@ impl Screen { |
| 3281 | 3272 | format!(" {} ({})", server.name, server.language) |
| 3282 | 3273 | }; |
| 3283 | 3274 | let name_len = name_lang.len().min(panel_width - 20); |
| 3284 | | - execute!( |
| 3275 | + queue!( |
| 3285 | 3276 | self.stdout, |
| 3286 | 3277 | SetForegroundColor(if is_installing { Color::Yellow } else { Color::White }), |
| 3287 | 3278 | Print(&name_lang[..name_len]), |
@@ -3303,16 +3294,16 @@ impl Screen { |
| 3303 | 3294 | let used = 1 + 1 + name_len + status.len() + 1; |
| 3304 | 3295 | let content_width = panel_width - 2; |
| 3305 | 3296 | let status_padding = content_width.saturating_sub(used); |
| 3306 | | - execute!(self.stdout, Print(" ".repeat(status_padding)))?; |
| 3297 | + queue!(self.stdout, Print(" ".repeat(status_padding)))?; |
| 3307 | 3298 | |
| 3308 | 3299 | if server.is_installed { |
| 3309 | | - execute!( |
| 3300 | + queue!( |
| 3310 | 3301 | self.stdout, |
| 3311 | 3302 | SetForegroundColor(Color::DarkGrey), |
| 3312 | 3303 | Print(status), |
| 3313 | 3304 | )?; |
| 3314 | 3305 | } else { |
| 3315 | | - execute!( |
| 3306 | + queue!( |
| 3316 | 3307 | self.stdout, |
| 3317 | 3308 | SetForegroundColor(Color::Yellow), |
| 3318 | 3309 | Print(status), |
@@ -3320,10 +3311,10 @@ impl Screen { |
| 3320 | 3311 | } |
| 3321 | 3312 | |
| 3322 | 3313 | if is_selected { |
| 3323 | | - execute!(self.stdout, SetAttribute(Attribute::Reset))?; |
| 3314 | + queue!(self.stdout, SetAttribute(Attribute::Reset))?; |
| 3324 | 3315 | } |
| 3325 | 3316 | |
| 3326 | | - execute!( |
| 3317 | + queue!( |
| 3327 | 3318 | self.stdout, |
| 3328 | 3319 | Print(" "), |
| 3329 | 3320 | SetForegroundColor(Color::Cyan), |
@@ -3335,7 +3326,7 @@ impl Screen { |
| 3335 | 3326 | // Fill remaining rows |
| 3336 | 3327 | for i in (visible_end - panel.scroll_offset)..max_visible { |
| 3337 | 3328 | let row = start_row + 3 + i as u16; |
| 3338 | | - execute!( |
| 3329 | + queue!( |
| 3339 | 3330 | self.stdout, |
| 3340 | 3331 | MoveTo(start_col as u16, row), |
| 3341 | 3332 | SetForegroundColor(Color::Cyan), |
@@ -3348,7 +3339,7 @@ impl Screen { |
| 3348 | 3339 | |
| 3349 | 3340 | // Footer separator |
| 3350 | 3341 | let footer_row = start_row + 3 + max_visible as u16; |
| 3351 | | - execute!( |
| 3342 | + queue!( |
| 3352 | 3343 | self.stdout, |
| 3353 | 3344 | MoveTo(start_col as u16, footer_row), |
| 3354 | 3345 | SetForegroundColor(Color::Cyan), |
@@ -3359,7 +3350,7 @@ impl Screen { |
| 3359 | 3350 | )?; |
| 3360 | 3351 | |
| 3361 | 3352 | // Status or help |
| 3362 | | - execute!( |
| 3353 | + queue!( |
| 3363 | 3354 | self.stdout, |
| 3364 | 3355 | MoveTo(start_col as u16, footer_row + 1), |
| 3365 | 3356 | SetForegroundColor(Color::Cyan), |
@@ -3388,18 +3379,18 @@ impl Screen { |
| 3388 | 3379 | msg.clone() |
| 3389 | 3380 | }; |
| 3390 | 3381 | let display_width = msg_display.width(); |
| 3391 | | - execute!( |
| 3382 | + queue!( |
| 3392 | 3383 | self.stdout, |
| 3393 | 3384 | SetForegroundColor(Color::Yellow), |
| 3394 | 3385 | Print(format!(" {}", msg_display)), |
| 3395 | 3386 | )?; |
| 3396 | 3387 | // We printed 1 space + msg_display, need to fill to content_width |
| 3397 | 3388 | let pad = content_width.saturating_sub(1 + display_width); |
| 3398 | | - execute!(self.stdout, Print(" ".repeat(pad)))?; |
| 3389 | + queue!(self.stdout, Print(" ".repeat(pad)))?; |
| 3399 | 3390 | } else { |
| 3400 | 3391 | let help_text = " ↑↓ Navigate Enter Install r Refresh Esc Close "; |
| 3401 | 3392 | let help_width = help_text.width(); |
| 3402 | | - execute!( |
| 3393 | + queue!( |
| 3403 | 3394 | self.stdout, |
| 3404 | 3395 | SetForegroundColor(Color::DarkGrey), |
| 3405 | 3396 | Print(help_text), |
@@ -3407,10 +3398,10 @@ impl Screen { |
| 3407 | 3398 | // Content width is panel_width - 2 (for borders) |
| 3408 | 3399 | let content_width = panel_width - 2; |
| 3409 | 3400 | let pad = content_width.saturating_sub(help_width); |
| 3410 | | - execute!(self.stdout, Print(" ".repeat(pad)))?; |
| 3401 | + queue!(self.stdout, Print(" ".repeat(pad)))?; |
| 3411 | 3402 | } |
| 3412 | 3403 | |
| 3413 | | - execute!( |
| 3404 | + queue!( |
| 3414 | 3405 | self.stdout, |
| 3415 | 3406 | SetForegroundColor(Color::Cyan), |
| 3416 | 3407 | Print("│"), |
@@ -3418,7 +3409,7 @@ impl Screen { |
| 3418 | 3409 | )?; |
| 3419 | 3410 | |
| 3420 | 3411 | // Bottom border |
| 3421 | | - execute!( |
| 3412 | + queue!( |
| 3422 | 3413 | self.stdout, |
| 3423 | 3414 | MoveTo(start_col as u16, footer_row + 2), |
| 3424 | 3415 | SetForegroundColor(Color::Cyan), |
@@ -3446,7 +3437,7 @@ impl Screen { |
| 3446 | 3437 | }; |
| 3447 | 3438 | |
| 3448 | 3439 | // Top border |
| 3449 | | - execute!( |
| 3440 | + queue!( |
| 3450 | 3441 | self.stdout, |
| 3451 | 3442 | MoveTo(start_col as u16, start_row), |
| 3452 | 3443 | SetForegroundColor(Color::Cyan), |
@@ -3458,7 +3449,7 @@ impl Screen { |
| 3458 | 3449 | |
| 3459 | 3450 | // Title |
| 3460 | 3451 | let title = format!(" Install {}? ", server.name); |
| 3461 | | - execute!( |
| 3452 | + queue!( |
| 3462 | 3453 | self.stdout, |
| 3463 | 3454 | MoveTo(start_col as u16, start_row + 1), |
| 3464 | 3455 | SetForegroundColor(Color::Cyan), |
@@ -3468,7 +3459,7 @@ impl Screen { |
| 3468 | 3459 | SetAttribute(Attribute::Reset), |
| 3469 | 3460 | )?; |
| 3470 | 3461 | let pad = panel_width - 2 - title.len(); |
| 3471 | | - execute!( |
| 3462 | + queue!( |
| 3472 | 3463 | self.stdout, |
| 3473 | 3464 | Print(" ".repeat(pad)), |
| 3474 | 3465 | SetForegroundColor(Color::Cyan), |
@@ -3477,7 +3468,7 @@ impl Screen { |
| 3477 | 3468 | )?; |
| 3478 | 3469 | |
| 3479 | 3470 | // Blank line |
| 3480 | | - execute!( |
| 3471 | + queue!( |
| 3481 | 3472 | self.stdout, |
| 3482 | 3473 | MoveTo(start_col as u16, start_row + 2), |
| 3483 | 3474 | SetForegroundColor(Color::Cyan), |
@@ -3493,7 +3484,7 @@ impl Screen { |
| 3493 | 3484 | } else { |
| 3494 | 3485 | server.install_cmd.to_string() |
| 3495 | 3486 | }; |
| 3496 | | - execute!( |
| 3487 | + queue!( |
| 3497 | 3488 | self.stdout, |
| 3498 | 3489 | MoveTo(start_col as u16, start_row + 3), |
| 3499 | 3490 | SetForegroundColor(Color::Cyan), |
@@ -3504,7 +3495,7 @@ impl Screen { |
| 3504 | 3495 | Print(&cmd_display), |
| 3505 | 3496 | )?; |
| 3506 | 3497 | let pad = panel_width - 12 - cmd_display.len(); |
| 3507 | | - execute!( |
| 3498 | + queue!( |
| 3508 | 3499 | self.stdout, |
| 3509 | 3500 | Print(" ".repeat(pad)), |
| 3510 | 3501 | SetForegroundColor(Color::Cyan), |
@@ -3513,7 +3504,7 @@ impl Screen { |
| 3513 | 3504 | )?; |
| 3514 | 3505 | |
| 3515 | 3506 | // Blank line |
| 3516 | | - execute!( |
| 3507 | + queue!( |
| 3517 | 3508 | self.stdout, |
| 3518 | 3509 | MoveTo(start_col as u16, start_row + 4), |
| 3519 | 3510 | SetForegroundColor(Color::Cyan), |
@@ -3524,7 +3515,7 @@ impl Screen { |
| 3524 | 3515 | )?; |
| 3525 | 3516 | |
| 3526 | 3517 | // Buttons |
| 3527 | | - execute!( |
| 3518 | + queue!( |
| 3528 | 3519 | self.stdout, |
| 3529 | 3520 | MoveTo(start_col as u16, start_row + 5), |
| 3530 | 3521 | SetForegroundColor(Color::Cyan), |
@@ -3532,7 +3523,7 @@ impl Screen { |
| 3532 | 3523 | )?; |
| 3533 | 3524 | let button_text = "[Y]es [N]o"; |
| 3534 | 3525 | let button_pad = (panel_width - 2 - button_text.len()) / 2; |
| 3535 | | - execute!( |
| 3526 | + queue!( |
| 3536 | 3527 | self.stdout, |
| 3537 | 3528 | Print(" ".repeat(button_pad)), |
| 3538 | 3529 | Print("["), |
@@ -3551,7 +3542,7 @@ impl Screen { |
| 3551 | 3542 | )?; |
| 3552 | 3543 | |
| 3553 | 3544 | // Bottom border |
| 3554 | | - execute!( |
| 3545 | + queue!( |
| 3555 | 3546 | self.stdout, |
| 3556 | 3547 | MoveTo(start_col as u16, start_row + 6), |
| 3557 | 3548 | SetForegroundColor(Color::Cyan), |
@@ -3582,7 +3573,7 @@ impl Screen { |
| 3582 | 3573 | let instructions = server.install_cmd.trim_start_matches('#').trim(); |
| 3583 | 3574 | |
| 3584 | 3575 | // Top border |
| 3585 | | - execute!( |
| 3576 | + queue!( |
| 3586 | 3577 | self.stdout, |
| 3587 | 3578 | MoveTo(start_col as u16, start_row), |
| 3588 | 3579 | SetForegroundColor(Color::Cyan), |
@@ -3594,7 +3585,7 @@ impl Screen { |
| 3594 | 3585 | |
| 3595 | 3586 | // Title |
| 3596 | 3587 | let title = format!(" {} - Manual Installation ", server.name); |
| 3597 | | - execute!( |
| 3588 | + queue!( |
| 3598 | 3589 | self.stdout, |
| 3599 | 3590 | MoveTo(start_col as u16, start_row + 1), |
| 3600 | 3591 | SetForegroundColor(Color::Cyan), |
@@ -3605,7 +3596,7 @@ impl Screen { |
| 3605 | 3596 | SetAttribute(Attribute::Reset), |
| 3606 | 3597 | )?; |
| 3607 | 3598 | let pad = panel_width - 2 - title.len(); |
| 3608 | | - execute!( |
| 3599 | + queue!( |
| 3609 | 3600 | self.stdout, |
| 3610 | 3601 | Print(" ".repeat(pad)), |
| 3611 | 3602 | SetForegroundColor(Color::Cyan), |
@@ -3614,7 +3605,7 @@ impl Screen { |
| 3614 | 3605 | )?; |
| 3615 | 3606 | |
| 3616 | 3607 | // Separator |
| 3617 | | - execute!( |
| 3608 | + queue!( |
| 3618 | 3609 | self.stdout, |
| 3619 | 3610 | MoveTo(start_col as u16, start_row + 2), |
| 3620 | 3611 | SetForegroundColor(Color::Cyan), |
@@ -3625,7 +3616,7 @@ impl Screen { |
| 3625 | 3616 | )?; |
| 3626 | 3617 | |
| 3627 | 3618 | // Language |
| 3628 | | - execute!( |
| 3619 | + queue!( |
| 3629 | 3620 | self.stdout, |
| 3630 | 3621 | MoveTo(start_col as u16, start_row + 3), |
| 3631 | 3622 | SetForegroundColor(Color::Cyan), |
@@ -3636,7 +3627,7 @@ impl Screen { |
| 3636 | 3627 | Print(server.language), |
| 3637 | 3628 | )?; |
| 3638 | 3629 | let lang_pad = panel_width - 13 - server.language.len(); |
| 3639 | | - execute!( |
| 3630 | + queue!( |
| 3640 | 3631 | self.stdout, |
| 3641 | 3632 | Print(" ".repeat(lang_pad)), |
| 3642 | 3633 | SetForegroundColor(Color::Cyan), |
@@ -3645,7 +3636,7 @@ impl Screen { |
| 3645 | 3636 | )?; |
| 3646 | 3637 | |
| 3647 | 3638 | // Blank line |
| 3648 | | - execute!( |
| 3639 | + queue!( |
| 3649 | 3640 | self.stdout, |
| 3650 | 3641 | MoveTo(start_col as u16, start_row + 4), |
| 3651 | 3642 | SetForegroundColor(Color::Cyan), |
@@ -3656,7 +3647,7 @@ impl Screen { |
| 3656 | 3647 | )?; |
| 3657 | 3648 | |
| 3658 | 3649 | // Instructions label |
| 3659 | | - execute!( |
| 3650 | + queue!( |
| 3660 | 3651 | self.stdout, |
| 3661 | 3652 | MoveTo(start_col as u16, start_row + 5), |
| 3662 | 3653 | SetForegroundColor(Color::Cyan), |
@@ -3664,7 +3655,7 @@ impl Screen { |
| 3664 | 3655 | SetForegroundColor(Color::White), |
| 3665 | 3656 | Print(" Installation:"), |
| 3666 | 3657 | )?; |
| 3667 | | - execute!( |
| 3658 | + queue!( |
| 3668 | 3659 | self.stdout, |
| 3669 | 3660 | Print(" ".repeat(panel_width - 16)), |
| 3670 | 3661 | SetForegroundColor(Color::Cyan), |
@@ -3681,7 +3672,7 @@ impl Screen { |
| 3681 | 3672 | } else { |
| 3682 | 3673 | line.to_string() |
| 3683 | 3674 | }; |
| 3684 | | - execute!( |
| 3675 | + queue!( |
| 3685 | 3676 | self.stdout, |
| 3686 | 3677 | MoveTo(start_col as u16, row), |
| 3687 | 3678 | SetForegroundColor(Color::Cyan), |
@@ -3690,7 +3681,7 @@ impl Screen { |
| 3690 | 3681 | Print(format!(" {}", display_line)), |
| 3691 | 3682 | )?; |
| 3692 | 3683 | let line_pad = panel_width - 5 - display_line.len(); |
| 3693 | | - execute!( |
| 3684 | + queue!( |
| 3694 | 3685 | self.stdout, |
| 3695 | 3686 | Print(" ".repeat(line_pad)), |
| 3696 | 3687 | SetForegroundColor(Color::Cyan), |
@@ -3702,7 +3693,7 @@ impl Screen { |
| 3702 | 3693 | // Fill remaining instruction lines if less than 3 |
| 3703 | 3694 | for i in instr_lines.len()..3 { |
| 3704 | 3695 | let row = start_row + 6 + i as u16; |
| 3705 | | - execute!( |
| 3696 | + queue!( |
| 3706 | 3697 | self.stdout, |
| 3707 | 3698 | MoveTo(start_col as u16, row), |
| 3708 | 3699 | SetForegroundColor(Color::Cyan), |
@@ -3714,7 +3705,7 @@ impl Screen { |
| 3714 | 3705 | } |
| 3715 | 3706 | |
| 3716 | 3707 | // Blank line |
| 3717 | | - execute!( |
| 3708 | + queue!( |
| 3718 | 3709 | self.stdout, |
| 3719 | 3710 | MoveTo(start_col as u16, start_row + 9), |
| 3720 | 3711 | SetForegroundColor(Color::Cyan), |
@@ -3725,7 +3716,7 @@ impl Screen { |
| 3725 | 3716 | )?; |
| 3726 | 3717 | |
| 3727 | 3718 | // Status or help line |
| 3728 | | - execute!( |
| 3719 | + queue!( |
| 3729 | 3720 | self.stdout, |
| 3730 | 3721 | MoveTo(start_col as u16, start_row + 10), |
| 3731 | 3722 | SetForegroundColor(Color::Cyan), |
@@ -3733,22 +3724,22 @@ impl Screen { |
| 3733 | 3724 | )?; |
| 3734 | 3725 | |
| 3735 | 3726 | if panel.copied_to_clipboard { |
| 3736 | | - execute!( |
| 3727 | + queue!( |
| 3737 | 3728 | self.stdout, |
| 3738 | 3729 | SetForegroundColor(Color::Green), |
| 3739 | 3730 | Print(" ✓ Copied to clipboard!"), |
| 3740 | 3731 | )?; |
| 3741 | | - execute!(self.stdout, Print(" ".repeat(panel_width - 26)))?; |
| 3732 | + queue!(self.stdout, Print(" ".repeat(panel_width - 26)))?; |
| 3742 | 3733 | } else { |
| 3743 | | - execute!( |
| 3734 | + queue!( |
| 3744 | 3735 | self.stdout, |
| 3745 | 3736 | SetForegroundColor(Color::DarkGrey), |
| 3746 | 3737 | Print(" [C] Copy to clipboard [Esc] Close"), |
| 3747 | 3738 | )?; |
| 3748 | | - execute!(self.stdout, Print(" ".repeat(panel_width - 38)))?; |
| 3739 | + queue!(self.stdout, Print(" ".repeat(panel_width - 38)))?; |
| 3749 | 3740 | } |
| 3750 | 3741 | |
| 3751 | | - execute!( |
| 3742 | + queue!( |
| 3752 | 3743 | self.stdout, |
| 3753 | 3744 | SetForegroundColor(Color::Cyan), |
| 3754 | 3745 | Print("│"), |
@@ -3756,7 +3747,7 @@ impl Screen { |
| 3756 | 3747 | )?; |
| 3757 | 3748 | |
| 3758 | 3749 | // Bottom border |
| 3759 | | - execute!( |
| 3750 | + queue!( |
| 3760 | 3751 | self.stdout, |
| 3761 | 3752 | MoveTo(start_col as u16, start_row + 11), |
| 3762 | 3753 | SetForegroundColor(Color::Cyan), |
@@ -3771,15 +3762,12 @@ impl Screen { |
| 3771 | 3762 | |
| 3772 | 3763 | /// Render the integrated terminal panel |
| 3773 | 3764 | pub fn render_terminal(&mut self, terminal: &TerminalPanel, left_offset: u16) -> Result<()> { |
| 3774 | | - // Hide cursor during render to prevent flicker |
| 3775 | | - execute!(self.stdout, Hide)?; |
| 3776 | | - |
| 3777 | 3765 | let start_row = terminal.render_start_row(self.rows); |
| 3778 | 3766 | let height = terminal.height; |
| 3779 | 3767 | let terminal_width = self.cols.saturating_sub(left_offset) as usize; |
| 3780 | 3768 | |
| 3781 | 3769 | // Draw terminal border (top line with title) |
| 3782 | | - execute!( |
| 3770 | + queue!( |
| 3783 | 3771 | self.stdout, |
| 3784 | 3772 | MoveTo(left_offset, start_row), |
| 3785 | 3773 | SetBackgroundColor(Color::AnsiValue(237)), |
@@ -3797,7 +3785,7 @@ impl Screen { |
| 3797 | 3785 | .unwrap_or_else(|| "Terminal".to_string()); |
| 3798 | 3786 | let title = format!(" {} ", name); |
| 3799 | 3787 | let separator = "─".repeat(terminal_width.saturating_sub(title.len() + 2) / 2); |
| 3800 | | - execute!( |
| 3788 | + queue!( |
| 3801 | 3789 | self.stdout, |
| 3802 | 3790 | Print(&separator), |
| 3803 | 3791 | SetAttribute(Attribute::Bold), |
@@ -3811,7 +3799,7 @@ impl Screen { |
| 3811 | 3799 | // Pad to end of line |
| 3812 | 3800 | let printed = separator.chars().count() * 2 + title.len(); |
| 3813 | 3801 | if printed < terminal_width { |
| 3814 | | - execute!(self.stdout, Print(" ".repeat(terminal_width - printed)))?; |
| 3802 | + queue!(self.stdout, Print(" ".repeat(terminal_width - printed)))?; |
| 3815 | 3803 | } |
| 3816 | 3804 | } else { |
| 3817 | 3805 | // Multiple sessions: render tab bar |
@@ -3838,14 +3826,14 @@ impl Screen { |
| 3838 | 3826 | |
| 3839 | 3827 | // Set colors based on active state |
| 3840 | 3828 | if is_active { |
| 3841 | | - execute!( |
| 3829 | + queue!( |
| 3842 | 3830 | self.stdout, |
| 3843 | 3831 | SetBackgroundColor(Color::AnsiValue(238)), |
| 3844 | 3832 | SetForegroundColor(Color::White), |
| 3845 | 3833 | SetAttribute(Attribute::Bold), |
| 3846 | 3834 | )?; |
| 3847 | 3835 | } else { |
| 3848 | | - execute!( |
| 3836 | + queue!( |
| 3849 | 3837 | self.stdout, |
| 3850 | 3838 | SetBackgroundColor(Color::AnsiValue(235)), |
| 3851 | 3839 | SetForegroundColor(Color::AnsiValue(245)), |
@@ -3857,7 +3845,7 @@ impl Screen { |
| 3857 | 3845 | let padding = tab_width.saturating_sub(tab_content.len()); |
| 3858 | 3846 | let left_pad = padding / 2; |
| 3859 | 3847 | let right_pad = padding - left_pad; |
| 3860 | | - execute!( |
| 3848 | + queue!( |
| 3861 | 3849 | self.stdout, |
| 3862 | 3850 | Print(" ".repeat(left_pad)), |
| 3863 | 3851 | Print(&tab_content), |
@@ -3867,7 +3855,7 @@ impl Screen { |
| 3867 | 3855 | |
| 3868 | 3856 | // Separator between tabs |
| 3869 | 3857 | if i < session_count - 1 { |
| 3870 | | - execute!( |
| 3858 | + queue!( |
| 3871 | 3859 | self.stdout, |
| 3872 | 3860 | SetBackgroundColor(Color::AnsiValue(237)), |
| 3873 | 3861 | SetForegroundColor(Color::AnsiValue(240)), |
@@ -3880,7 +3868,7 @@ impl Screen { |
| 3880 | 3868 | |
| 3881 | 3869 | // Fill remaining space |
| 3882 | 3870 | if printed < available_width { |
| 3883 | | - execute!( |
| 3871 | + queue!( |
| 3884 | 3872 | self.stdout, |
| 3885 | 3873 | SetBackgroundColor(Color::AnsiValue(237)), |
| 3886 | 3874 | SetForegroundColor(Color::White), |
@@ -3902,14 +3890,14 @@ impl Screen { |
| 3902 | 3890 | let mut current_underline = false; |
| 3903 | 3891 | |
| 3904 | 3892 | // Set initial colors |
| 3905 | | - execute!( |
| 3893 | + queue!( |
| 3906 | 3894 | self.stdout, |
| 3907 | 3895 | SetBackgroundColor(default_bg), |
| 3908 | 3896 | SetForegroundColor(default_fg) |
| 3909 | 3897 | )?; |
| 3910 | 3898 | |
| 3911 | 3899 | for row in 0..(height - 1) { |
| 3912 | | - execute!(self.stdout, MoveTo(left_offset, start_row + 1 + row))?; |
| 3900 | + queue!(self.stdout, MoveTo(left_offset, start_row + 1 + row))?; |
| 3913 | 3901 | |
| 3914 | 3902 | // Build a string of characters with same attributes to batch print |
| 3915 | 3903 | let mut batch = String::new(); |
@@ -3946,30 +3934,30 @@ impl Screen { |
| 3946 | 3934 | if !batch.is_empty() { |
| 3947 | 3935 | // Apply batch attributes if different from current |
| 3948 | 3936 | if batch_fg != current_fg { |
| 3949 | | - execute!(self.stdout, SetForegroundColor(batch_fg))?; |
| 3937 | + queue!(self.stdout, SetForegroundColor(batch_fg))?; |
| 3950 | 3938 | current_fg = batch_fg; |
| 3951 | 3939 | } |
| 3952 | 3940 | if batch_bg != current_bg { |
| 3953 | | - execute!(self.stdout, SetBackgroundColor(batch_bg))?; |
| 3941 | + queue!(self.stdout, SetBackgroundColor(batch_bg))?; |
| 3954 | 3942 | current_bg = batch_bg; |
| 3955 | 3943 | } |
| 3956 | 3944 | if batch_bold != current_bold { |
| 3957 | 3945 | if batch_bold { |
| 3958 | | - execute!(self.stdout, SetAttribute(Attribute::Bold))?; |
| 3946 | + queue!(self.stdout, SetAttribute(Attribute::Bold))?; |
| 3959 | 3947 | } else { |
| 3960 | | - execute!(self.stdout, SetAttribute(Attribute::NoBold))?; |
| 3948 | + queue!(self.stdout, SetAttribute(Attribute::NoBold))?; |
| 3961 | 3949 | } |
| 3962 | 3950 | current_bold = batch_bold; |
| 3963 | 3951 | } |
| 3964 | 3952 | if batch_underline != current_underline { |
| 3965 | 3953 | if batch_underline { |
| 3966 | | - execute!(self.stdout, SetAttribute(Attribute::Underlined))?; |
| 3954 | + queue!(self.stdout, SetAttribute(Attribute::Underlined))?; |
| 3967 | 3955 | } else { |
| 3968 | | - execute!(self.stdout, SetAttribute(Attribute::NoUnderline))?; |
| 3956 | + queue!(self.stdout, SetAttribute(Attribute::NoUnderline))?; |
| 3969 | 3957 | } |
| 3970 | 3958 | current_underline = batch_underline; |
| 3971 | 3959 | } |
| 3972 | | - execute!(self.stdout, Print(&batch))?; |
| 3960 | + queue!(self.stdout, Print(&batch))?; |
| 3973 | 3961 | batch.clear(); |
| 3974 | 3962 | } |
| 3975 | 3963 | batch_fg = fg; |
@@ -3983,38 +3971,37 @@ impl Screen { |
| 3983 | 3971 | // Flush remaining batch for this row |
| 3984 | 3972 | if !batch.is_empty() { |
| 3985 | 3973 | if batch_fg != current_fg { |
| 3986 | | - execute!(self.stdout, SetForegroundColor(batch_fg))?; |
| 3974 | + queue!(self.stdout, SetForegroundColor(batch_fg))?; |
| 3987 | 3975 | current_fg = batch_fg; |
| 3988 | 3976 | } |
| 3989 | 3977 | if batch_bg != current_bg { |
| 3990 | | - execute!(self.stdout, SetBackgroundColor(batch_bg))?; |
| 3978 | + queue!(self.stdout, SetBackgroundColor(batch_bg))?; |
| 3991 | 3979 | current_bg = batch_bg; |
| 3992 | 3980 | } |
| 3993 | 3981 | if batch_bold != current_bold { |
| 3994 | 3982 | if batch_bold { |
| 3995 | | - execute!(self.stdout, SetAttribute(Attribute::Bold))?; |
| 3983 | + queue!(self.stdout, SetAttribute(Attribute::Bold))?; |
| 3996 | 3984 | } else { |
| 3997 | | - execute!(self.stdout, SetAttribute(Attribute::NoBold))?; |
| 3985 | + queue!(self.stdout, SetAttribute(Attribute::NoBold))?; |
| 3998 | 3986 | } |
| 3999 | 3987 | current_bold = batch_bold; |
| 4000 | 3988 | } |
| 4001 | 3989 | if batch_underline != current_underline { |
| 4002 | 3990 | if batch_underline { |
| 4003 | | - execute!(self.stdout, SetAttribute(Attribute::Underlined))?; |
| 3991 | + queue!(self.stdout, SetAttribute(Attribute::Underlined))?; |
| 4004 | 3992 | } else { |
| 4005 | | - execute!(self.stdout, SetAttribute(Attribute::NoUnderline))?; |
| 3993 | + queue!(self.stdout, SetAttribute(Attribute::NoUnderline))?; |
| 4006 | 3994 | } |
| 4007 | 3995 | current_underline = batch_underline; |
| 4008 | 3996 | } |
| 4009 | | - execute!(self.stdout, Print(&batch))?; |
| 3997 | + queue!(self.stdout, Print(&batch))?; |
| 4010 | 3998 | } |
| 4011 | 3999 | } |
| 4012 | 4000 | |
| 4013 | | - // Position cursor in terminal (offset by left_offset) |
| 4014 | | - execute!( |
| 4001 | + // Position cursor in terminal (offset by left_offset, but don't show - caller handles that) |
| 4002 | + queue!( |
| 4015 | 4003 | self.stdout, |
| 4016 | 4004 | MoveTo(left_offset + cursor_col, start_row + 1 + cursor_row), |
| 4017 | | - Show, |
| 4018 | 4005 | ResetColor |
| 4019 | 4006 | )?; |
| 4020 | 4007 | |