Thanks Thomas for the tips! I have adjusted the code accordingly.

Regarding the args_strtonum call: I want to disallow percent <=0 and > 100.
I thought adding 1, 100 is a convenient way of doing that, and I get a "too
small/large" error when invalid values are supplied.  Is there any issue
with doing it this way?

Best,
Anindya

On Sun, Oct 6, 2019 at 3:03 PM Thomas Adam <[email protected]> wrote:

> Hi,
>
> Thanks.  Comments below:
>
> 1.  You shouldn't need to use 0U for integer definitions.
> 2.  In terms of calling args_strtonum() for percentage:  0, INT_MAX
> should be OK, rather than 1, 100, no?
> 3.  When you're resizing in either L/R or U/D, the layout cells are
> either LEFTRIGHT or TOPBOTTOM.  Rather than embed your percentage
> check in all of the if statements that check for 'L', 'R', etc., you
> can pull this check out to the top, something like:
>
> if (layout == LAYOUT_TOPBOTTOM)
>     adjust = (wp->sy * percentage) / 100
> else
>     adjust = (wp->sx * percentage) / 100
>
> I'm sure you get the idea.
>
> Kindly,
> Thomas
>
> On Sun, 6 Oct 2019 at 20:56, Anindya Mukherjee <[email protected]>
> wrote:
> >
> > Hi, I have been playing with adding a percent option to resize-pane.
> It's on the todo list (small things) for tmux, and I find it very useful.
> Right now it's working for me but being new to tmux code I would love to
> have some eyes on it. I have attached my changes.
> >
> > If this is worthwhile/useful then I can do it properly via github. In
> that case any advice on the proper procedure is welcome!
> >
> > Anindya
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "tmux-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> > To view this discussion on the web, visit
> https://groups.google.com/d/msgid/tmux-users/CAN%2Bi5iO9yh4TSNJ_r7397%2BCwW55%2BwHqDOs20CBYpFmoXeZfHTA%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/CAN%2Bi5iPWPCLnywRnMZfp%3DOR4kJ785teWC5WaYQDc%3DbYiaFSYqg%40mail.gmail.com.

Reply via email to