Skip to content

Commit

Permalink
Added trimming for trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed Sep 20, 2012
1 parent 82b7570 commit a5b3334
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ftplugin/ocaml/slime.vim
@@ -1,8 +1,8 @@
function! _EscapeText_ocaml(text)
" We only append ';;' to text if text
if match(a:text,';;\s*$') > -1
return [a:text]
let trimmed = substitute(a:text, '\_s*$', '', '')
if match(trimmed,';;\n*$') > -1
return [trimmed,"\n"]
else
return [a:text,";;\n"]
return [trimmed,";;\n"]
endif
endfunction

0 comments on commit a5b3334

Please sign in to comment.