Skip to content

Commit d128850

Browse files
2072chrisbra
authored andcommitted
runtime(php): Update indent script to 1.76 (from 1.75)
fixes: #18739 (editor hang on mixed syntax style) closes: #18758 Signed-off-by: John Wellesz <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent ddb88ab commit d128850

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

runtime/indent/php.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
" Vim indent file
21
" Language: PHP
32
" Author: John Wellesz <John.wellesz (AT) gmail (DOT) com>
43
" URL: https://www.2072productions.com/vim/indent/php.vim
54
" Home: https://github.com/2072/PHP-Indenting-for-VIm
6-
" Last Change: 2023 August 18th
7-
" Version: 1.75
5+
" Last Change: 2025 November 16th
6+
" Version: 1.76
87
"
98
"
109
" Type :help php-indent for available options
@@ -839,13 +838,15 @@ function! GetPhpIndent()
839838

840839
continue
841840
else
842-
let isSingleLineBlock = 0
843841

844-
if getline(last_line_num) =~# '^\s*else\%(if\)\=\>'
842+
if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' && !isSingleLineBlock
845843
let last_line_num = FindTheIfOfAnElse(last_line_num, 0)
844+
let isSingleLineBlock = 0
846845
continue
847846
endif
848847

848+
let isSingleLineBlock = 0
849+
849850

850851
let last_match = last_line_num
851852

0 commit comments

Comments
 (0)