Mercurial > vim
comparison runtime/indent/cmake.vim @ 12499:d91cf2e26ef0
Update runtime files.
commit https://github.com/vim/vim/commit/37c64c78fd87e086b5a945ad7032787c274e2dcb
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 19 22:06:03 2017 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Sep 2017 22:15:06 +0200 |
parents | 63b0b7b79b25 |
children | 34c8ec888122 |
comparison
equal
deleted
inserted
replaced
12498:bf98d339b568 | 12499:d91cf2e26ef0 |
---|---|
1 " Vim indent file | 1 " Vim indent file |
2 " Program: CMake - Cross-Platform Makefile Generator | |
3 " Module: $RCSfile: cmake-indent.vim,v $ | |
4 " Language: CMake (ft=cmake) | 2 " Language: CMake (ft=cmake) |
5 " Author: Andy Cedilnik <andy.cedilnik@kitware.com> | 3 " Author: Andy Cedilnik <andy.cedilnik@kitware.com> |
6 " Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com> | 4 " Maintainer: Dimitri Merejkowsky <d.merej@gmail.com> |
7 " Last Change: $Date: 2008-01-16 16:53:53 $ | 5 " Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com> |
8 " Version: $Revision: 1.9 $ | 6 " Last Change: 2017 Aug 30 |
9 " | 7 " |
10 " Licence: The CMake license applies to this file. See | 8 " Licence: The CMake license applies to this file. See |
11 " http://www.cmake.org/HTML/Copyright.html | 9 " https://cmake.org/licensing |
12 " This implies that distribution with Vim is allowed | 10 " This implies that distribution with Vim is allowed |
13 | 11 |
14 if exists("b:did_indent") | 12 if exists("b:did_indent") |
15 finish | 13 finish |
16 endif | 14 endif |
17 let b:did_indent = 1 | 15 let b:did_indent = 1 |
18 | 16 |
17 setlocal et | |
19 setlocal indentexpr=CMakeGetIndent(v:lnum) | 18 setlocal indentexpr=CMakeGetIndent(v:lnum) |
20 setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE( | 19 setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE( |
21 | 20 |
22 " Only define the function once. | 21 " Only define the function once. |
23 if exists("*CMakeGetIndent") | 22 if exists("*CMakeGetIndent") |
66 " Add | 65 " Add |
67 if previous_line =~? cmake_indent_comment_line " Handle comments | 66 if previous_line =~? cmake_indent_comment_line " Handle comments |
68 let ind = ind | 67 let ind = ind |
69 else | 68 else |
70 if previous_line =~? cmake_indent_begin_regex | 69 if previous_line =~? cmake_indent_begin_regex |
71 let ind = ind + shiftwidth() | 70 let ind = ind + &sw |
72 endif | 71 endif |
73 if previous_line =~? cmake_indent_open_regex | 72 if previous_line =~? cmake_indent_open_regex |
74 let ind = ind + shiftwidth() | 73 let ind = ind + &sw |
75 endif | 74 endif |
76 endif | 75 endif |
77 | 76 |
78 " Subtract | 77 " Subtract |
79 if this_line =~? cmake_indent_end_regex | 78 if this_line =~? cmake_indent_end_regex |
80 let ind = ind - shiftwidth() | 79 let ind = ind - &sw |
81 endif | 80 endif |
82 if previous_line =~? cmake_indent_close_regex | 81 if previous_line =~? cmake_indent_close_regex |
83 let ind = ind - shiftwidth() | 82 let ind = ind - &sw |
84 endif | 83 endif |
85 | 84 |
86 return ind | 85 return ind |
87 endfun | 86 endfun |
88 | 87 |