Cloudef / bemenu

Dynamic menu library and client program inspired by dmenu
GNU General Public License v3.0
1.16k stars 90 forks source link

Add new flag --auto-select: when there is only one entry left, automaticallty select it #357

Closed gesellkammer closed 9 months ago

gesellkammer commented 9 months ago

This PR fixes --accept-single, see #335

Cloudef commented 9 months ago

I think there's confusion what accept-single is supposed to do. The accept-single is supposed to return immediately if there's only one item in the list, this seems to change the behavior that accept-single returns immediately if filter out the list enough that there remains only one item.

gesellkammer commented 9 months ago

I thought accept single was the pendant to dmenu's "instant" patch or rofi's auto select. If this is not the case, would you consider adding such an option?

On Wed, Sep 27, 2023, 02:53 Jari Vetoniemi @.***> wrote:

I think there's confusion what accept-single is supposed to do. The accept-single is supposed to return immediately if there's only one item in the list, this seems to change the behavior that accept-single returns immediately if filter out the list enough that there remains only one item.

— Reply to this email directly, view it on GitHub https://github.com/Cloudef/bemenu/pull/357#issuecomment-1736496515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAT3NGQUULO5LXXZJMH2C3X4N2HJANCNFSM6AAAAAA5HR2TYA . You are receiving this because you authored the thread.Message ID: @.***>

Cloudef commented 9 months ago

Yes that kind of behavior would be a new option

gesellkammer commented 9 months ago

Would you accept a patch which implements that functionality under the flag "--accept-single", mirroring rofi's own option?

Cloudef commented 9 months ago

That would break the current expected behavior of --accept-single, patch with different flag name is okay.

Cloudef commented 9 months ago

Optional argument for --accept-single could work too as well I guess, something like "always"

gesellkammer commented 9 months ago

Reverted the behaviour of --accept-single, added a new flag --auto-select

Cloudef commented 9 months ago

Can you also document the flag in the man page, looks good otherwise

gesellkammer commented 9 months ago

Thanks

Cloudef commented 9 months ago

Looks like we hit string length limit:

error: string literal of length 4104 exceeds maximum length 4095 that ISO C99 compilers are required to support

Cloudef commented 9 months ago

Thanks