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

Re: patch: cursorhold event in insert, visual mode

Expand Messages
  • Michal Vitecek
    hello Bram, ... that, of course, i don t know. all i can say is that the patched vim runs correctly on my box both in gui and console mode. i m using the
    Message 1 of 6 , Oct 2, 2002
    • 0 Attachment
      hello Bram,

      Bram Moolenaar wrote:
      >Michal Vitecek wrote:
      >
      >> this little patch adds firing up of CursorHold event in INSERT and
      >> VISUAL mode. i hope i'm not ruining vim's code too much with this.
      >
      >Problem with this is that CursorHold autocommands might not work in
      >Insert and Visual mode. I suspect there could be unwanted side effects.
      >
      >Perhaps CursorHoldVisual and CursorHoldInsert events would help, but
      >they still need to be tested with various commands. Autocommands are
      >very dangerous, they can cause lots of trouble (including crashes).

      that, of course, i don't know. all i can say is that the patched vim
      runs correctly on my box both in gui and console mode.

      i'm using the CursorHold event to display what class/method/function
      i'm currently in in python code i'm editing (i wrote a python script to
      determine this) on status line and it works and hasn't crashed on me so
      far, but that is a weak argument, i know.

      --
      fuf (fuf@...)
    • Michal Vitecek
      hello Bram, have you had time to do some investigation on the issue? what side effect could that be? maybe this patch could be tested by more people? it still
      Message 2 of 6 , Oct 23, 2002
      • 0 Attachment
        hello Bram,

        have you had time to do some investigation on the issue? what side
        effect could that be? maybe this patch could be tested by more people?
        it still works for me all okay without any glitches (i'm using it with
        http://www.vim.org/script.php?script_id=435).

        thank you,

        Bram Moolenaar wrote:
        >Michal Vitecek wrote:
        >
        >> this little patch adds firing up of CursorHold event in INSERT and
        >> VISUAL mode. i hope i'm not ruining vim's code too much with this.
        >
        >Problem with this is that CursorHold autocommands might not work in
        >Insert and Visual mode. I suspect there could be unwanted side effects.
        >
        >Perhaps CursorHoldVisual and CursorHoldInsert events would help, but
        >they still need to be tested with various commands. Autocommands are
        >very dangerous, they can cause lots of trouble (including crashes).

        --
        fuf (fuf@...)
      • Bram Moolenaar
        Michal Viticek wrote: [about using CursorHold* events in Insert and Visual mode.] ... No. I probably won t look into this in the near future. ... Vim could
        Message 3 of 6 , Oct 24, 2002
        • 0 Attachment
          Michal Viticek wrote:

          [about using CursorHold* events in Insert and Visual mode.]

          > have you had time to do some investigation on the issue?

          No. I probably won't look into this in the near future.

          > what side effect could that be? maybe this patch could be tested by
          > more people?

          Vim could crash. Autocommands are very tricky, the commands may change
          just about anything. Especially watch out for pointers that become
          invalid. Thus this requires staring at the code and testing with
          "torture" examples. Quite a bit of work, that's why I haven't looked
          into this.

          --
          Apologies for taking up the bandwidth with the apology. Anything else I
          can apologise for ...... er no can't think of anything, sorry about that.
          Andy Hunt (Member of British Olympic Apology Squad)

          /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
          /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
          \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
          \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
        Your message has been successfully submitted and would be delivered to recipients shortly.