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

Re: Problem with patch 274

Expand Messages
  • Bram Moolenaar
    ... Correct. Updating the visible text for syntax HL is not that slow. The problem with folds is that also the text that is folded away must be inspected for
    Message 1 of 7 , Jan 6, 2010
    • 0 Attachment
      Ben Fritz wrote:

      > On Jan 5, 5:25=A0am, Bram Moolenaar <B...@...> wrote:
      > > I haven't looked at the details, but if the problem is that folding is
      > > being updated while inserting text, we could postpone the updating until
      > > Insert mode is ended. =A0The cursor line won't be folded anyway, and
      > > typing more text is likely to change folds again. =A0Moving the cursor
      > > also is counted as leaving Insert mode, this is in stop_insert().
      > >
      >
      > You're talking only about waiting to update the syntax folding, not
      > the syntax highlighting, correct? I really like the idea of postponing
      > the update of the folding. First, there's the speed issue mentioned
      > above. Secondly, I often get in the situation where I have carefully
      > closed various folds in my file, then go to insert a comment or
      > something else that opens a fold, and all the folds later in the file
      > get opened automatically. Waiting to update the folds would
      > potentially help or solve both these issues.
      >
      > I don't like the idea of waiting until ending insert mode for updating
      > syntax highlighting, though. I think it would eliminate one of the
      > most useful features of syntax highlighting, which is a limited on-the-
      > fly syntax check. You were just talking about the folding, correct?

      Correct. Updating the visible text for syntax HL is not that slow. The
      problem with folds is that also the text that is folded away must be
      inspected for syntax HL.

      It can still be slow if syntax HL has to resync after a closed fold.
      Depending on the settings it can mean al the folded lines have to be
      inspected for syntax HL. E.g. for C a /* inside a fold must be found to
      dedice if the lines below the fold are a comment.

      --
      Warning label on a superhero Halloween costume:
      "Caution: Cape does not enable user to fly."

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.