Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-23 Thread NRK
On Wed, Mar 23, 2022 at 11:13:00AM +0100, Stein Gunnar Bakkeby wrote: > Regarding the first patch I got the impression that the overflow should be > triggered if (ew + tmpw > w) { You're correct. I forgot to mention, but that was another bug I have fixed locally. > For the second patch I am not

Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-23 Thread Stein Gunnar Bakkeby
Hi NRK, I have gone through these patches again and they seem pretty solid. Regarding the first patch I got the impression that the overflow should be triggered if (ew + tmpw > w) { The reasoning is that it appears to crop 4 characters instead of 3 when it adds the ellipsis. If we try a long

Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-23 Thread NRK
On Wed, Mar 23, 2022 at 09:13:52AM +0100, Hiltjo Posthuma wrote: > Please continue working on this patch, it is appreciated. > When it mostly works it can be put into libsl and dmenu and dwm. > > If possible please make the first iteration compatible with the current API. > This would make

Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-23 Thread Hiltjo Posthuma
On Wed, Mar 23, 2022 at 12:26:24AM +0600, NRK wrote: > On Tue, Mar 22, 2022 at 06:06:30PM +0100, Stein Gunnar Bakkeby wrote: > > With the first patch the text is still allowed to bleed into the right hand > > side padding as long as it fits. > > > > I worked around that by reducing w with 2 *

Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-22 Thread NRK
On Tue, Mar 22, 2022 at 06:06:30PM +0100, Stein Gunnar Bakkeby wrote: > With the first patch the text is still allowed to bleed into the right hand > side padding as long as it fits. > > I worked around that by reducing w with 2 * lpad and adding lpad to x > before returning. Ahh, sorry my bad.

Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-22 Thread NRK
On Tue, Mar 22, 2022 at 06:06:30PM +0100, Stein Gunnar Bakkeby wrote: > With the first patch the text is still allowed to bleed into the right hand > side padding as long as it fits. > > I worked around that by reducing w with 2 * lpad and adding lpad to x > before returning. Yeah, that's what

Re: [hackers] [dmenu][PATCHes] Fix truncation issues and improve performance

2022-03-22 Thread Stein Gunnar Bakkeby
With the first patch the text is still allowed to bleed into the right hand side padding as long as it fits. I worked around that by reducing w with 2 * lpad and adding lpad to x before returning. Overall it makes sense. I'd assume the code in dwm would be identical. I was thinking that the