summaryrefslogtreecommitdiffstats
path: root/indent/julia.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-04-14 13:17:26 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-04-14 13:17:26 +0200
commit14dc82fc4e6c0c08078f97a24a6c1639c1cc5113 (patch)
treedea8d2398a9377a0eee7786776e3cd420ce1ee89 /indent/julia.vim
parente86e0ad36ef9501acbc3e8c63a1d4fab104e47cb (diff)
downloadvim-polyglot-14dc82fc4e6c0c08078f97a24a6c1639c1cc5113.tar.gz
vim-polyglot-14dc82fc4e6c0c08078f97a24a6c1639c1cc5113.zip
Update
Diffstat (limited to 'indent/julia.vim')
-rw-r--r--indent/julia.vim14
1 files changed, 10 insertions, 4 deletions
diff --git a/indent/julia.vim b/indent/julia.vim
index 299bb3f6..97dd7bc6 100644
--- a/indent/julia.vim
+++ b/indent/julia.vim
@@ -316,11 +316,17 @@ function GetJuliaIndent()
" Second scenario: some multiline bracketed expression was closed in the
" previous line. But since we know we are still in a bracketed expression,
" we need to find the line where the bracket was open
- elseif last_closed_bracket != -1 " && exists("loaded_matchit")
- " we use the % command to skip back (this is buggy without matchit, and
- " is potentially a disaster if % got remapped)
+ elseif last_closed_bracket != -1
+ " we use the % command to skip back (tries to ues matchit if possible,
+ " otherwise resorts to vim's default, which is buggy but better than
+ " nothing)
call cursor(lnum, last_closed_bracket)
- normal %
+ let percmap = maparg("%", "n")
+ if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)'
+ normal %
+ else
+ normal! %
+ end
if line(".") == lnum
" something wrong here, give up
let ind = indent(lnum)