diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-07-06 22:35:45 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-07-06 22:35:45 +0000 |
commit | dc27ac1c5ed0835c4e5ea22680d2f074c4689fa3 (patch) | |
tree | 3960d34a46da738e7ccc677c63ad6d2178b4eeb8 /runtime/indent | |
parent | bfb2006fd50775f6d4aedd49833140cdbcfbf918 (diff) |
updated for version 7.0104
Diffstat (limited to 'runtime/indent')
-rw-r--r-- | runtime/indent/vim.vim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index 5f66571bc2..0a6dbc17ac 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Vim script " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2005 Jun 16 +" Last Change: 2005 Jul 06 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -52,8 +52,13 @@ function GetVimIndent() " If the previous line contains an "end" after a pipe, but not in an ":au" " command. And not when there is a backslash before the pipe. - if getline(lnum) =~ '[^\\]|\s*\(ene\@!\)' && getline(lnum) !~ '^\s*au\%[tocmd]' - let ind = ind - &sw + " And when syntax HL is enabled avoid a match inside a string. + let line = getline(lnum) + let i = match(line, '[^\\]|\s*\(ene\@!\)') + if i > 0 && line !~ '^\s*au\%[tocmd]' + if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$' + let ind = ind - &sw + endif endif |