[PATCH 1/2] [gdb/tui] Allow command window of 1 or 2 lines

Tom de Vries tdevries@suse.de
Mon Nov 13 20:20:47 GMT 2023


On 11/13/23 18:36, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> +  /* Compute the minimum height of this window.  */
> Tom> +  virtual int min_height () const override
> Tom> +  {
> Tom> +    int preferred_min = tui_win_info::min_height ();
> Tom> +    int max = max_height ();
> Tom> +    /* If there is enough space to accommodate the preferred minimum height,
> Tom> +       use it.  Otherwise, use as much as possible.  */
> Tom> +    return (preferred_min <= max
> Tom> +	    ? preferred_min
> Tom> +	    : max);
> 
> I read this and was wondering if this will make the command window
> ignore the weight given to it in the layout.


The current minimum height of the command window is 
tui_win_info::min_height () == 3.

A weight can only make the size larger, not smaller than the minimum size.

This patch only has effect for the case that the terminal size is 
smaller than 3, so my understanding is that weight in this case is 
likewise inconsequential.

Thanks,
- Tom


More information about the Gdb-patches mailing list