andreyorst / fzf.kak

FZF for Kakoune
MIT License
143 stars 33 forks source link

Can't make preview place on top #56

Closed losnappas closed 5 years ago

losnappas commented 5 years ago

Hi,

        if [ -n "${kak_client_env_TMUX}" ]; then
            preview_position="pos=right:${kak_opt_fzf_preview_width};"
            # tmux height should be changed when preview is on
            tmux_height="${kak_opt_fzf_preview_tmux_height}"
        else
            # this code chooses preview position depending on window width at runtime
            preview_position="sleep 0.1; [ \$(tput cols) -gt \$(expr \$(tput lines) \* 2) ] && pos=right:${kak_opt_fzf_preview_width} || pos=top:${kak_opt_fzf_preview_height};"
fi

https://github.com/andreyorst/fzf.kak/blob/master/rc/fzf.kak#L146 this won't let me put the preview on pos=top since I'm on tmux.

andreyorst commented 5 years ago

preview on top isn't supported because tmux is usually wider than higher. I have plans on supporting vertical split, which will use top preview position

losnappas commented 5 years ago

The preview window on the side eats a part my file paths when they're long enough. Haven't found a way to add the ellipsis on the left rather than right side, either. Pretty annoying

losnappas commented 5 years ago

Will you add, or accept a pr for, a new setting for the position? Like preview_position="pos=${kak_opt_fzf_preview_pos}:${kak_opt_fzf_preview_width};".

andreyorst commented 5 years ago

I'll add the option, but probably tomorrow or at Monday. I want to refactor some behaviors of it