summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-05-10 17:43:42 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-05-18 17:08:36 +0900
commit685fb71d8953189e36375b822c8d8e1293736128 (patch)
tree3764111ff241f79c7fdc3c55324aec8c88daa3ec /plugin
parent83b603390683d49ff75b72d142b4dba4b5186d73 (diff)
downloadfzf-685fb71d8953189e36375b822c8d8e1293736128.tar.gz
[vim] Use native --tmux option instead of fzf-tmux when possible
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim20
1 files changed, 11 insertions, 9 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 51ed1388..eee5e9c4 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -573,19 +573,21 @@ function! s:fzf_tmux(dict)
if empty(size)
for o in ['up', 'down', 'left', 'right']
if s:present(a:dict, o)
- let spec = a:dict[o]
- if (o == 'up' || o == 'down') && spec[0] == '~'
- let size = '-'.o[0].s:calc_size(&lines, spec, a:dict)
- else
- " Legacy boolean option
- let size = '-'.o[0].(spec == 1 ? '' : substitute(spec, '^\~', '', ''))
- endif
+ let size = o . ',' . a:dict[o]
break
endif
endfor
endif
- return printf('LINES=%d COLUMNS=%d %s %s %s --',
- \ &lines, &columns, fzf#shellescape(s:fzf_tmux), size, (has_key(a:dict, 'source') ? '' : '-'))
+
+ " Legacy fzf-tmux options
+ if size =~ '-'
+ return printf('LINES=%d COLUMNS=%d %s %s %s --',
+ \ &lines, &columns, fzf#shellescape(s:fzf_tmux), size, (has_key(a:dict, 'source') ? '' : '-'))
+ end
+
+ " Using native --tmux option
+ let in = (has_key(a:dict, 'source') ? '' : ' < /dev/tty')
+ return printf('%s --tmux %s%s', fzf#shellescape(fzf#exec()), size, in)
endfunction
function! s:splittable(dict)