diff --git a/doc/togglecursor.txt b/doc/togglecursor.txt index 0206db4..7149769 100644 --- a/doc/togglecursor.txt +++ b/doc/togglecursor.txt @@ -68,21 +68,11 @@ g:togglecursor_force Force togglecursor to use a particular mechanism to uses the DESCCUSR escape sequence) and 'cursorshape' (what Konsole uses). - *togglecursor_disable_tmux* + *togglecursor_enable_tmux_escaping* -In some versions of tmux, the passthrough handling appears to be slightly -broken. When you are on the last line of a short file, and delete a line with -'dd', tmux appears to insert an extra line into the mix and distorts the -terminal. It appears to be fixed in tmux 1.7. If you'd like to disable using -tmux passthrough support to try and change the cursor, do the following in -your vimrc: > - - let g:togglecursor_disable_tmux = 1 - -The default value for |togglecursor_disable_tmux| is 0. - -Note: options should be overridden in your vimrc. Changing them after Vim has -loaded will have little or no effect. +tmux has supported the ability to directly change the cursor for some time now. +If you're using an old version that cannot handle this, then you can enable the +old escaping behavior. This shouldn't be necessary with modern tmux. *togglecursor_disable_neovim* Note: This option is no longer supported. Neovim adopted a different mechanism diff --git a/plugin/togglecursor.vim b/plugin/togglecursor.vim index e65e033..9b98c6e 100644 --- a/plugin/togglecursor.vim +++ b/plugin/togglecursor.vim @@ -40,8 +40,6 @@ let s:xterm_blinking_block = "\[0 q" let s:xterm_blinking_line = "\[5 q" let s:xterm_blinking_underline = "\[3 q" -let s:in_tmux = exists("$TMUX") - " Detect whether this version of vim supports changing the replace cursor " natively. let s:sr_supported = exists("+t_SR") @@ -119,10 +117,17 @@ if !exists("g:togglecursor_leave") endif endif -if !exists("g:togglecursor_disable_tmux") - let g:togglecursor_disable_tmux = 0 +if !exists("g:togglecursor_enable_tmux_escaping") + let g:togglecursor_enable_tmux_escaping = 0 +endif + +if g:togglecursor_enable_tmux_escaping + let s:in_tmux = exists("$TMUX") +else + let s:in_tmux = 0 endif + " ------------------------------------------------------------- " Functions " ------------------------------------------------------------- @@ -134,7 +139,7 @@ function! s:TmuxEscape(line) endfunction function! s:SupportedTerminal() - if s:supported_terminal == '' || (s:in_tmux && g:togglecursor_disable_tmux) + if s:supported_terminal == '' return 0 endif