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

Re: Incomplete :echo output in autocmds

Expand Messages
  • glts
    Hi asking for confirmation of flaky :echo behaviour in autocommands. In a nutshell: Echoing more than one line from within an autocommand is unreliable. The
    Message 1 of 6 , Dec 8, 2012
    • 0 Attachment
      Hi

      asking for confirmation of flaky :echo behaviour in autocommands.

      In a nutshell: Echoing more than one line from within an autocommand is
      unreliable. The message may be shown in its entirety or partly,
      depending on what type of event it is attached to.

      I tried the following command with a number of autocommand events:

      command! Echo redraw | echomsg 'First line' | echomsg 'Second line'

      ColorScheme OK
      FileType OK
      WinEnter (:sp, :vsp) OK
      WinEnter (CTRL-W ...) truncated
      CursorHold truncated
      InsertLeave truncated
      FocusGained truncated
      QuickFixCmdPost truncated

      I would be glad if somebody could confirm what I am seeing, so I can set
      this aside as a Vim-problem and not a me-problem.

      Thanks, glts

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Christian Brabandt
      Hi glts! ... I have seen the issue, but haven t found the problem yet. Is there any reason, why you are not using :echo? regards, Christian -- Tats├Ąchlich
      Message 2 of 6 , Dec 8, 2012
      • 0 Attachment
        Hi glts!

        On Sa, 08 Dez 2012, glts wrote:

        > asking for confirmation of flaky :echo behaviour in autocommands.
        >
        > In a nutshell: Echoing more than one line from within an autocommand is
        > unreliable. The message may be shown in its entirety or partly,
        > depending on what type of event it is attached to.
        >
        > I tried the following command with a number of autocommand events:
        >
        > command! Echo redraw | echomsg 'First line' | echomsg 'Second line'
        >
        > ColorScheme OK
        > FileType OK
        > WinEnter (:sp, :vsp) OK
        > WinEnter (CTRL-W ...) truncated
        > CursorHold truncated
        > InsertLeave truncated
        > FocusGained truncated
        > QuickFixCmdPost truncated

        I have seen the issue, but haven't found the problem yet. Is there any
        reason, why you are not using :echo?

        regards,
        Christian
        --
        Tats├Ąchlich sind es die wichtigsten Momente im Leben, wenn wir allein
        sind.
        -- Anne Morrow Lindbergh

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • glts
        Hi Christian, thank you for answering. ... No reason. It doesn t matter, however, as the behaviour is the same regardless of whether I use :echo or :echomsg.
        Message 3 of 6 , Dec 8, 2012
        • 0 Attachment
          Hi Christian,

          thank you for answering.

          On Saturday, December 8, 2012 1:07:48 PM UTC+1, Christian Brabandt wrote:
          > I have seen the issue, but haven't found the problem yet. Is there any
          > reason, why you are not using :echo?

          No reason. It doesn't matter, however, as the behaviour is the same
          regardless of whether I use :echo or :echomsg. At least with :echomsg
          I can see the output via :messages.

          glts

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Christian Brabandt
          Hi glts! ... Hm, strange, but if you define ... it does not get truncated. So this is at least a workaround. regards, Christian -- Der Fuchs wechselt den Balg,
          Message 4 of 6 , Dec 9, 2012
          • 0 Attachment
            Hi glts!

            On Sa, 08 Dez 2012, glts wrote:

            > Hi Christian,
            >
            > thank you for answering.
            >
            > On Saturday, December 8, 2012 1:07:48 PM UTC+1, Christian Brabandt wrote:
            > > I have seen the issue, but haven't found the problem yet. Is there any
            > > reason, why you are not using :echo?
            >
            > No reason. It doesn't matter, however, as the behaviour is the same
            > regardless of whether I use :echo or :echomsg. At least with :echomsg
            > I can see the output via :messages.

            Hm, strange, but if you define
            :command! Echo redraw | echo "First line \nSecond line"
            it does not get truncated. So this is at least a workaround.


            regards,
            Christian
            --
            Der Fuchs wechselt den Balg, nicht den Charakter.
            -- Gaius Suetonius (70 n.Chr.-?)

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • glts
            Hi Christian, ... A poor workaround, unfortunately. It works with :echo but not with ... line) differently. I would look into this myself, but honestly I don t
            Message 5 of 6 , Dec 9, 2012
            • 0 Attachment
              Hi Christian,

              On Sunday, December 9, 2012 3:06:20 PM UTC+1, Christian Brabandt wrote:
              > Hm, strange, but if you define
              > :command! Echo redraw | echo "First line \nSecond line"
              > it does not get truncated. So this is at least a workaround.

              A poor workaround, unfortunately. It works with :echo but not with
              :echomsg, and it isn't possible to highlight the lines (or part of a
              line) differently.

              I would look into this myself, but honestly I don't know where to start
              because messages and autocommands don't seem to have anything to do with
              one another ...

              glts

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            Your message has been successfully submitted and would be delivered to recipients shortly.