vim-patch:3afc9f2556fa

runtime(cmake): sync runtime files with upstream (vim/vim#13597)

3afc9f2556

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
This commit is contained in:
Christian Clason 2023-12-15 01:08:19 +01:00
parent 65032e03e0
commit 34f008e247
2 changed files with 4637 additions and 125 deletions

View File

@ -3,9 +3,9 @@
" Author: Andy Cedilnik <andy.cedilnik@kitware.com> " Author: Andy Cedilnik <andy.cedilnik@kitware.com>
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com> " Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com> " Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: 2022 Apr 06 " Last Change: 2023 Dec 12
" "
" Licence: The CMake license applies to this file. See " License: The CMake license applies to this file. See
" https://cmake.org/licensing " https://cmake.org/licensing
" This implies that distribution with Vim is allowed " This implies that distribution with Vim is allowed
@ -55,32 +55,41 @@ fun! CMakeGetIndent(lnum)
let cmake_indent_open_regex = '^\s*' . cmake_regex_identifier . let cmake_indent_open_regex = '^\s*' . cmake_regex_identifier .
\ '\s*(' . cmake_regex_arguments . \ '\s*(' . cmake_regex_arguments .
\ '\(' . cmake_regex_comment . '\)\?$' \ '\(' . cmake_regex_comment . '\)\?$'
let cmake_indent_close_regex = '^' . cmake_regex_arguments . let cmake_indent_close_regex = '^' . cmake_regex_arguments .
\ ')\s*' . \ ')\s*' .
\ '\(' . cmake_regex_comment . '\)\?$' \ '\(' . cmake_regex_comment . '\)\?$'
let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\|FUNCTION\)\s*(' let cmake_closing_parens_line = '^\s*\()\+\)\s*$'
let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\|ENDFUNCTION\)\s*('
" Add let cmake_indent_begin_regex = '^\s*\(BLOCK\|IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\|FUNCTION\)\s*('
if previous_line =~? cmake_indent_comment_line " Handle comments let cmake_indent_end_regex = '^\s*\(ENDBLOCK\|ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\|ENDFUNCTION\)\s*('
let ind = ind
if this_line =~? cmake_closing_parens_line
if previous_line !~? cmake_indent_open_regex
let ind = ind - shiftwidth()
endif
else else
if previous_line =~? cmake_indent_begin_regex " Add
let ind = ind + shiftwidth() if previous_line =~? cmake_indent_comment_line " Handle comments
let ind = ind
else
if previous_line =~? cmake_indent_begin_regex
let ind = ind + shiftwidth()
endif
if previous_line =~? cmake_indent_open_regex
let ind = ind + shiftwidth()
endif
endif endif
if previous_line =~? cmake_indent_open_regex
let ind = ind + shiftwidth()
endif
endif
" Subtract " Subtract
if this_line =~? cmake_indent_end_regex if this_line =~? cmake_indent_end_regex
let ind = ind - shiftwidth() let ind = ind - shiftwidth()
endif endif
if previous_line =~? cmake_indent_close_regex if previous_line !~? cmake_closing_parens_line
let ind = ind - shiftwidth() if previous_line =~? cmake_indent_close_regex
let ind = ind - shiftwidth()
endif
endif
endif endif
return ind return ind

File diff suppressed because one or more lines are too long