diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-10-30 01:01:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 01:01:29 +0100 |
commit | 500345aea2ef88b45e0905043ed435ad4676bcef (patch) | |
tree | c7def1cc1de8c7c869560eb9770ee6067ae1323d /runtime/indent/prolog.vim | |
parent | f5406dfe7772dca82e31f27c042c5718198f0ec8 (diff) | |
parent | 18ce6c90636abae594905eecf2e225124ae8ab17 (diff) | |
download | rneovim-500345aea2ef88b45e0905043ed435ad4676bcef.tar.gz rneovim-500345aea2ef88b45e0905043ed435ad4676bcef.tar.bz2 rneovim-500345aea2ef88b45e0905043ed435ad4676bcef.zip |
Merge #9172 from justinmk/vim-d473c8c10126
Diffstat (limited to 'runtime/indent/prolog.vim')
-rw-r--r-- | runtime/indent/prolog.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/indent/prolog.vim b/runtime/indent/prolog.vim index 26a3bc3cd9..ecd0894166 100644 --- a/runtime/indent/prolog.vim +++ b/runtime/indent/prolog.vim @@ -2,6 +2,7 @@ " Maintainer : Gergely Kontra <kgergely@mcl.hu> " Revised on : 2002.02.18. 23:34:05 " Language : Prolog +" Last change by: Takuya Fujiwara, 2018 Sep 23 " TODO: " checking with respect to syntax highlighting @@ -37,10 +38,18 @@ function! GetPrologIndent() let ind = indent(pnum) " Previous line was comment -> use previous line's indent if pline =~ '^\s*%' - retu ind + return ind + endif + " Previous line was the start of block comment -> +1 after '/*' comment + if pline =~ '^\s*/\*' + return ind + 1 + endif + " Previous line was the end of block comment -> -1 after '*/' comment + if pline =~ '^\s*\*/' + return ind - 1 endif " Check for clause head on previous line - if pline =~ ':-\s*\(%.*\)\?$' + if pline =~ '\%(:-\|-->\)\s*\(%.*\)\?$' let ind = ind + shiftwidth() " Check for end of clause on previous line elseif pline =~ '\.\s*\(%.*\)\?$' |