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

Re: echo message missing

Expand Messages
  • Yakov Lerner
    ... Will inserting redraw command before echo help ? Like this: func! SaveSession() mksession! aaaSession.vse redraw echo Session saved endfunction This
    Message 1 of 5 , May 2 12:23 AM
    • 0 Attachment
      On 5/2/06, Robert Webb <RobertW@...> wrote:
      > I have the following in my _vimrc file:
      >
      > func! SaveSession()
      > mksession! aaaSession.vse
      > echo "Session saved"
      > endfunction
      > command! -nargs=0 S call SaveSession()
      >
      > But now, when I have more than one tab open (on Windows2000) and use
      > my ":S" command, I no longer see the message "Session saved" at the
      > bottom of the screen. Shouldn't my echoed message still be there?

      Will inserting "redraw" command before echo help ? Like this:

      func! SaveSession()
      mksession! aaaSession.vse
      redraw
      echo "Session saved"
      endfunction

      This happens also in other situations without tabs.
      What erases the message is automatic redraw at the
      end of scripted sequence.
      Inserting the redraw before echo cancels the automatic
      after-redraw.

      Yakov
    • Robert Webb
      ... You re right, this fixes it. Thanks. But is it a bug still that the echo message is lost due to a redraw caused by an earlier command? Maybe when echo
      Message 2 of 5 , May 2 12:35 AM
      • 0 Attachment
        > Will inserting "redraw" command before echo help ? Like this:
        >
        > func! SaveSession()
        > mksession! aaaSession.vse
        > redraw
        > echo "Session saved"
        > endfunction

        You're right, this fixes it. Thanks.
        But is it a bug still that the echo message is lost due
        to a redraw caused by an earlier command? Maybe when echo
        goes to the screen, any pending redraw should be carried
        out first?

        Rob.

        --

        Robert Webb <RobertW@...>,
        Want to make polyhedra?
        http://www.software3d.com/Stella.html
      • Yakov Lerner
        ... I agree, it s inconvenient. It would be less surprising if automatic redraw not clear the single-line message on commandline. Out of 3 kinds of redraw
        Message 3 of 5 , May 2 12:50 AM
        • 0 Attachment
          On 5/2/06, Robert Webb <RobertW@...> wrote:
          > > Will inserting "redraw" command before echo help ? Like this:
          > >
          > > func! SaveSession()
          > > mksession! aaaSession.vse
          > > redraw
          > > echo "Session saved"
          > > endfunction
          >
          > You're right, this fixes it. Thanks.
          > But is it a bug still that the echo message is lost due
          > to a redraw caused by an earlier command? Maybe when echo
          > goes to the screen, any pending redraw should be carried
          > out first?

          I agree, it's inconvenient. It would be less surprising if
          'automatic redraw' not clear the single-line message
          on commandline.

          Out of 3 kinds of redraw
          (1) Ctrl-L
          (2) :redraw
          (3) automatic redraw not caused by (1) or (2)
          , I'd prefer that (3) not clear single-line message
          on commandline, and (1) did.

          Regarding (2), I'm not sure. Maybe :redraw! better
          clear but :redraw not ?

          Yakov
        • Bram Moolenaar
          ... A redraw may actually clear a message. This is tricky stuff. It s better to leave it as it is, otherwise the scripts that were carefully tuned with how
          Message 4 of 5 , May 2 5:17 AM
          • 0 Attachment
            Robert Webb wrote:

            > > Will inserting "redraw" command before echo help ? Like this:
            > >
            > > func! SaveSession()
            > > mksession! aaaSession.vse
            > > redraw
            > > echo "Session saved"
            > > endfunction
            >
            > You're right, this fixes it. Thanks.
            > But is it a bug still that the echo message is lost due
            > to a redraw caused by an earlier command? Maybe when echo
            > goes to the screen, any pending redraw should be carried
            > out first?

            A redraw may actually clear a message. This is tricky stuff. It's
            better to leave it as it is, otherwise the scripts that were carefully
            tuned with how it currently works will break.

            --
            Westheimer's Discovery:
            A couple of months in the laboratory can
            frequently save a couple of hours in the library.

            /// 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.