Skip to content
Myr

Use -p option of split-window instead of manual calculation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 1a100a2 · Browse files · 2 files+14 added−18 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−18 removed

  • other:+14 added−18 removed

2 files+14 added−18 removed

modified:plugin/fzf.vim+4 added-8 removed
113 unmodified lines
114 else115 let command = a:command116 endif117118 if type(a:dict.tmux) == 1119 if a:dict.tmux =~ '%$'120 let height = &lines * str2nr(a:dict.tmux[0:-2]) / 100121 else122 let height = str2nr(a:dict.tmux)123 endif118 if type(a:dict.tmux) == 1 && a:dict.tmux =~ '%$'119 let height = '-p '.a:dict.tmux[0:-2]120 else125 let height = a:dict.tmux121 let height = '-l '.a:dict.tmux122 endif123124 let s:pane = substitute(125 \ system(126 \ printf(131 \ 'tmux split-window -l %d -P -F "#{pane_id}" %s',127 \ 'tmux split-window %s -P -F "#{pane_id}" %s',128 \ height, s:shellesc(command))), '\n', '', 'g')129 let s:dict = a:dict130 let s:temps = a:temps131
63 unmodified lines
modified:install+10 added-10 removed
113 unmodified lines
114 eval "$__fsel"115}116117__fsel_tmux() {118 local height lines118 local height119 height=${FZF_TMUX_HEIGHT:-40%}120 lines=${LINES:-40}120 if [[ $height =~ %$ ]]; then122 height=${height:0:${#height}-1}123 height=$(( height * lines / 100 ))121 height="-p ${height%\%}"122 else123 height="-l $height"124 fi125 tmux split-window -l $height "tmux send-keys -t $TMUX_PANE \"\$($__fsel)\""125 tmux split-window $height "tmux send-keys -t $TMUX_PANE \"\$($__fsel)\""126}127128__fcd() {129 local dir
58 unmodified lines
188EOF189190if [ -n "$TMUX_PANE" -a ${FZF_TMUX:-1} -ne 0 -a ${LINES:-40} -gt 15 ]; then191 fzf-file-widget() {192 local height lines192 local height193 height=${FZF_TMUX_HEIGHT:-40%}194 lines=${LINES:-40}194 if [[ $height =~ %$ ]]; then196 height=${height:0:${#height}-1}197 height=$(( height * lines / 100 ))195 height="-p ${height%\%}"196 else197 height="-l $height"198 fi199 tmux split-window -l $height "tmux send-keys -t $TMUX_PANE \"\$($__fsel)\""199 tmux split-window $height "tmux send-keys -t $TMUX_PANE \"\$($__fsel)\""200 }201else202 fzf-file-widget() {203 LBUFFER="${LBUFFER%% #}$(eval "$__fsel")"
57 unmodified lines