aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-01 23:21:22 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-01 23:27:26 +0200
commit532ee54a42a294073e8b441f3ce5a050d16963a2 (patch)
tree9b474891db31d3b920e9c8040cfeb388bf090d75 /runtime/indent
parentf379eac1ef9926ecefab7302f876c7c93b5cca74 (diff)
downloadrneovim-532ee54a42a294073e8b441f3ce5a050d16963a2.tar.gz
rneovim-532ee54a42a294073e8b441f3ce5a050d16963a2.tar.bz2
rneovim-532ee54a42a294073e8b441f3ce5a050d16963a2.zip
vim-patch:a6c27c47ddf0
Update runtime files https://github.com/vim/vim/commit/a6c27c47ddf081859659d7de1caec675147e466b
Diffstat (limited to 'runtime/indent')
-rw-r--r--runtime/indent/awk.vim2
-rw-r--r--runtime/indent/mma.vim2
-rw-r--r--runtime/indent/rmd.vim2
-rw-r--r--runtime/indent/sh.vim6
4 files changed, 7 insertions, 5 deletions
diff --git a/runtime/indent/awk.vim b/runtime/indent/awk.vim
index aad73ee71f..e65331977c 100644
--- a/runtime/indent/awk.vim
+++ b/runtime/indent/awk.vim
@@ -47,7 +47,7 @@ endif
function! GetAwkIndent()
- " Find previous line and get it's indentation
+ " Find previous line and get its indentation
let prev_lineno = s:Get_prev_line( v:lnum )
if prev_lineno == 0
return 0
diff --git a/runtime/indent/mma.vim b/runtime/indent/mma.vim
index 8298ad98cd..a76fa8ede0 100644
--- a/runtime/indent/mma.vim
+++ b/runtime/indent/mma.vim
@@ -57,7 +57,7 @@ function GetMmaIndent()
if getline(v:lnum) =~ '[^[]*]\s*$'
" move to the closing bracket
call search(']','bW')
- " and find it's partner's indent
+ " and find its partner's indent
let ind = indent(searchpair('\[','',']','bWn'))
" same for ( blocks
elseif getline(v:lnum) =~ '[^(]*)$'
diff --git a/runtime/indent/rmd.vim b/runtime/indent/rmd.vim
index 182b07cbaa..83fe4e4fed 100644
--- a/runtime/indent/rmd.vim
+++ b/runtime/indent/rmd.vim
@@ -39,7 +39,7 @@ endfunction
function s:GetYamlIndent()
let pline = getline(v:lnum - 1)
if pline =~ ':\s*$'
- return indent(v:lnum) + &sw
+ return indent(v:lnum) + shiftwidth()
elseif pline =~ '^\s*- '
return indent(v:lnum) + 2
endif
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index 520d3eece1..148a86ed67 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -3,10 +3,12 @@
" Maintainer: Christian Brabandt <cb@256bit.org>
" Original Author: Nikolai Weibull <now@bitwi.se>
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
-" Latest Revision: 2019-03-25
+" Latest Revision: 2019-04-27
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
" Changelog:
+" 20190428 - De-indent fi correctly when typing with
+" https://github.com/chrisbra/vim-sh-indent/issues/15
" 20190325 - Indent fi; correctly
" https://github.com/chrisbra/vim-sh-indent/issues/14
" 20190319 - Indent arrays (only zsh and bash)
@@ -127,7 +129,7 @@ function! GetShIndent()
" Current line is a endif line, so get indent from start of "if condition" line
" TODO: should we do the same for other "end" lines?
if curline =~ '^\s*\%(fi\);\?\s*\%(#.*\)\=$'
- let previous_line = searchpair('\<if\>', '', '\<fi\>', 'bnW')
+ let previous_line = searchpair('\<if\>', '', '\<fi\>\zs', 'bnW')
if previous_line > 0
let ind = indent(previous_line)
endif