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

139151matlab and matchit

Expand Messages
  • Charles Campbell
    Sep 13, 2013

      I sent this to Benji Fisher over a week ago; is he still active?
      I've been annoyed for awhile at [vimruntime]/ftplugin/matlab.vim's %
      handling -- which, of course, depends upon matchit. I've attached
      "junk.m" which illustrates the problem; place cursor on "for", hit "%" a
      few times, and you'll see the cursor bounce to the wrong "end". Place
      the cursor on "switch", press "%" a few times, and the cursor gets stuck
      on "end".

      The runtime-distribution has

      if exists("loaded_matchit")
      let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!'
      let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' .
      \ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' .
      \ s:conditionalEnd

      This seems to me to treat if/while/for/switch as equivalents -- so I've
      tried the following variant:

      if exists("loaded_matchit")
      " let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!'
      let s:conditionalEnd = '^\s*end\>'
      let b:match_words = '\<if\>:\<elseif\>:\<else\>:'.s:conditionalEnd.','.

      So, neither variant works. Am I doing something wrong or is there a
      problem with matchit?

      Hope this is fixable,
      Chip Campbell

      You received this message from the "vim_use" 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 because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.