]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(php): Update indent script to 1.76 (from 1.75)
authorJohn Wellesz <john.wellesz@gmail.com>
Thu, 20 Nov 2025 20:50:54 +0000 (20:50 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 20 Nov 2025 20:50:54 +0000 (20:50 +0000)
fixes: #18739 (editor hang on mixed syntax style)
closes: #18758

Signed-off-by: John Wellesz <john.wellesz@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/indent/php.vim

index 377ffd5afb3f0230a65b7e51e9c331ebd75eaf0c..89d4afa0d05f6d7952cfa72ef06d270eaac97e92 100644 (file)
@@ -1,10 +1,9 @@
-" Vim indent file
 " Language:    PHP
 " Author:      John Wellesz <John.wellesz (AT) gmail (DOT) com>
 " URL:         https://www.2072productions.com/vim/indent/php.vim
 " Home:                https://github.com/2072/PHP-Indenting-for-VIm
-" Last Change: 2023 August 18th
-" Version:     1.75
+" Last Change: 2025 November 16th
+" Version:     1.76
 "
 "
 "      Type :help php-indent for available options
@@ -839,13 +838,15 @@ function! GetPhpIndent()
 
                continue
            else
-               let isSingleLineBlock = 0
 
-               if getline(last_line_num) =~# '^\s*else\%(if\)\=\>'
+               if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' && !isSingleLineBlock
                    let last_line_num = FindTheIfOfAnElse(last_line_num, 0)
+                   let isSingleLineBlock = 0
                    continue
                endif
 
+               let isSingleLineBlock = 0
+
 
                let last_match = last_line_num