mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-24 08:38:39 -06:00
Merge topic 'update-vim-syntax'
8a6cdbaeupdate vim-syntax to latest cmake-commit11225ec6vim-cmake-syntax 2017-10-31 (a8a846f0) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1431
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
" vim: set nowrap:
|
||||
" Vim syntax file
|
||||
" Program: CMake - Cross-Platform Makefile Generator
|
||||
" Version: @VERSION@
|
||||
@@ -8,6 +7,7 @@
|
||||
" Patrick Boettcher <patrick.boettcher@posteo.de>
|
||||
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
|
||||
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
|
||||
" Last Change: @DATE@
|
||||
"
|
||||
" Licence: The CMake license applies to this file. See
|
||||
" https://cmake.org/licensing
|
||||
@@ -100,4 +100,4 @@ let b:current_syntax = "cmake"
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
"EOF"
|
||||
" vim: set nowrap:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX qw(strftime);
|
||||
|
||||
#my $cmake = "/home/pboettch/devel/upstream/cmake/build/bin/cmake";
|
||||
my $cmake = "cmake";
|
||||
@@ -129,6 +130,10 @@ while(<IN>)
|
||||
} elsif ($1 eq "VERSION") {
|
||||
$_ =~ s/\@VERSION\@/$version/;
|
||||
print OUT $_;
|
||||
} elsif ($1 eq "DATE") {
|
||||
my $date = strftime "%Y %b %d", localtime;
|
||||
$_ =~ s/\@DATE\@/$date/;
|
||||
print OUT $_;
|
||||
} else {
|
||||
print "ERROR do not know how to replace $1\n";
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user