|
@@ -1,9 +1,9 @@
|
|
|
" Vim indent file
|
|
" Vim indent file
|
|
|
" Language: CMake (ft=cmake)
|
|
" Language: CMake (ft=cmake)
|
|
|
" Author: Andy Cedilnik <[email protected]>
|
|
" Author: Andy Cedilnik <[email protected]>
|
|
|
-" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
|
|
|
|
-" Last Change: $Date$
|
|
|
|
|
-" Version: $Revision$
|
|
|
|
|
|
|
+" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
|
|
|
|
+" Former Maintainer: Karthik Krishnan <[email protected]>
|
|
|
|
|
+" Last Change: 2017 Aug 30
|
|
|
"
|
|
"
|
|
|
" Licence: The CMake license applies to this file. See
|
|
" Licence: The CMake license applies to this file. See
|
|
|
" https://cmake.org/licensing
|
|
" https://cmake.org/licensing
|
|
@@ -14,6 +14,9 @@ if exists("b:did_indent")
|
|
|
endif
|
|
endif
|
|
|
let b:did_indent = 1
|
|
let b:did_indent = 1
|
|
|
|
|
|
|
|
|
|
+let s:keepcpo= &cpo
|
|
|
|
|
+set cpo&vim
|
|
|
|
|
+
|
|
|
setlocal indentexpr=CMakeGetIndent(v:lnum)
|
|
setlocal indentexpr=CMakeGetIndent(v:lnum)
|
|
|
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
|
|
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
|
|
|
|
|
|
|
@@ -64,20 +67,23 @@ fun! CMakeGetIndent(lnum)
|
|
|
let ind = ind
|
|
let ind = ind
|
|
|
else
|
|
else
|
|
|
if previous_line =~? cmake_indent_begin_regex
|
|
if previous_line =~? cmake_indent_begin_regex
|
|
|
- let ind = ind + &sw
|
|
|
|
|
|
|
+ let ind = ind + shiftwidth()
|
|
|
endif
|
|
endif
|
|
|
if previous_line =~? cmake_indent_open_regex
|
|
if previous_line =~? cmake_indent_open_regex
|
|
|
- let ind = ind + &sw
|
|
|
|
|
|
|
+ let ind = ind + shiftwidth()
|
|
|
endif
|
|
endif
|
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
" Subtract
|
|
" Subtract
|
|
|
if this_line =~? cmake_indent_end_regex
|
|
if this_line =~? cmake_indent_end_regex
|
|
|
- let ind = ind - &sw
|
|
|
|
|
|
|
+ let ind = ind - shiftwidth()
|
|
|
endif
|
|
endif
|
|
|
if previous_line =~? cmake_indent_close_regex
|
|
if previous_line =~? cmake_indent_close_regex
|
|
|
- let ind = ind - &sw
|
|
|
|
|
|
|
+ let ind = ind - shiftwidth()
|
|
|
endif
|
|
endif
|
|
|
|
|
|
|
|
return ind
|
|
return ind
|
|
|
endfun
|
|
endfun
|
|
|
|
|
+
|
|
|
|
|
+let &cpo = s:keepcpo
|
|
|
|
|
+unlet s:keepcpo
|