From 87e3232780fccfb864264943971d00c1ee58c5b4 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sat, 15 Oct 2022 18:56:26 +0200 Subject: [PATCH] zsh:glog: Require 152 columns for preview on right This seem to make more sense especially for smaller terminals where the previous formula would have resulted in both sides being unreadable. --- .config/zsh/autoload/git/glog | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.config/zsh/autoload/git/glog b/.config/zsh/autoload/git/glog index e42b97f..123a1b5 100755 --- a/.config/zsh/autoload/git/glog +++ b/.config/zsh/autoload/git/glog @@ -104,13 +104,11 @@ local -a fzf_args=( ) # The preview-window should be placed differently depending on the dimensions of -# the terminal. -# 0.45 seems to be round about the ratio between cols and lines on my system. -# With that I get somewhat decent results with. This probably depends on the -# font and font-size of the terminal and needs to be changed potentially. +# the terminal. It should have at least 152 columns to fit a preview window on +# the right (12 hash, 50 subject, 80 patch, 10 git graph and fzf ui). local -a tty_size tty_size=(${=$(command stty size 2>/dev/null)}) -if (( ! $? )) && (( $tty_size[2] * 0.4 > $tty_size[1] )); then +if (( ! $? )) && (( $tty_size[2] > 152 )); then fzf_args+=(--preview-window=right) else fzf_args+=(--preview-window=down)