Skip to content
Browse files

Don't indent after regexes at the end of lines (#63)

  • Loading branch information...
1 parent 74e2adc commit 0e1246a52d1c1b671cee9dab56cc806d881c2776 @kchmck committed Nov 14, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 indent/coffee.vim
View
10 indent/coffee.vim
@@ -274,6 +274,16 @@ function! s:GetCoffeeIndent(curlinenum)
" Indent after a continuation if it's the first.
if prevline =~ s:CONTINUATION
+ " If the line ends in a slash, make sure it isn't a regex.
+ if prevline =~ '/$'
+ " Move to the line so we can get the last column.
+ call cursor(prevlinenum)
+
+ if s:IsString(prevlinenum, col('$') - 1)
+ return -1
+ endif
+ endif
+
let prevprevlinenum = s:GetPrevNormalLine(prevlinenum)
" If the continuation is the first in the file, don't run the other checks.

0 comments on commit 0e1246a

Please sign in to comment.
Something went wrong with that request. Please try again.