aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/prolog.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-10-29 23:58:13 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-10-30 00:02:22 +0100
commit17c26d0dcfcc189cc020464ace67cc0a6f2475bd (patch)
treebdb6e2b8d0dcd484cfbfc2ae29521ba26fa9852f /runtime/indent/prolog.vim
parent7d2fbb9012e983ac013b6352b4cf8ea7a3a2f2b4 (diff)
downloadrneovim-17c26d0dcfcc189cc020464ace67cc0a6f2475bd.tar.gz
rneovim-17c26d0dcfcc189cc020464ace67cc0a6f2475bd.tar.bz2
rneovim-17c26d0dcfcc189cc020464ace67cc0a6f2475bd.zip
vim-patch:95bafa296ae9
Update runtime files. https://github.com/vim/vim/commit/95bafa296ae97bf420d5c74dd6db517b404c5df7
Diffstat (limited to 'runtime/indent/prolog.vim')
-rw-r--r--runtime/indent/prolog.vim13
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*\(%.*\)\?$'