summaryrefslogtreecommitdiffstats
path: root/runtime/indent/cmake.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-19 22:06:03 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-19 22:06:03 +0200
commit37c64c78fd87e086b5a945ad7032787c274e2dcb (patch)
tree01639bc116fb3c7300537c097ab007abf1521ff0 /runtime/indent/cmake.vim
parente22bbf65088a01b465918919782c19eb291f9cf0 (diff)
Update runtime files.
Diffstat (limited to 'runtime/indent/cmake.vim')
-rw-r--r--runtime/indent/cmake.vim19
1 files changed, 9 insertions, 10 deletions
diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim
index 93a131b938..85a9ec4e98 100644
--- a/runtime/indent/cmake.vim
+++ b/runtime/indent/cmake.vim
@@ -1,14 +1,12 @@
" Vim indent file
-" Program: CMake - Cross-Platform Makefile Generator
-" Module: $RCSfile: cmake-indent.vim,v $
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
-" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
-" Last Change: $Date: 2008-01-16 16:53:53 $
-" Version: $Revision: 1.9 $
+" 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
-" http://www.cmake.org/HTML/Copyright.html
+" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:did_indent")
@@ -16,6 +14,7 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
+setlocal et
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
@@ -68,19 +67,19 @@ fun! CMakeGetIndent(lnum)
let ind = ind
else
if previous_line =~? cmake_indent_begin_regex
- let ind = ind + shiftwidth()
+ let ind = ind + &sw
endif
if previous_line =~? cmake_indent_open_regex
- let ind = ind + shiftwidth()
+ let ind = ind + &sw
endif
endif
" Subtract
if this_line =~? cmake_indent_end_regex
- let ind = ind - shiftwidth()
+ let ind = ind - &sw
endif
if previous_line =~? cmake_indent_close_regex
- let ind = ind - shiftwidth()
+ let ind = ind - &sw
endif
return ind