Wednesday, September 2, 2015

Making matchit.vim work properly in angularjs

Hello,

I've been using matchit.vim for ages and I love it.

Lately, as I work in my employer's angularjs codebase, I've noticed that matchit gets confused by tags that are wrapped over several lines: it can match forward, but not backwards.

Here's the relevant portion of my definition of b:match_words:

<\([\:0-9A-Za-z_-]\+\)[^>]*:<\/\1[^>]*>

It's basically identical to the definition for regular HTML tag-matching, except that I removed the requirement to match ">" in the open tag, because we do things like this:

<li ng-repeat="action in cases_more_actions"
ng-click="do_action(the_case, action); $event.stopPropagation();"
ng-disabled="disable_action_menu_item(the_case, action)"
tooltip-popup-delay="700" tooltip-placement="left"
tooltip-html-unsafe="{{action_tool_tip(action, the_case)}}"
tooltip-append-to-body="true" class="{{action.action}}">

</li>

With the insertion point on the beginning of that absurdly long li opening tag, pressing % jumps me to the closing tag. At that point, I'm stuck: it won't to back.

Any advice?

Thanks in advance,

Dave

--
--
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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: