From acf59a45075d26c9c3b42e6633ea9ec0b75d6b4b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 5 Dec 2013 10:55:23 +0900 Subject: [PATCH] Fix #7 - Vim 7.0 compatibility (relativenumber, colorcolumn) --- plugin/goyo.vim | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/plugin/goyo.vim b/plugin/goyo.vim index d7dc87e..56066f5 100644 --- a/plugin/goyo.vim +++ b/plugin/goyo.vim @@ -46,8 +46,13 @@ function! s:init_pad(command) execute a:command setlocal buftype=nofile bufhidden=wipe nomodifiable nobuflisted noswapfile - \ nonu nornu nocursorline colorcolumn= - \ winfixwidth winfixheight statusline=\ + \ nonu nocursorline winfixwidth winfixheight statusline=\ + if exists('&rnu') + setlocal nornu + endif + if exists('&colorcolumn') + setlocal colorcolumn= + endif let bufnr = winbufnr(0) execute winnr('#') . 'wincmd w' @@ -153,9 +158,16 @@ function! s:goyo_on(width) endif if !get(g:, 'goyo_linenr', 0) - set nonu nornu + setlocal nonu + if exists('&rnu') + setlocal nornu + endif endif - set colorcolumn= + if exists('&colorcolumn') + setlocal colorcolumn= + endif + + " Global options set winwidth=1 set winheight=1 set laststatus=0