summaryrefslogtreecommitdiffstats
path: root/Auxiliary/vim/indent
diff options
context:
space:
mode:
authorPatrick Boettcher <patrick.boettcher@posteo.de>2017-10-31 06:44:53 (GMT)
committerPatrick Boettcher <patrick.boettcher@posteo.de>2017-10-31 06:44:53 (GMT)
commit8a6cdbae16273418d036da8a13aea722ca39cbb3 (patch)
tree173e5a5c56c94ee78129f4998743a739c72ae7e7 /Auxiliary/vim/indent
parentfd2e6212a66cd443bbf3e5b6e2cfd77ef1fb7b61 (diff)
parent11225ec6de6d210c24526641dd8b13f03e65adc5 (diff)
downloadCMake-8a6cdbae16273418d036da8a13aea722ca39cbb3.zip
CMake-8a6cdbae16273418d036da8a13aea722ca39cbb3.tar.gz
CMake-8a6cdbae16273418d036da8a13aea722ca39cbb3.tar.bz2
update vim-syntax to latest cmake-commit
Diffstat (limited to 'Auxiliary/vim/indent')
-rw-r--r--Auxiliary/vim/indent/cmake.vim20
1 files changed, 13 insertions, 7 deletions
diff --git a/Auxiliary/vim/indent/cmake.vim b/Auxiliary/vim/indent/cmake.vim
index 76aff64..33e583d 100644
--- a/Auxiliary/vim/indent/cmake.vim
+++ b/Auxiliary/vim/indent/cmake.vim
@@ -1,9 +1,9 @@
" Vim indent file
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
-" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
-" Last Change: $Date$
-" Version: $Revision$
+" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
+" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
+" Last Change: 2017 Aug 30
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
@@ -14,6 +14,9 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
+let s:keepcpo= &cpo
+set cpo&vim
+
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
@@ -64,20 +67,23 @@ fun! CMakeGetIndent(lnum)
let ind = ind
else
if previous_line =~? cmake_indent_begin_regex
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
if previous_line =~? cmake_indent_open_regex
- let ind = ind + &sw
+ let ind = ind + shiftwidth()
endif
endif
" Subtract
if this_line =~? cmake_indent_end_regex
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
if previous_line =~? cmake_indent_close_regex
- let ind = ind - &sw
+ let ind = ind - shiftwidth()
endif
return ind
endfun
+
+let &cpo = s:keepcpo
+unlet s:keepcpo