From 37c64c78fd87e086b5a945ad7032787c274e2dcb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 19 Sep 2017 22:06:03 +0200 Subject: Update runtime files. --- runtime/indent/cmake.vim | 19 +- runtime/indent/javascript.vim | 505 ++++++++++++++++++++++++------------------ runtime/indent/perl.vim | 9 +- 3 files changed, 300 insertions(+), 233 deletions(-) (limited to 'runtime/indent') diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim index 93a131b93..85a9ec4e9 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 -" Maintainer: Karthik Krishnan -" Last Change: $Date: 2008-01-16 16:53:53 $ -" Version: $Revision: 1.9 $ +" Maintainer: Dimitri Merejkowsky +" Former Maintainer: Karthik Krishnan +" 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 diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index 3b3f3a104..286171628 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -2,7 +2,7 @@ " Language: Javascript " Maintainer: Chris Paul ( https://github.com/bounceme ) " URL: https://github.com/pangloss/vim-javascript -" Last Change: March 21, 2017 +" Last Change: September 18, 2017 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -10,6 +10,10 @@ if exists('b:did_indent') endif let b:did_indent = 1 +" indent correctly if inside