if match(getline(1,20),"^ \{0,1}\(=\{2,6}\)[^=]\+\1 *$") >= 0

The pattern used in the match() call is the same as in the
syntax highlighting script.

My guess is that it's something like an escaping problem. You're using double-quotes which are a little more finicky about contained-escapes. You might try

  match(getline(1,20),'^ \{0,1}\(=\{2,6}\)[^=]\+\1 *$')

(using single-quotes rather than double-quotes) or

  match(getline(1,20),"^ \\{0,1}\\(=\\{2,6}\\)[^=]\+\\1 *$")

(escaping your escape-characters).  You can read a bit more at

        :help expr-quote
        :help expr-string

You can also change the \{0,1} syntax to \= for the same results. I don't know if one is faster than another internally, or if it even matters, but it's fewer chars to type. (":help \=")

Just a couple ideas,

-tim

Reply via email to