Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

Commit

Permalink
Ignore errors when setting norelativenumber.
Browse files Browse the repository at this point in the history
This avoids an error message with vim versions < 7.3, which don't
support the relativenumber option.
  • Loading branch information
ab committed Nov 2, 2011
1 parent e7c4cf4 commit ca79cab
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions plugin/vimroom.vim
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,14 @@ function! <SID>VimroomToggle()
setlocal noma
setlocal nocursorline
setlocal nonumber
if exists("&relativenumber")
setlocal norelativenumber
endif
silent! setlocal norelativenumber
wincmd l
" Create the right sidebar
exec( "silent rightbelow " . s:sidebar . "vsplit new" )
setlocal noma
setlocal nocursorline
setlocal nonumber
if exists("&relativenumber")
setlocal norelativenumber
endif
silent! setlocal norelativenumber
wincmd h
endif
if g:vimroom_sidebar_height
Expand All @@ -202,28 +198,22 @@ function! <SID>VimroomToggle()
setlocal noma
setlocal nocursorline
setlocal nonumber
if exists("&relativenumber")
setlocal norelativenumber
endif
silent! setlocal norelativenumber
wincmd j
" Create the bottom sidebar
exec( "silent rightbelow " . g:vimroom_sidebar_height . "split new" )
setlocal noma
setlocal nocursorline
setlocal nonumber
if exists("&relativenumber")
setlocal norelativenumber
endif
silent! setlocal norelativenumber
wincmd k
endif
" Setup wrapping, line breaking, and push the cursor down
set wrap
set linebreak
if g:vimroom_clear_line_numbers
set nonumber
if exists('&relativenumber')
set norelativenumber
endif
silent! set norelativenumber
endif
if s:save_textwidth != ""
exec( "set textwidth=".g:vimroom_width )
Expand Down

0 comments on commit ca79cab

Please sign in to comment.