Uploaded image for project: 'Funtoo Linux'
  1. Funtoo Linux
  2. FL-3439

vim syntax highlight error matching(%) brace

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Minor Minor
    • None
    • None

      Matching brace error in vim. This was found in a zsh script, but it would most likely happen in other scripting languages.

      Vim matching fails to ignore braces in lines that have been commented out. Vim can do normal highlighting across commented code without a problem, but finding a matching brace fails.

      Sample Code:

      DoIt ()
      {
        #[ something ] && {
        [ somethingelse ] && {
          :
        }
      }
      

      Commented out a [test] while checking out a [different test]. The script runs without any issues, but vim syntax highlight has a matching issue. As seen in the attached file vim_matching_issue_01.png, the cursor is on the opening brace below the function declaration Doit, and the matching highlight is on the brace at the end of the function. Typing % character should move the cursor to the brace at the end of the function, but nothing happens. Manually moving the cursor to the brace at the end of the function produces a highlight as expected on the opening brace below the function declaration Doit as seen in the attached file vim_matching_issue_02.png. Typing the % character moves the cursor to the opening brace at the end of the line that is commented out and highlights the end brace at the end of the function as seen in the attached file vim_matching_issue_03.png.

      This was verified on both vim 7.4 and 8.0.

      This should be an upstream issue for the vim developers.

      Thanks,

      Jim

            Unassigned Unassigned
            friartek friartek [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: