summaryrefslogtreecommitdiffstats
path: root/runtime/indent/j.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-03-22 21:02:50 +0100
committerBram Moolenaar <Bram@vim.org>2014-03-22 21:02:50 +0100
commita68783751647e3243ca6f22df62907efbdbccb02 (patch)
tree372908fd79defec22190b6d2a48bbc6155bb22e7 /runtime/indent/j.vim
parented287f9a4e3f4ed5528ad2af65b7b23bce14a688 (diff)
Updated runtime files.
Diffstat (limited to 'runtime/indent/j.vim')
-rw-r--r--runtime/indent/j.vim15
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/indent/j.vim b/runtime/indent/j.vim
index 056c20a4e4..ae443bae2a 100644
--- a/runtime/indent/j.vim
+++ b/runtime/indent/j.vim
@@ -1,9 +1,10 @@
" Vim indent file
" Language: J
" Maintainer: David Bürgin <676c7473@gmail.com>
-" Last Change: 2013-09-21
+" URL: https://github.com/glts/vim-j
+" Last Change: 2014-03-17
-if exists("b:did_indent")
+if exists('b:did_indent')
finish
endif
let b:did_indent = 1
@@ -12,9 +13,9 @@ setlocal indentexpr=GetJIndent()
setlocal indentkeys-=0{,0},\:,0#
setlocal indentkeys+=0),=case.,=catch.,=catchd.,=catcht.,=do.,=else.,=elseif.,=end.,=fcase.
-let b:undo_indent = "setl indk< inde<"
+let b:undo_indent = 'setlocal indentkeys< indentexpr<'
-if exists("*GetJIndent")
+if exists('*GetJIndent')
finish
endif
@@ -27,11 +28,11 @@ function GetJIndent()
let indent = indent(prevlnum)
if getline(prevlnum) =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.'
if getline(prevlnum) !~# '\<end\.'
- let indent += &shiftwidth
+ let indent += shiftwidth()
endif
endif
- if getline(v:lnum) =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.'
- let indent -= &shiftwidth
+ if getline(v:lnum) =~# '^\s*\%(\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.\)\|)'
+ let indent -= shiftwidth()
endif
return indent
endfunction