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

Re: syntax highlighting for chemistry script files

Expand Messages
  • Rahul
    ... [snip] ... A modified version of the basic scheme that AP gave me works perfectly for my syntax highlighting. Thanks AP! I have a subsidiary issue now
    Message 1 of 9 , Apr 8, 2008
    • 0 Attachment
      On Mar 28, 6:19 am, "A.Politz" <poli...@...> wrote:
      > Well, here is an example.
      >
      > syn region PosReg start=/^Positions =/ end=/;/ keepend contains=Pos,L?
      > syn match Pos /^Positions =.*\n/ nextgroup=L1 contained
      > syn match L1 /.*\n/ nextgroup=L2 contained
      > syn match L2 /.*\n/ nextgroup=L3 contained
      > syn match L3 /.*\n/ nextgroup=L4 contained

      [snip]

      > Positions =
      > 1.2, 1.3, 1.3,
      > 2.3455, 2.34, 234,
      > 1.2, 3.4, 5.6;
      >
      > Species =
      > " C",
      > " H",
      > " Cu";


      A modified version of the basic scheme that AP gave me works perfectly
      for my syntax highlighting. Thanks AP! I have a subsidiary issue now
      though: Let's say a person opens for edit the file-example AP quotes
      above. I've everything correctly highlighted.

      Now for some reason he wants to swap the order of C and H (and their
      corresponding corrdinate lines) Now the color highlighting for the
      cordinate lines here gets messed up. (While he swaps those lines say
      with a dd p we go through an intermediate inconsistent state where the
      length of the two arrays are not the same.) The second issue is even
      more subtle. Its impossible to do both swaps (i.e. on Species and
      Coordinates) at the same time. One will precede the other. Let's say
      he first swaps C and H. I don't want the coordinate colors to
      immediately reflect that since that would be unrealistic.

      Is there a way so that only for this part (coordinate lines) make all
      lines stay with their original colors until the user expressly
      requests a reparse?

      Right now, the highlighting seems somewhat arbitrarily synced when I
      swap stuff around. If I close and reopen it is all again correct.

      Any ideas?

      -Rahul


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.