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'`.
22 lines
572 B
VimL
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
|