diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-10-12 23:09:21 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-10-12 23:10:21 +0900 |
commit | 053af9a1c8db1c0cc9236da305d07bf382f8e7ab (patch) | |
tree | e1a300b4ff116e7d43b1a519b4490936ad0291dc /bin | |
parent | 60112def0245d13a67137ad603acd1b6b5bf0a67 (diff) |
[fzf-tmux/vim/nvim] Do not split small window
Close #699
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fzf-tmux | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/fzf-tmux b/bin/fzf-tmux index ff923f08..1c17921d 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -17,6 +17,7 @@ swap="" close="" term="" [[ -n "$LINES" ]] && lines=$LINES || lines=$(tput lines) +[[ -n "$COLUMNS" ]] && columns=$COLUMNS || columns=$(tput cols) help() { >&2 echo 'usage: fzf-tmux [-u|-d [HEIGHT[%]]] [-l|-r [WIDTH[%]]] [--] [FZF OPTIONS] @@ -83,7 +84,7 @@ while [[ $# -gt 0 ]]; do else if [[ -n "$swap" ]]; then if [[ "$arg" =~ ^.l ]]; then - [[ -n "$COLUMNS" ]] && max=$COLUMNS || max=$(tput cols) + max=$columns else max=$lines fi @@ -108,7 +109,7 @@ while [[ $# -gt 0 ]]; do [[ -n "$skip" ]] && args+=("$arg") done -if [[ -z "$TMUX" ]] || [[ "$lines" -le 15 ]]; then +if [[ -z "$TMUX" ]] || [[ "$opt" =~ ^-h ]] && [[ "$columns" -le 40 ]] || [[ ! "$opt" =~ ^-h ]] && [[ "$lines" -le 15 ]]; then "$fzf" "${args[@]}" exit $? fi |