diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-13 18:12:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-13 18:12:01 +0200 |
commit | 3ec574f2b549f456f664f689d6da36dc5719aeb9 (patch) | |
tree | 8aa7d766ebc0eb3919fdc678e6f48dd0a2b36673 /runtime/indent/ocaml.vim | |
parent | 2102035488e80ef6fd5038ed15d21672712ba0f6 (diff) | |
download | vim-git-3ec574f2b549f456f664f689d6da36dc5719aeb9.tar.gz |
Update runtime files.
Includes changing &sw to shiftwidth() for all indent scripts.
Diffstat (limited to 'runtime/indent/ocaml.vim')
-rw-r--r-- | runtime/indent/ocaml.vim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/indent/ocaml.vim b/runtime/indent/ocaml.vim index 3bd65c63f..8fe9de3d6 100644 --- a/runtime/indent/ocaml.vim +++ b/runtime/indent/ocaml.vim @@ -4,7 +4,7 @@ " Mike Leary <leary@nwlink.com> " Markus Mottl <markus.mottl@gmail.com> " URL: http://www.ocaml.info/vim/indent/ocaml.vim -" Last Change: 2013 Jun 29 +" Last Change: 2017 Jun 13 " 2005 Jun 25 - Fixed multiple bugs due to 'else\nreturn ind' working " 2005 May 09 - Added an option to not indent OCaml-indents specially (MM) " 2013 June - commented textwidth (Marc Weber) @@ -101,7 +101,7 @@ function! GetOCamlIndent() " Return double 'shiftwidth' after lines matching: if lline =~ '^\s*|.*->\s*$' - return ind + &sw + &sw + return ind + 2 * shiftwidth() endif let line = getline(v:lnum) @@ -172,7 +172,7 @@ function! GetOCamlIndent() " Indent if current line begins with 'and': elseif line =~ '^\s*and\>' if lline !~ '^\s*\(and\|let\|type\)\>\|\<end\s*$' - return ind - &sw + return ind - shiftwidth() endif " Indent if current line begins with 'with': @@ -199,14 +199,14 @@ function! GetOCamlIndent() " or 'method': elseif line =~ '^\s*\(constraint\|inherit\|initializer\|method\)\>' if lline !~ s:obj - return indent(search('\<\(object\|object\s*(.*)\)\s*$', 'bW')) + &sw + return indent(search('\<\(object\|object\s*(.*)\)\s*$', 'bW')) + shiftwidth() endif endif " Add a 'shiftwidth' after lines ending with: if lline =~ '\(:\|=\|->\|<-\|(\|\[\|{\|{<\|\[|\|\[<\|\<\(begin\|do\|else\|fun\|function\|functor\|if\|initializer\|object\|parser\|private\|sig\|struct\|then\|try\)\|\<object\s*(.*)\)\s*$' - let ind = ind + &sw + let ind = ind + shiftwidth() " Back to normal indent after lines ending with ';;': elseif lline =~ ';;\s*$' && lline !~ '^\s*;;' @@ -263,7 +263,7 @@ function! GetOCamlIndent() " Subtract a 'shiftwidth' after lines matching 'match ... with parser': if lline =~ '\<match\>.*\<with\>\s*\<parser\s*$' - let ind = ind - &sw + let ind = ind - shiftwidth() endif return ind |