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

echo shown nothing before a dialog

Expand Messages
  • Vincent Birebent
    Hi, I m new to this list, so please apologize if I ask wrongly. ... The first Hey! shows, but none of the following echos. It leaves blank lines instead. It
    Message 1 of 6 , Feb 1, 2009
    • 0 Attachment
      Hi,

      I'm new to this list, so please apologize if I ask wrongly.

      When I source that:

      :echo "Hey!"
      :let choice = 0
      :while choice < 3
      : let choice = confirm("Why?", "&Why not?\nBecau&Se\n&Quit", 3)
      : if choice == 1
      : echo "Because I'm asking"
      : elseif choice == 2
      : echo "Not getting near an answer..."
      : endif
      :endwhile

      The first "Hey!" shows, but none of the following echos. It leaves
      blank lines instead. It works on regular vim...

      Also (probably noobish question): in vim after I type ":" I can get
      last entered commands by using down arrow (and after ":m" all former
      commands begining with ":m"...). Doesn't seems to work on Macvim... Am
      I wrong?

      Thanks.



      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • John Little
      ... Works for me, sort of. Do you mean you have a problem with gvim, but it works for console vim? With console vim, I get an extra blank line, f. ex.: Hey!
      Message 2 of 6 , Feb 2, 2009
      • 0 Attachment
        On Feb 2, 1:35 am, Vincent Birebent asked:
        >
        > When I source that:
        ><snip>
        > The first "Hey!" shows, but none of the following echos. It leaves  
        > blank lines instead. It works on regular vim...

        Works for me, sort of. Do you mean you have a problem with gvim, but
        it works for console vim?

        With console vim, I get an extra blank line, f. ex.:

        Hey!
        Why?

        Not getting near an answer...
        Why?

        Because I'm asking
        Why?
        (W)hy not?, Becau(S)e, [Q]uit:

        With gvim, I get the echoed text on the last line (if I click the
        first or second button), but there's an extra blank line inserted,
        pushing vim's displayed text and status line up the screen; clunky.
        After Quit gvim redraws correctly.

        Regards, John








        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Vincent Birebent
        Hi John, With gvim I get only the first Because... or Not getting.. and afterward only blank lines inserted. Anyway I don t think this little difference
        Message 3 of 6 , Feb 2, 2009
        • 0 Attachment
          Hi John,

          With gvim I get only the first "Because..." or "Not getting.." and
          afterward only blank lines inserted.

          Anyway I don't think this little difference between vim and gvim is
          relevant because I have just added a "\n" to all my echos and
          everything is fine now.

          Thanks,

          Vincent.

          Le Feb 2, 2009 à 10:29 AM, John Little a écrit :
          >
          > With gvim, I get the echoed text on the last line (if I click the
          > first or second button), but there's an extra blank line inserted,
          > pushing vim's displayed text and status line up the screen; clunky.
          > After Quit gvim redraws correctly.
          >
          > Regards, John



          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Ben Schmidt
          ... I wonder if this is related to an earlier bug with input(). I don t really think so, but maybe at least partly it is. Do you compile Vim yourself? Perhaps
          Message 4 of 6 , Feb 2, 2009
          • 0 Attachment
            > With gvim I get only the first "Because..." or "Not getting.." and
            > afterward only blank lines inserted.

            I wonder if this is related to an earlier bug with input(). I don't
            really think so, but maybe at least partly it is.

            Do you compile Vim yourself? Perhaps you could see if the appended patch
            fixes it, or even just changes it?

            Ben.



            diff -r d0671563949f src/ex_getln.c
            --- a/src/ex_getln.c Thu Aug 14 11:28:45 2008 +1000
            +++ b/src/ex_getln.c Tue Sep 02 21:55:23 2008 +1000
            @@ -1951,8 +1951,11 @@
            # endif
            s = getcmdline(firstc, 1L, 0);
            restore_cmdline(&save_ccline);
            - /* Restore msg_col, the prompt from input() may have changed it. */
            - msg_col = msg_col_save;
            + /* Restore msg_col, the prompt from input() may have changed it.
            + But only do it if called recursively and the commandline is
            + therefore being restored to an old one; if not, the input() prompt
            + stays on the screen, so we need its modified msg_col left intact. */
            + if (ccline.cmdbuff != NULL) msg_col = msg_col_save;

            return s;
            }




            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Vincent Birebent
            Hi Ben, No I did not compile myself. But on a second thought I think this is ... A later redraw may make the message disappear again. To avoid that a command
            Message 5 of 6 , Feb 2, 2009
            • 0 Attachment
              Hi Ben,

              No I did not compile myself. But on a second thought I think this is
              may be not even a bug:

              :help :echo-redraw >>

              "A later redraw may make the message disappear again.
              To avoid that a command from before the ":echo" causes
              a redraw afterwards (redraws are often postponed until
              you type something), force a redraw with the |:redraw|
              command. "

              And indeed: likewise "\n" :redraw does the trick! (reminds me somehow
              the need of flush in C... ;)

              Could have been also that lazyredraw option was set... but it
              wasn't... ;)

              Cheers,

              Vincent.

              Le Feb 2, 2009 à 2:49 PM, Ben Schmidt a écrit :

              >
              >> With gvim I get only the first "Because..." or "Not getting.." and
              >> afterward only blank lines inserted.
              >
              > I wonder if this is related to an earlier bug with input(). I don't
              > really think so, but maybe at least partly it is.
              >
              > Do you compile Vim yourself? Perhaps you could see if the appended
              > patch
              > fixes it, or even just changes it?
              >
              > Ben.
              >
              >
              >
              > diff -r d0671563949f src/ex_getln.c
              > --- a/src/ex_getln.c Thu Aug 14 11:28:45 2008 +1000
              > +++ b/src/ex_getln.c Tue Sep 02 21:55:23 2008 +1000
              > @@ -1951,8 +1951,11 @@
              > # endif
              > s = getcmdline(firstc, 1L, 0);
              > restore_cmdline(&save_ccline);
              > - /* Restore msg_col, the prompt from input() may have changed
              > it. */
              > - msg_col = msg_col_save;
              > + /* Restore msg_col, the prompt from input() may have changed it.
              > + But only do it if called recursively and the commandline is
              > + therefore being restored to an old one; if not, the input()
              > prompt
              > + stays on the screen, so we need its modified msg_col left
              > intact. */
              > + if (ccline.cmdbuff != NULL) msg_col = msg_col_save;
              >
              > return s;
              > }
              >
              >
              >
              >
              > >



              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Dominique Pelle
              ... I can reproduce it using gvim (GUI GTK2 on Linux) and only when gvim is started remotely though ssh -Y (X11 forwarding). When I press the Why? button,
              Message 6 of 6 , Feb 3, 2009
              • 0 Attachment
                Vincent Birebent wrote:

                > Hi,
                >
                > I'm new to this list, so please apologize if I ask wrongly.
                >
                > When I source that:
                >
                > :echo "Hey!"
                > :let choice = 0
                > :while choice < 3
                > : let choice = confirm("Why?", "&Why not?\nBecau&Se\n&Quit", 3)
                > : if choice == 1
                > : echo "Because I'm asking"
                > : elseif choice == 2
                > : echo "Not getting near an answer..."
                > : endif
                > :endwhile
                >
                > The first "Hey!" shows, but none of the following echos. It leaves
                > blank lines instead. It works on regular vim...
                >
                > Also (probably noobish question): in vim after I type ":" I can get
                > last entered commands by using down arrow (and after ":m" all former
                > commands begining with ":m"...). Doesn't seems to work on Macvim... Am
                > I wrong?
                >
                > Thanks.


                I can reproduce it using gvim (GUI GTK2 on Linux) and only when
                gvim is started remotely though "ssh -Y" (X11 forwarding). When I
                press the "Why?" button, sometimes I see "Because I'm asking"
                and sometimes see an empty string (maybe ~50% of the time).
                I could reproduce it on 2 different machines using vim-7.2.93.

                If I try to run gvim with valgrind, then bug no longer happens.

                If I try to run gvim locally (i.e. without ssh -Y), then bug does
                not happen either.

                Bug does not happen with vim in terminal either.

                These symptoms suggest that it might be a timing issue
                (race condition) in the GTK2 GUI since:
                - running with "ssh -Y" or with valgrind definitely affects speed
                - the empty string happens at random time (~ 50% of the time)

                -- Dominique

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