diff runtime/indent/sh.vim @ 14421:2f7e67dd088c

Update runtime files. commit https://github.com/vim/vim/commit/91f84f6e11cd879d43d651c0903d85bff95f0716 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 29 15:07:52 2018 +0200 Update runtime files.
author Christian Brabandt <cb@256bit.org>
date Sun, 29 Jul 2018 15:15:06 +0200
parents cd513458728c
children fe57e4f0eac1
line wrap: on
line diff
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -7,6 +7,7 @@
 " License:             Vim (see :h license)
 " Repository:          https://github.com/chrisbra/vim-sh-indent
 " Changelog:
+"          20180724  - make check for zsh syntax more rigid (needs word-boundaries)
 "          20180326  - better support for line continuation
 "          20180325  - better detection of function definitions
 "          20180127  - better support for zsh complex commands
@@ -70,7 +71,7 @@ function! GetShIndent()
 
   " Check contents of previous lines
   if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' ||
-        \  (&ft is# 'zsh' && line =~ '\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
+        \  (&ft is# 'zsh' && line =~ '\<\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>')
     if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$'
       let ind += s:indent_value('default')
     endif