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

Re: possible syntax bug: transparent region unaware of he= in containing region

Expand Messages
  • Bram Moolenaar
    ... +++ syntax.c 20 Nov 2004 14:34:54 -0000 @@ -2439,6 +2443,8 @@ { sip- si_attr = CUR_STATE(idx - 1).si_attr; sip- si_trans_id = CUR_STATE(idx -
    Message 1 of 2 , Nov 20, 2004
      Brett Stahlman wrote:

      > If you have a syntax region, which uses "he=" to highlight only a
      > portion of the region, and you have a contained transparent region,
      > the transparent region causes the highlighting of the containing
      > region to show through, even if the transparent region begins in a
      > location where highlighting in the containing region has been turned
      > off by the "he=".
      >
      > This is non-intuitive, since when you use transparent, you expect that
      > there will be no visual indication that the transparent region exists.
      > Here's a problem scenario:
      >
      > You highlight a region's first char only as Error. This region
      > contains a transparent region, which appears much later within the
      > region (not within Error highlighting). The transparent region also
      > appears as Error...
      >
      > Is this a bug?

      I suppose you can call it a bug. This patch should avoid the problem:

      --- syntax.c 7 Oct 2004 20:56:39 -0000 1.5
      +++ syntax.c 20 Nov 2004 14:34:54 -0000
      @@ -2439,6 +2443,8 @@
      {
      sip->si_attr = CUR_STATE(idx - 1).si_attr;
      sip->si_trans_id = CUR_STATE(idx - 1).si_trans_id;
      + sip->si_h_startpos = CUR_STATE(idx - 1).si_h_startpos;
      + sip->si_h_endpos = CUR_STATE(idx - 1).si_h_endpos;
      if (sip->si_cont_list == NULL)
      {
      sip->si_flags |= HL_TRANS_CONT;


      --
      FATHER: We are here today to witness the union of two young people in the
      joyful bond of the holy wedlock. Unfortunately, one of them, my son
      Herbert, has just fallen to his death.
      [Murmurs from CROWD; the BRIDE smiles with relief, coughs.]
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.