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

autocmd CursorMoved and ctrl-d: bug?

Expand Messages
  • mobi phil
    Hello, I am often going fast through large files, and would like to have displayed information when moving around. We have autocmd CursorMoved for that. It
    Message 1 of 5 , Oct 14, 2009
      Hello,

      I am often going fast through large files, and would like to have
      displayed information when moving around.

      We have autocmd CursorMoved for that. It works nice, when moving with
      hjkl, but if I switch gear (ctrl-d, ctrl-u),
      it stops working, that is the event is not triggered



      thanks for your opinion/help etc.

      mobiphil



      --
      rgrds,
      mobi phil

      being mobile, but including technology
      http://mobiphil.com

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • mobi phil
      ... I have the answer myself. CursorMoved is triggered when the cursor pos has moved relative to the display and not relative to the text. Would be however
      Message 2 of 5 , Oct 14, 2009
        > I am often going fast through large files, and would like to have
        > displayed information when moving around.
        >
        > We have autocmd CursorMoved for that. It works nice, when moving with
        > hjkl, but if I switch gear  (ctrl-d, ctrl-u),
        > it stops working, that is the event is not triggered

        I have the answer myself. CursorMoved is triggered when the cursor pos
        has moved
        relative to the display and not relative to the text.


        Would be however usefull to have sthg. TextMoved as well, so that either
        CursorMoved or TextMoved when the user does any movement...

        At the moment the CorsorHold event solved my problem




        > --
        > rgrds,
        > mobi phil
        >
        > being mobile, but including technology
        > http://mobiphil.com
        >



        --
        rgrds,
        mobi phil

        being mobile, but including technology
        http://mobiphil.com

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • James Vega
        ... Actually, the event is being triggered. You can verify this with the following autocmd: au CursorMoved * :echom strftime( %T ) Check :messages before
        Message 3 of 5 , Oct 14, 2009
          On Wed, Oct 14, 2009 at 12:25 PM, mobi phil <mobi@...> wrote:
          > I am often going fast through large files, and would like to have
          > displayed information when moving around.
          >
          > We have autocmd CursorMoved for that. It works nice, when moving with
          > hjkl, but if I switch gear (ctrl-d, ctrl-u),
          > it stops working, that is the event is not triggered

          Actually, the event is being triggered. You can verify this with the
          following autocmd:

          au CursorMoved * :echom strftime('%T')

          Check ":messages" before and after using <C-d>/<C-u>. The problem seems
          to be that the screen is being redrawn so you lose the displayed
          information. The same problem happens (at least with this trivial
          example) when you use j or k to scroll the screen.

          Depending on your use-case, putting the information into the statusline
          might work better.

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • mobi phil
          Thanks... interesting... so could be considered as a bug at the end, or? I already put the stuff into the status line... it seems the most natural solution,
          Message 4 of 5 , Oct 14, 2009
            Thanks... interesting... so could be considered as a bug at the end, or?

            I already put the stuff into the status line... it seems the most
            natural solution, however status line is just one line... so limited
            space.. but that is the challenge to find good encodings..

            On Wed, Oct 14, 2009 at 6:35 PM, James Vega <jamessan@...> wrote:
            >
            > On Wed, Oct 14, 2009 at 12:25 PM, mobi phil <mobi@...> wrote:
            >> I am often going fast through large files, and would like to have
            >> displayed information when moving around.
            >>
            >> We have autocmd CursorMoved for that. It works nice, when moving with
            >> hjkl, but if I switch gear  (ctrl-d, ctrl-u),
            >> it stops working, that is the event is not triggered
            >
            > Actually, the event is being triggered.  You can verify this with the
            > following autocmd:
            >
            >  au CursorMoved * :echom strftime('%T')
            >
            > Check ":messages" before and after using <C-d>/<C-u>.  The problem seems
            > to be that the screen is being redrawn so you lose the displayed
            > information.  The same problem happens (at least with this trivial
            > example) when you use j or k to scroll the screen.
            >
            > Depending on your use-case, putting the information into the statusline
            > might work better.
            >
            > >
            >



            --
            rgrds,
            mobi phil

            being mobile, but including technology
            http://mobiphil.com

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Andy Wokula
            ... Works here too. ... Usually, in that case, a :redraw just before :echo will help. ... -- Andy --~--~---------~--~----~------------~-------~--~----~ You
            Message 5 of 5 , Oct 14, 2009
              James Vega schrieb:
              > On Wed, Oct 14, 2009 at 12:25 PM, mobi phil <mobi@...> wrote:
              >> I am often going fast through large files, and would like to have
              >> displayed information when moving around.
              >>
              >> We have autocmd CursorMoved for that. It works nice, when moving with
              >> hjkl, but if I switch gear (ctrl-d, ctrl-u),
              >> it stops working, that is the event is not triggered
              >
              > Actually, the event is being triggered. You can verify this with the
              > following autocmd:
              >
              > au CursorMoved * :echom strftime('%T')

              Works here too.

              > Check ":messages" before and after using <C-d>/<C-u>. The problem seems
              > to be that the screen is being redrawn so you lose the displayed
              > information. The same problem happens (at least with this trivial
              > example) when you use j or k to scroll the screen.

              Usually, in that case, a :redraw just before :echo will help.

              > Depending on your use-case, putting the information into the statusline
              > might work better.

              --
              Andy


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