Bug#282135: vim-common: indent/php.vim indents incorrectly

Satya Satya <debbugs@thesatya.com>, 282135@bugs.debian.org
Fri, 19 Nov 2004 16:24:33 -0500


This is a multi-part MIME message sent by reportbug.

--===============0279869127==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: vim-common
Version: 1:6.3-031+2
Severity: normal
Tags: patch


PHP code like this:

if(a==b) {
    stuff
}
if(b==c) {
    otherstuff
}

fails to un-indent at the closing brace properly, resulting in code like
this:

if(a==b) {
    stuff
    }
    if(b==c) {
        otherstuff
        }


Line 82-ish is broken into 3 lines, the fix is to simply join the lines.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages vim-common depends on:
ii  vim                          1:6.3-031+2 Vi IMproved - enhanced vi editor

-- no debconf information

--===============0279869127==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="php.vim.patch"

--- php.vim	2004-11-19 16:16:02.000000000 -0500
+++ php.vim.fixed	2004-11-19 16:20:21.000000000 -0500
@@ -79,9 +79,7 @@
 		" to the indent of the matching line.
 		if cline =~ '^\s*}'
 			call cursor(line('.'), 1)
-			let ind = indent(searchpair('{', '', '}',
-			'bW', 'synIDattr(synID(line("."), col("."),
-			0), "name") =~? "string"'))
+			let ind = indent(searchpair('{', '', '}','bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
 			return ind
 		endif
 		" Try to indent switch/case statements as well

--===============0279869127==--