Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@joelim-work
Copy link
Collaborator

@joelim-work joelim-work commented Oct 23, 2023

This seems like a nice feature to have, I guess nobody got around to actually implementing this.

tcell.EventResize events will eventually call the redraw command, and I think it might be useful to apply the hook on redraws as opposed to resizes, for instance if the user wants to trigger the hook manually using <c-l>.

Below is an example, which even triggers upon startup:

cmd on-redraw %{{
    if [ $lf_width -le 80 ]; then
        lf -remote "send $id set ratios 1:2"
    elif [ $lf_width -le 160 ]; then
        lf -remote "send $id set ratios 1:2:3"
    else
        lf -remote "send $id set ratios 1:2:3:5"
    fi
}}

@joelim-work joelim-work merged commit b3cb2dc into gokcehan:master Oct 29, 2023
@joelim-work joelim-work deleted the on-redraw branch October 29, 2023 22:40
@gokcehan gokcehan mentioned this pull request Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep leftmost columns at constant width/execute script on window resize?

2 participants