Skip to content
Myr

[vim] g:fzf_prefer_tmux for choosing fzf-tmux over --height

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

https://github.com/junegunn/fzf.vim/issues/296

authored by Junegunn Choi · committed by Junegunn Choi · parent 7763fdf · Browse files · 1 file+12 added−7 removed
This commit

State

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

Trailers

  • https: //github.com/junegunn/fzf.vim/issues/296

Diff stats

1 file+12 added−7 removed

  • other:+12 added−7 removed

1 file+12 added−7 removed

modified:plugin/fzf.vim+12 added-7 removed
1" Copyright (c) 2016 Junegunn Choi1" Copyright (c) 2017 Junegunn Choi2"3" MIT License4"5" Permission is hereby granted, free of charge, to any person obtaining
294 unmodified lines
300 else301 let prefix = ''302 endif303304 let prefer_tmux = get(g:, 'fzf_prefer_tmux', 0)305 let use_height = has_key(dict, 'down') &&306 \ !(has('nvim') || has('win32') || has('win64') || s:present(dict, 'up', 'left', 'right')) &&307 \ executable('tput') && filereadable('/dev/tty')307 let tmux = !use_height && (!has('nvim') || get(g:, 'fzf_prefer_tmux', 0)) && s:tmux_enabled() && s:splittable(dict)308 let term = has('nvim') && !tmux308 let use_term = has('nvim')309 let use_tmux = (!use_height && !use_term || prefer_tmux) && s:tmux_enabled() && s:splittable(dict)310 if prefer_tmux && use_tmux311 let use_height = 0312 let use_term = 0313 endif314 if use_height315 let optstr .= ' --height='.s:calc_size(&lines, dict.down, dict)311 elseif term316 elseif use_term317 let optstr .= ' --no-height'318 endif314 let command = prefix.(tmux ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result319 let command = prefix.(use_tmux ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result320316 if term321 if use_term322 return s:execute_term(dict, command, temps)323 endif324320 let lines = tmux ? s:execute_tmux(dict, command, temps)325 let lines = use_tmux ? s:execute_tmux(dict, command, temps)326 \ : s:execute(dict, command, use_height, temps)327 call s:callback(dict, lines)328 return lines329finally
339 unmodified lines