aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/eruby.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-01 16:43:14 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-01 16:43:14 +0200
commit87140f234ac1f152f6f273dee5ab1e42c7b1d78b (patch)
tree2e8e1b980a4fe1786db5e35a2a44c77b0d2ecce8 /runtime/indent/eruby.vim
parent1f6c9fd82202c14021d0e6aa3f5e4ad89877d2f8 (diff)
parent5342342426777160300a431ef8c9200fb151f793 (diff)
downloadrneovim-87140f234ac1f152f6f273dee5ab1e42c7b1d78b.tar.gz
rneovim-87140f234ac1f152f6f273dee5ab1e42c7b1d78b.tar.bz2
rneovim-87140f234ac1f152f6f273dee5ab1e42c7b1d78b.zip
Merge #10646 'vim-patch: runtime patches'
Diffstat (limited to 'runtime/indent/eruby.vim')
-rw-r--r--runtime/indent/eruby.vim10
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/indent/eruby.vim b/runtime/indent/eruby.vim
index 5058325495..6ff15ab958 100644
--- a/runtime/indent/eruby.vim
+++ b/runtime/indent/eruby.vim
@@ -3,6 +3,7 @@
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
+" Last Change: 2019 Jan 06
if exists("b:did_indent")
finish
@@ -12,7 +13,7 @@ runtime! indent/ruby.vim
unlet! b:did_indent
setlocal indentexpr=
-if exists("b:eruby_subtype")
+if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=# 'eruby'
exe "runtime! indent/".b:eruby_subtype.".vim"
else
runtime! indent/html.vim
@@ -47,7 +48,11 @@ set cpo&vim
function! GetErubyIndent(...)
" The value of a single shift-width
- let sw = shiftwidth()
+ if exists('*shiftwidth')
+ let sw = shiftwidth()
+ else
+ let sw = &sw
+ endif
if a:0 && a:1 == '.'
let v:lnum = line('.')
@@ -91,6 +96,7 @@ function! GetErubyIndent(...)
let ind = ind + sw
endif
if line !~# '^\s*<%' && line =~# '%>\s*$' && line !~# '^\s*end\>'
+ \ && synID(v:lnum, match(cline, '\S') + 1, 1) != hlID('htmlEndTag')
let ind = ind - sw
endif
if cline =~# '^\s*[-=]\=%>\s*$'