Permalink
Browse files

rename HighlightExcessColums->HighlightLongLines and clean it up a bit

  • Loading branch information...
1 parent 0596fef commit 56c3bbcb2bc732aa4e6730decb6f6b2b7914a783 @scrooloose committed Jun 18, 2009
Showing with 7 additions and 8 deletions.
  1. +7 −8 vimrc
View
15 vimrc
@@ -228,15 +228,14 @@ function! SetCursorPosition()
end
endfunction
-"define :HighlightExcessColumns command to highlight the offending parts of
-"lines that are "too long". where "too long" is defined by &textwidth or an
-"arg passed to the command
-command! -nargs=? HighlightExcessColumns call s:HighlightExcessColumns('<args>')
-function! s:HighlightExcessColumns(width)
- let targetWidth = a:width != '' ? a:width : &textwidth
+"define :HighlightLongLines command to highlight the offending parts of
+"lines that are longer than the specified length (defaulting to 80)
+command! -nargs=? HighlightLongLines call s:HighlightLongLines('<args>')
+function! s:HighlightLongLines(width)
+ let targetWidth = a:width != '' ? a:width : 79
if targetWidth > 0
- exec 'match Todo /\%>' . (targetWidth+1) . 'v/'
+ exec 'match Todo /\%>' . (targetWidth) . 'v/'
else
- echomsg "HighlightExcessColumns: set a &textwidth, or pass one in"
+ echomsg "Usage: HighlightLongLines [natural number]"
endif
endfunction

0 comments on commit 56c3bbc

Please sign in to comment.