Bug#451440: vim-runtime: syntax/lhaskell.vim shouldn't assume that any file with % is TeX

Chung-chieh Shan ken at digitas.harvard.edu
Fri Nov 16 00:08:39 UTC 2007


Package: vim-runtime
Version: 1:7.1-138+1
Severity: normal
Tags: patch

Hello,

By default, syntax/lhaskell.vim tries to guess whether a literate
Haskell program is a TeX document.  The current guessing method takes
any occurrence of % in the file to show that it is a TeX document.  This
method is too sensitive; for one thing, it is triggered even if the %
appears in Haskell code or in comments about percentages!  The patch
below restricts % to appear at the beginning of a line.

--- lhaskell.vim.orig	2007-11-15 19:05:37.000000000 -0500
+++ lhaskell.vim	2007-11-15 19:05:04.000000000 -0500
@@ -71,7 +71,7 @@
 "   - \begin{env}       (for env != code)
 "   - \part, \chapter, \section, \subsection, \subsubsection, etc
 if b:lhs_markup == "unknown"
-    if search('%\|\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
+    if search('^%\|\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
 	let b:lhs_markup = "tex"
     else
 	let b:lhs_markup = "plain"

Thanks,
	Ken

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22 (SMP w/2 CPU cores)
Locale: LANG=zh_TW.UTF-8, LC_CTYPE=zh_TW.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

vim-runtime depends on no packages.

Versions of packages vim-runtime recommends:
ii  vim-gnome                    1:7.1-138+1 Vi IMproved - enhanced vi editor -

-- no debconf information

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
The old name for the Giraffe was Cameleopard, literally a Camel-Leopard.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20071115/7affdfbf/attachment.pgp 


More information about the pkg-vim-maintainers mailing list