File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2536,7 +2536,7 @@ impl App {
25362536 ( vec ! [ String :: new( ) ] , 0 , 0 , Vec :: new ( ) )
25372537 } ;
25382538 let input_height = if self . command_panel . input_active {
2539- ( formatted_lines. len ( ) as u16 ) . max ( 1 ) . min ( 8 )
2539+ ( formatted_lines. len ( ) as u16 ) . clamp ( 1 , 8 )
25402540 } else {
25412541 1
25422542 } ;
Original file line number Diff line number Diff line change @@ -437,8 +437,8 @@ impl CommandPanel {
437437 let prefix_end = self . cursor_pos - partial. len ( ) ;
438438 let suffix = & self . input_buffer [ self . cursor_pos ..] ;
439439 // Skip the auto-inserted ')' since we're adding our own
440- let suffix = if suffix. starts_with ( ')' ) {
441- suffix [ 1 .. ] . to_string ( )
440+ let suffix = if let Some ( stripped ) = suffix. strip_prefix ( ')' ) {
441+ stripped . to_string ( )
442442 } else {
443443 suffix. to_string ( )
444444 } ;
@@ -854,11 +854,7 @@ impl CommandPanel {
854854 current_line = String :: new ( ) ;
855855 } else {
856856 // Closing paren for a child filter — stays on same line
857- let row = if current_line. is_empty ( ) {
858- lines. len ( )
859- } else {
860- lines. len ( )
861- } ;
857+ let row = lines. len ( ) ;
862858 let col = current_line. len ( ) ;
863859 cursor_map. push ( ( row, col) ) ;
864860 current_line. push ( ch) ;
@@ -1216,7 +1212,7 @@ impl Component for CommandPanel {
12161212 } else {
12171213 ( vec ! [ String :: new( ) ] , 0 , 0 , Vec :: new ( ) )
12181214 } ;
1219- let input_height = ( formatted_lines. len ( ) as u16 ) . max ( 1 ) . min ( 8 ) ;
1215+ let input_height = ( formatted_lines. len ( ) as u16 ) . clamp ( 1 , 8 ) ;
12201216
12211217 // Layout: messages (flex) | input area (dynamic height)
12221218 let layout =
You can’t perform that action at this time.
0 commit comments