vim/autoload/tmux.vim
Kenneth Benzie (Benie) d7c1bdd27c Fix bug in #tmux#isOption()
Actually use `a:option` instead of `'set-clipboard'` string when
comparing the tmux option value. This hasn't been an issue because the
only use of the function happens to be checking the value of
`'set-clipboard'`.
2021-12-16 23:06:03 +00:00

22 lines
572 B
VimL

let s:tmux_option = '@vim'.substitute($TMUX_PANE, '%', '\\%', 'g')
function! tmux#inSession() abort
return $TMUX !=# ''
endfunction
function! tmux#setNavigationFlag() abort
call system('tmux set-window-option '.s:tmux_option.' 1')
endfunction
function! tmux#unsetNavigationFlag() abort
call system('tmux set-window-option -u '.s:tmux_option)
endfunction
function! tmux#isOption(option, value) abort
if !tmux#inSession()
return 0
endif
let l:option = trim(system('tmux show-options -g '.a:option))
return l:option ==# a:option.' '.a:value
endfunction