Loading ...
Sorry, an error occurred while loading the content.
 

Lisp/Scheme paren matching

Expand Messages
  • Donald Allen
    I am attempting to edit Scheme code with vim. I ve always done this with emacs, but in the last year or so, I ve become a convert to vi-style editing. But,
    Message 1 of 16 , Aug 26, 2011
      I am attempting to edit Scheme code with vim. I've always done this with emacs, but in the last year or so, I've become a convert to vi-style editing. But, obviously, parenthesis matching is a key issue when editing Lisp or Scheme
      and I am pretty frustrated by the vim paren-matcher's finding parens inside strings. I simply want it to ignore anything inside a string and have spent more than enough time picking through the documentation for % and for the matchit plugin and have not been able to find a way to get the simple behavior I want.

      For example, positioning the cursor on the opening paren of this line:

      (hash-table-set! the-table "SETUP,create,original" ");")

      highlights the close-paren inside ");".

      I am running vim 7.3.285 on a Slackware 13.37 64-bit system. I built vim from source. cpoptions=aABceFs.

      Any help will be appreciated.

      /Don Allen

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... That s not from the matchit plugin, it s from the matchparen plugin. If you hit the % key repeatedly, the cursor ought to alternate between the ( you were
      Message 2 of 16 , Aug 26, 2011
        On 26/08/11 17:23, Donald Allen wrote:
        > I am attempting to edit Scheme code with vim. I've always done this with
        > emacs, but in the last year or so, I've become a convert to vi-style
        > editing. But, obviously, parenthesis matching is a key issue when
        > editing Lisp or Scheme
        > and I am pretty frustrated by the vim paren-matcher's finding parens
        > inside strings. I simply want it to ignore anything inside a string and
        > have spent more than enough time picking through the documentation for %
        > and for the matchit plugin and have not been able to find a way to get
        > the simple behavior I want.
        >
        > For example, positioning the cursor on the opening paren of this line:
        >
        > (hash-table-set! the-table "SETUP,create,original" ");")
        >
        > highlights the close-paren inside ");".

        That's not from the matchit plugin, it's from the matchparen plugin. If
        you hit the % key repeatedly, the cursor ought to alternate between the
        ( you were on and its _true_ ) match (if you have installed matchit,
        which is not the default).

        To disable the matchparen highlight completely, you can use
        :NoMatchParen
        at any time (reverse it by
        :DoMatchParen
        ), or you can use
        :let loaded_matchparen = 1
        in your vimrc (but if you do it that way, IIUC you can't enable it back).

        >
        > I am running vim 7.3.285 on a Slackware 13.37 64-bit system. I built vim
        > from source. cpoptions=aABceFs.
        >
        > Any help will be appreciated.
        >
        > /Don Allen


        Best regards,
        Tony.
        --
        It is better for civilization to be going down the drain than to be
        coming up it.
        -- Henry Allen

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Sergey Khorev
        ... Works fine on Big Vim 7.3.286. Are there any lines above that could confuse lisp-related code? ... -- Sergey Khorev http://sites.google.com/site/khorser
        Message 3 of 16 , Aug 26, 2011
          > For example, positioning the cursor on the opening paren of this line:
          > (hash-table-set! the-table "SETUP,create,original" ");")
          > highlights the close-paren inside ");".

          Works fine on Big Vim 7.3.286. Are there any lines above that could
          confuse lisp-related code?

          > I am running vim 7.3.285 on a Slackware 13.37 64-bit system. I built vim
          > from source. cpoptions=aABceFs.

          :ver would be more useful.

          --
          Sergey Khorev
          http://sites.google.com/site/khorser
          Can anybody think of a good tagline I can steal?

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Donald Allen
          On Fri, Aug 26, 2011 at 11:04 PM, Tony Mechelynck
          Message 4 of 16 , Aug 26, 2011
            On Fri, Aug 26, 2011 at 11:04 PM, Tony Mechelynck <antoine.mechelynck@...> wrote:
            On 26/08/11 17:23, Donald Allen wrote:
            I am attempting to edit Scheme code with vim. I've always done this with
            emacs, but in the last year or so, I've become a convert to vi-style
            editing. But, obviously, parenthesis matching is a key issue when
            editing Lisp or Scheme
            and I am pretty frustrated by the vim paren-matcher's finding parens
            inside strings. I simply want it to ignore anything inside a string and
            have spent more than enough time picking through the documentation for %
            and for the matchit plugin and have not been able to find a way to get
            the simple behavior I want.

            For example, positioning the cursor on the opening paren of this line:

            (hash-table-set! the-table "SETUP,create,original" ");")

            highlights the close-paren inside ");".

            That's not from the matchit plugin, it's from the matchparen plugin. If you hit the % key repeatedly, the cursor ought to alternate between the ( you were on and its _true_ ) match (if you have installed matchit, which is not the default).

            Thanks for clearing this up -- I was confused about what the default plugin was. I had not installed matchit, so am using the default -- matchparen. 

            To disable the matchparen highlight completely, you can use
                   :NoMatchParen
            at any time (reverse it by
                   :DoMatchParen
            ), or you can use
                   :let loaded_matchparen = 1
            in your vimrc (but if you do it that way, IIUC you can't enable it back).

            When I disable matchparen via the  :NoMatchParen command, with the cursor positioned as described in my original message, % moves back and forth between the open and correct close paren, ignoring the paren in the string. In other words, the behavior is correct. There's no paren highlighting, but at least % works correctly. With matchparen enabled, the highlighting is wrong and % behaves incorrectly, too, bouncing between the open paren and the close paren inside the string.



            I am running vim 7.3.285 on a Slackware 13.37 64-bit system. I built vim
            from source. cpoptions=aABceFs.

            Any help will be appreciated.

            /Don Allen


            Best regards,
            Tony.
            --
            It is better for civilization to be going down the drain than to be
            coming up it.
                           -- Henry Allen


            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Donald Allen
            ... Don t think so. I copied the above line into a new buffer, so only line in the buffer. Same incorrect behavior (with matchparen enabled). ... VIM - Vi
            Message 5 of 16 , Aug 26, 2011
              On Fri, Aug 26, 2011 at 11:14 PM, Sergey Khorev <sergey.khorev@...> wrote:
              > For example, positioning the cursor on the opening paren of this line:
              > (hash-table-set! the-table "SETUP,create,original" ");")
              > highlights the close-paren inside ");".

              Works fine on Big Vim 7.3.286. Are there any lines above that could
              confuse lisp-related code?

              Don't think so. I copied the above line into a new buffer, so only line in the buffer. Same incorrect behavior (with matchparen enabled). 

              > I am running vim 7.3.285 on a Slackware 13.37 64-bit system. I built vim
              > from source. cpoptions=aABceFs.

              :ver would be more useful.

              :ver
              VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 21 2011 08:35:57)
              Included patches: 1-285
              Compiled by dca@sergei
              Normal version without GUI.  Features included (+) or not (-):
              -arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments -conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
              +find_in_path +float +folding -footer +fork() +gettext -hangul_input -iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape -mouse_dec +mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm -multi_byte
               +multi_lang -mzscheme +netbeans_intg +path_extra -perl +persistent_undo +postscript +printer -profile -python -python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
              +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset -xim +xsmp_interact +xterm_clipboard -xterm_save
                 system vimrc file: "$VIM/vimrc"
                   user vimrc file: "$HOME/.vimrc"
                    user exrc file: "$HOME/.exrc"
                fall-back for $VIM: "/usr/local/share/vim"
              Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -fno-strength-reduce -Wall -D_FORTIFY_SOURCE=1
              Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lelf -lnsl  -lacl -lattr -lgpm
               

              --
              Sergey Khorev
              http://sites.google.com/site/khorser
              Can anybody think of a good tagline I can steal?

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Sergey Khorev
              ... Can you try usual troubleshooting steps, i.e. vim -U NONE -u NONE -N -c filetype on | syntax on | set ft=scheme Now paste your line. Does % work ok? If
              Message 6 of 16 , Aug 26, 2011
                > I copied the above line into a new buffer, so only line in
                > the buffer. Same incorrect behavior (with matchparen enabled).

                Can you try usual troubleshooting steps, i.e.

                vim -U NONE -u NONE -N -c "filetype on | syntax on | set ft=scheme"

                Now paste your line. Does % work ok?
                If so try :ru plugin/matchparen.vim and see whether it breaks anything or not.

                --
                Sergey Khorev
                http://sites.google.com/site/khorser
                Can anybody think of a good tagline I can steal?

                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              • Donald Allen
                ... Yes. ... Now highlighting appears and everything works correctly. Starting vim normally like so: vim generate.scm and with this .vimrc set nocp filetype on
                Message 7 of 16 , Aug 27, 2011
                  On Sat, Aug 27, 2011 at 12:18 AM, Sergey Khorev <sergey.khorev@...> wrote:
                  > I copied the above line into a new buffer, so only line in
                  > the buffer. Same incorrect behavior (with matchparen enabled).

                  Can you try usual troubleshooting steps, i.e.

                  vim -U NONE -u NONE -N -c "filetype on | syntax on | set ft=scheme"

                  Now paste your line. Does % work ok?

                  Yes. 
                   
                  If so try :ru plugin/matchparen.vim and see whether it breaks anything or not.

                  Now highlighting appears and everything works correctly.

                  Starting vim normally like so:

                  vim generate.scm

                  and with this .vimrc

                  set nocp
                  filetype on
                  syntax on

                  Also results in correct behavior (the filetype detection correctly identifies this file as 'scheme' and sets the ft option properly -- I checked it with :set). However, if I remove the 'syntax on' from .vimrc:

                  set nocp
                  filetype on

                  the highlighting behavior is incorrect, but % works correctly!!

                  My original .vimrc had neither the 'filetype on' nor the 'syntax on' commands. Adding them fixes the problem. I'm grateful to you for helping me solve this. Many thanks.

                  I would offer the following comment, though. Perhaps editing scheme/lisp code is not a primary focus of vim, but it is supported. I'm a very experienced computer professional (now retired after 45 years of writing code -- much of it OS (IBM CP/67, PDP-10 Tenex and Tops20, Mach) internals in assembly language and C -- and managing software projects large and small) and it is by no means clear to me how I could have solved this without your help. There may be a bug or two here (e.g, why do % and highlighting go their separate ways when only 'filetype on' is specified?) and/or perhaps inadequate documentation on the issue of % and paren highlighting. It's also possible I just haven't dug hard enough in the documentation, though when % did not work correctly, I did the obvious -- I read :help %, which was of no help in dealing with this particular problem (no mention of filetype detection or syntax highlighting and certainly no mention anywhere that I have found that 'syntax on' is critical to getting the highlighting right, even though highlighting works without it, incorrectly, despite vim knowing it's editing scheme). The vimbook was not helpful either, though I realize it's pretty old. In my opinion, this should all work correctly by default (by this I mean that filetype detection should be on by default and the highlighting ought to work correctly without turning full syntax coloring on, which I'm guessing more would not want on by default) and not require a research project. If I can find the time (retired != not busy), I will have a look at the code and see if I can untangle this. I would also ask that people familiar with this code have a look, too.

                  Again, thanks very much for your help.

                  /Don
                   

                  --
                  Sergey Khorev
                  http://sites.google.com/site/khorser
                  Can anybody think of a good tagline I can steal?

                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php
                • Sergey Khorev
                  ... Glad this helped you. Speaking of Vim documentation, I should tell it is one of the best in the industry... well, if you studied user manual first and
                  Message 8 of 16 , Aug 27, 2011
                    > I'm grateful to you for helping me solve this. Many thanks.
                    > I would offer the following comment, though.

                    Glad this helped you. Speaking of Vim documentation, I should tell it
                    is one of the best in the industry... well, if you studied user manual
                    first and reviewed default vimrc in the distribution. Plus one of Vim
                    points is to be as much vi-compatible as possible.
                    I assume syntax is off because not all people like Christmas tree-like
                    highlighliting and it may slow down editing large files.

                    --
                    Sergey Khorev
                    http://sites.google.com/site/khorser
                    Can anybody think of a good tagline I can steal?

                    --
                    You received this message from the "vim_dev" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                  • Donald Allen
                    ... I don t deny that a *lot* of effort went into documenting vim. But that doesn t mean it can t be improved. ... Over time, I ve done all that. I ve used vim
                    Message 9 of 16 , Aug 27, 2011
                      On Sat, Aug 27, 2011 at 9:57 AM, Sergey Khorev <sergey.khorev@...> wrote:
                      > I'm grateful to you for helping me solve this. Many thanks.
                      > I would offer the following comment, though.

                      Glad this helped you. Speaking of Vim documentation, I should tell it
                      is one of the best in the industry...

                      I don't deny that a *lot* of effort went into documenting vim. But that doesn't mean it can't be improved.
                       
                      well, if you studied user manual
                      first and reviewed default vimrc in the distribution.

                      Over time, I've done all that. I've used vim off and on for about a year now. 
                       
                      Plus one of Vim
                      points is to be as much vi-compatible as possible.
                      I assume syntax is off because not all people like Christmas tree-like
                      highlighliting and it may slow down editing large files.

                      I said as much in my previous message: "highlighting ought to work correctly without turning full syntax coloring on, which I'm guessing most would not want on by default" (there was a typo in that phrase -- I typed 'more' when I meant 'most').

                      The more I think about this, the more convinced I am that there is an obvious bug here: without syntax on, paren highlighting is on but does does not work correctly in the case I've cited (though % does). For some reason, turning syntax on corrects this, but it shouldn't be necessary; highlighting ought to work correctly without it (and I may very well want highlighting without the "Christmas tree" effect you aptly described above). So I don't think this is so much a documentation issue as it is simply a bug in the code.

                      /Don

                       

                      --
                      Sergey Khorev
                      http://sites.google.com/site/khorser
                      Can anybody think of a good tagline I can steal?

                      --
                      You received this message from the "vim_dev" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      --
                      You received this message from the "vim_dev" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php
                    • Sergey Khorev
                      ... Agreed. ... The cause is simple: % is implemented in nv_percent function in Vim source and matchparen is a Vim plugin ($VIMRUNTIME/plugin/matchparen.vim)
                      Message 10 of 16 , Aug 27, 2011
                        > I don't deny that a *lot* of effort went into documenting vim. But that
                        > doesn't mean it can't be improved.

                        Agreed.

                        > I said as much in my previous message: "highlighting ought to work correctly
                        > without turning full syntax coloring on, which I'm guessing most would not
                        > want on by default" (there was a typo in that phrase -- I typed 'more' when
                        > I meant 'most').
                        > The more I think about this, the more convinced I am that there is an
                        > obvious bug here: without syntax on, paren highlighting is on but does does
                        > not work correctly in the case I've cited (though % does).

                        The cause is simple: % is implemented in nv_percent function in Vim
                        source and matchparen is a Vim plugin
                        ($VIMRUNTIME/plugin/matchparen.vim) which relies on the names of
                        syntax highlighting groups to skip over string literals etc.

                        --
                        Sergey Khorev
                        http://sites.google.com/site/khorser
                        Can anybody think of a good tagline I can steal?

                        --
                        You received this message from the "vim_dev" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php
                      • Donald Allen
                        ... You seem to be saying, then, that matchparen depends on syntax on to work correctly, at least in this case and perhaps others? If that s true, then
                        Message 11 of 16 , Aug 27, 2011
                          On Sat, Aug 27, 2011 at 11:23 AM, Sergey Khorev <sergey.khorev@...> wrote:
                          > I don't deny that a *lot* of effort went into documenting vim. But that
                          > doesn't mean it can't be improved.

                          Agreed.

                          > I said as much in my previous message: "highlighting ought to work correctly
                          > without turning full syntax coloring on, which I'm guessing most would not
                          > want on by default" (there was a typo in that phrase -- I typed 'more' when
                          > I meant 'most').
                          > The more I think about this, the more convinced I am that there is an
                          > obvious bug here: without syntax on, paren highlighting is on but does does
                          > not work correctly in the case I've cited (though % does).

                          The cause is simple: % is implemented in nv_percent function in Vim
                          source and matchparen is a Vim plugin
                          ($VIMRUNTIME/plugin/matchparen.vim) which relies on the names of
                          syntax highlighting groups to skip over string literals etc.

                          You seem to be saying, then, that matchparen depends on 'syntax on' to work correctly, at least in this case and perhaps others? If that's true, then matchparen ought to be disabled unless syntax is enabled, since it depends on it, and the documentation ought to explain that clearly. The current situation, where % does the right thing and highlighting does the wrong thing with syntax disabled, is clearly wrong.

                          /Don 

                          --
                          Sergey Khorev
                          http://sites.google.com/site/khorser
                          Can anybody think of a good tagline I can steal?

                          --
                          You received this message from the "vim_dev" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php

                          --
                          You received this message from the "vim_dev" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php
                        • Donald Allen
                          ... From :help matchparen: The syntax highlighting attributes are used. When the cursor currently is not in a string or comment syntax item, then matches
                          Message 12 of 16 , Aug 27, 2011
                            On Sat, Aug 27, 2011 at 11:44 AM, Donald Allen <donaldcallen@...> wrote:


                            On Sat, Aug 27, 2011 at 11:23 AM, Sergey Khorev <sergey.khorev@...> wrote:
                            > I don't deny that a *lot* of effort went into documenting vim. But that
                            > doesn't mean it can't be improved.

                            Agreed.

                            > I said as much in my previous message: "highlighting ought to work correctly
                            > without turning full syntax coloring on, which I'm guessing most would not
                            > want on by default" (there was a typo in that phrase -- I typed 'more' when
                            > I meant 'most').
                            > The more I think about this, the more convinced I am that there is an
                            > obvious bug here: without syntax on, paren highlighting is on but does does
                            > not work correctly in the case I've cited (though % does).

                            The cause is simple: % is implemented in nv_percent function in Vim
                            source and matchparen is a Vim plugin
                            ($VIMRUNTIME/plugin/matchparen.vim) which relies on the names of
                            syntax highlighting groups to skip over string literals etc.

                            You seem to be saying, then, that matchparen depends on 'syntax on' to work correctly, at least in this case and perhaps others? If that's true, then matchparen ought to be disabled unless syntax is enabled, since it depends on it, and the documentation ought to explain that clearly. The current situation, where % does the right thing and highlighting does the wrong thing with syntax disabled, is clearly wrong.

                            From :help matchparen:

                            "The syntax highlighting attributes are used.  When the cursor currently is not
                            in a string or comment syntax item, then matches inside string and comment
                            syntax items are ignored."

                            The statement about matches inside strings appears to not to be consistent with what the code is doing. Furthermore, this bit of documentation says nothing about requiring that syntax be enabled. It simply says that "The syntax highlighting attributes are used." Perhaps that implies that syntax needs to be enabled, I don't know, but it certainly doesn't say it explicitly. And, in any case, the user should not be responsible for manually enabling syntax if matchparen requires it for correct operation and is enabled. 

                            /Don 

                            --
                            Sergey Khorev
                            http://sites.google.com/site/khorser
                            Can anybody think of a good tagline I can steal?

                            --
                            You received this message from the "vim_dev" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php


                            --
                            You received this message from the "vim_dev" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php
                          • Donald Allen
                            This seems to have petered out without a resolution. I believe I made a valid point below that the documentation and the behavior of matchparen are not in
                            Message 13 of 16 , Aug 31, 2011
                              This seems to have petered out without a resolution. I believe I made
                              a valid point below that the documentation and the behavior of
                              matchparen are not in agreement. I would appreciate either
                              acknowledgement that it's a bug and that it's been entered into the
                              official bug db for future repair, or for someone to explain to me why
                              I'm wrong, if you believe that's the case.

                              /Don


                              ---------- Forwarded message ----------
                              From: Donald Allen <donaldcallen@...>
                              Date: Sat, Aug 27, 2011 at 11:52 AM
                              Subject: Re: Lisp/Scheme paren matching
                              To: vim_dev@...




                              On Sat, Aug 27, 2011 at 11:44 AM, Donald Allen <donaldcallen@...> wrote:
                              >
                              >
                              > On Sat, Aug 27, 2011 at 11:23 AM, Sergey Khorev <sergey.khorev@...> wrote:
                              >>
                              >> > I don't deny that a *lot* of effort went into documenting vim. But that
                              >> > doesn't mean it can't be improved.
                              >>
                              >> Agreed.
                              >>
                              >> > I said as much in my previous message: "highlighting ought to work correctly
                              >> > without turning full syntax coloring on, which I'm guessing most would not
                              >> > want on by default" (there was a typo in that phrase -- I typed 'more' when
                              >> > I meant 'most').
                              >> > The more I think about this, the more convinced I am that there is an
                              >> > obvious bug here: without syntax on, paren highlighting is on but does does
                              >> > not work correctly in the case I've cited (though % does).
                              >>
                              >> The cause is simple: % is implemented in nv_percent function in Vim
                              >> source and matchparen is a Vim plugin
                              >> ($VIMRUNTIME/plugin/matchparen.vim) which relies on the names of
                              >> syntax highlighting groups to skip over string literals etc.
                              >
                              > You seem to be saying, then, that matchparen depends on 'syntax on' to work correctly, at least in this case and perhaps others? If that's true, then matchparen ought to be disabled unless syntax is enabled, since it depends on it, and the documentation ought to explain that clearly. The current situation, where % does the right thing and highlighting does the wrong thing with syntax disabled, is clearly wrong.

                              From :help matchparen:
                              "The syntax highlighting attributes are used.  When the cursor currently is not
                              in a string or comment syntax item, then matches inside string and comment
                              syntax items are ignored."
                              The statement about matches inside strings appears to not to be
                              consistent with what the code is doing. Furthermore, this bit of
                              documentation says nothing about requiring that syntax be enabled. It
                              simply says that "The syntax highlighting attributes are used."
                              Perhaps that implies that syntax needs to be enabled, I don't know,
                              but it certainly doesn't say it explicitly. And, in any case, the user
                              should not be responsible for manually enabling syntax if matchparen
                              requires it for correct operation and is enabled.
                              >
                              > /Don
                              >>
                              >> --
                              >> Sergey Khorev
                              >> http://sites.google.com/site/khorser
                              >> Can anybody think of a good tagline I can steal?
                              >>
                              >> --
                              >> You received this message from the "vim_dev" maillist.
                              >> Do not top-post! Type your reply below the text you are replying to.
                              >> For more information, visit http://www.vim.org/maillist.php
                              >

                              --
                              You received this message from the "vim_dev" maillist.
                              Do not top-post! Type your reply below the text you are replying to.
                              For more information, visit http://www.vim.org/maillist.php
                            • Sergey Khorev
                              ... User-contributed patches are highly appreciated here. -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the
                              Message 14 of 16 , Sep 1, 2011
                                > This seems to have petered out without a resolution. I believe I made
                                > a valid point below that the documentation and the behavior of
                                > matchparen are not in agreement. I would appreciate either
                                > acknowledgement that it's a bug and that it's been entered into the
                                > official bug db for future repair, or for someone to explain to me why
                                > I'm wrong, if you believe that's the case.

                                User-contributed patches are highly appreciated here.

                                --
                                You received this message from the "vim_dev" maillist.
                                Do not top-post! Type your reply below the text you are replying to.
                                For more information, visit http://www.vim.org/maillist.php
                              • Donald Allen
                                ... I m happy to help if I can, but I don t want to waste my time trying to fix a non-existent bug, so I would like the question I raised in the above message
                                Message 15 of 16 , Sep 1, 2011
                                  On Thu, Sep 1, 2011 at 1:53 PM, Sergey Khorev <sergey.khorev@...> wrote:
                                  >> This seems to have petered out without a resolution. I believe I made
                                  >> a valid point below that the documentation and the behavior of
                                  >> matchparen are not in agreement. I would appreciate either
                                  >> acknowledgement that it's a bug and that it's been entered into the
                                  >> official bug db for future repair, or for someone to explain to me why
                                  >> I'm wrong, if you believe that's the case.
                                  >
                                  > User-contributed patches are highly appreciated here.

                                  I'm happy to help if I can, but I don't want to waste my time trying
                                  to fix a non-existent bug, so I would like the question I raised in
                                  the above message answered: do you or do you not believe matchparen
                                  flashing parens inside strings is a bug? If so, when I have time, I'll
                                  try to fix it. It should also get recorded in the bug database, so it
                                  doesn't get forgotten.

                                  /Don

                                  >
                                  > --
                                  > You received this message from the "vim_dev" maillist.
                                  > Do not top-post! Type your reply below the text you are replying to.
                                  > For more information, visit http://www.vim.org/maillist.php
                                  >

                                  --
                                  You received this message from the "vim_dev" maillist.
                                  Do not top-post! Type your reply below the text you are replying to.
                                  For more information, visit http://www.vim.org/maillist.php
                                • Sergey Khorev
                                  ... I am by no means a maintainer of Vim so I can only say for myself. I believe it s not a bug but an undocumented feature and I would suggest to update
                                  Message 16 of 16 , Sep 1, 2011
                                    > I'm happy to help if I can, but I don't want to waste my time trying
                                    > to fix a non-existent bug, so I would like the question I raised in
                                    > the above message answered: do you or do you not believe matchparen
                                    > flashing parens inside strings is a bug? If so, when I have time, I'll
                                    > try to fix it. It should also get recorded in the bug database, so it
                                    > doesn't get forgotten.

                                    I am by no means a maintainer of Vim so I can only say for myself. I
                                    believe it's not a bug but an undocumented feature and I would suggest
                                    to update documentation instead and maybe add an alert in matchparen
                                    script if syntax highlighting is off.

                                    Speaking if the bug database, there are two ones: :help todo inside
                                    Vim and http://code.google.com/p/vim/issues/list.
                                    Frankly I doubt that adding this to any of the databases will do any
                                    good: there are too many real bugs in the todo list.

                                    --
                                    Sergey Khorev
                                    http://sites.google.com/site/khorser
                                    Can anybody think of a good tagline I can steal?

                                    --
                                    You received this message from the "vim_dev" maillist.
                                    Do not top-post! Type your reply below the text you are replying to.
                                    For more information, visit http://www.vim.org/maillist.php
                                  Your message has been successfully submitted and would be delivered to recipients shortly.