Permalink
Browse files

Remove special comment handling

Comments seem to be handled fine without it, except their behaviour
matches the new backspacing behaviour -- when the user backspaces after
a comment line, their indentation is preserved when they hit "Enter".
  • Loading branch information...
1 parent 0461bc5 commit 04bad864035c14679976db7d7efaa016c85067b0 @AndrewRadev committed Aug 4, 2012
Showing with 1 addition and 18 deletions.
  1. +1 −18 indent/coffee.vim
View
@@ -184,17 +184,7 @@ endfunction
" Get the nearest previous line that isn't a comment.
function! s:GetPrevNormalLine(startlinenum)
- let curlinenum = a:startlinenum
-
- while curlinenum
- let curlinenum = prevnonblank(curlinenum - 1)
-
- if !s:IsCommentLine(curlinenum)
- return curlinenum
- endif
- endwhile
-
- return 0
+ return prevnonblank(a:startlinenum - 1)
endfunction
" Try to find a comment in a line.
@@ -243,13 +233,6 @@ function! GetCoffeeIndent(curlinenum)
return -1
endif
- let prevlinenum = a:curlinenum - 1
-
- " If continuing a comment, keep the indent level.
- if s:IsCommentLine(prevlinenum)
- return indent(prevlinenum)
- endif
-
let prevlinenum = s:GetPrevNormalLine(a:curlinenum)
" Don't do anything if there's no code before.

0 comments on commit 04bad86

Please sign in to comment.