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

135428Re: help on syntax file for fixed-width record files

Expand Messages
  • Vlad Irnov
    Jan 9, 2013
    • 0 Attachment
      On 1/9/13, Boris Danilov <brdanilov@...> wrote:
      > Dan,
      >> I mostly understood *what* was happening, just not how to fix it.
      >> Unfortunately your solution didn't work for me.
      > This solution is potentially slower because it rematches everything
      > several times. If your strings are really that long on some stage you
      > might encounter a lag. My idea was to just tell vim what syntax group
      > comes next, not sure what was wrong.

      Hi Boris,
      your method does work when I try it like this:

      :syntax match ARecord_RecordType "^A" nextgroup=ARecord_RecordCount
      :syntax match ARecord_RecordCount ".\{9}"
      nextgroup=ARecord_OriginatorID contained
      :syntax match ARecord_OriginatorID ".\{10}" contained

      :highlight ARecord_RecordType ctermfg=blue guifg=blue
      :highlight ARecord_RecordCount ctermfg=red guifg=red
      :highlight ARecord_OriginatorID ctermfg=yellow guifg=yellow

      It is not obvious to me why this should be (much) faster than the
      method with CONTAINS. That needs to be tested by profiling.


      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
    • Show all 10 messages in this topic