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

Re: Bug: :echo output missing with QuickFix and Command-line windows

Expand Messages
  • Michael Henry
    ... [...] ... Yes, that would be annoying :-) ... Intuitively, I d imagined that forcing a redraw when the command-line window closes but before the command is
    Message 1 of 5 , Nov 2, 2008
      Bram Moolenaar wrote:
      > Michael Henry wrote:
      >
      >
      >> It appears that the output from :echo and :echomsg does not
      >> show up properly when used from the Command-line window
      >> while a QuickFix window is open.
      >>
      [...]

      > If you use:
      > :echo "hello\nthere"
      >
      > You get the hit-enter prompt before redrawing te display. So it's
      > indeed that closing the command-line window causes a redraw and that
      > clears the message.
      >
      > Forcing the hit-enter prompt would be a solution, but at the same time
      > may annoy quite a few users.
      >
      Yes, that would be annoying :-)
      > I'll make a remark in the todo list if it's possible to redraw without
      > erasing the message. Don't expect this soon though.
      >
      Intuitively, I'd imagined that forcing a redraw when the command-line
      window closes but before the command is executed might fix the problem.
      I poked around a little bit this morning and made the following two-line
      patch against Vim 7.2.25:

      --- vim72/src/ex_getln.c.orig 2008-11-02 07:34:57.000000000 -0500
      +++ vim72/src/ex_getln.c 2008-11-02 07:30:20.000000000 -0500
      @@ -6247,6 +6247,8 @@
      setmouse();
      # endif

      + update_screen(0);
      + out_flush();
      return cmdwin_result;
      }
      #endif /* FEAT_CMDWIN */


      This fixes the symptoms I'm seeing, though I really have no idea how
      wrong-headed this approach might be. I just stepped through the code to
      see how re-drawing gets triggered, then added these calls to
      update_screen(0) and out_flush() at the end of the ex_window()
      function. I didn't study how the code works in-depth, so the patch may
      well have some subtle problem related to the details of Vim's
      implementation. At a higher level, however, I think it's a reasonable
      trade-off to force an "extra" screen redraw when exiting the
      command-line window. It has the right feel to me to pop up a temporary
      editing window for command-line history, grab a new command to execute,
      close the temporary window, and tidy up by re-drawing everything,
      leaving no trace that the user didn't just type the command at the ex
      prompt.

      Does this fix seem reasonable, perhaps with some tweaking?

      Thanks,
      Michael Henry


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... It sounds reasonable, but I don t know if this doesn t cause undesired side effects. Use it for a while to find out. -- Hit any key to continue does
      Message 2 of 5 , Nov 2, 2008
        Michael Henry wrote:

        > >> It appears that the output from :echo and :echomsg does not
        > >> show up properly when used from the Command-line window
        > >> while a QuickFix window is open.
        > >>
        > [...]
        >
        > > If you use:
        > > :echo "hello\nthere"
        > >
        > > You get the hit-enter prompt before redrawing te display. So it's
        > > indeed that closing the command-line window causes a redraw and that
        > > clears the message.
        > >
        > > Forcing the hit-enter prompt would be a solution, but at the same time
        > > may annoy quite a few users.
        > >
        > Yes, that would be annoying :-)
        > > I'll make a remark in the todo list if it's possible to redraw without
        > > erasing the message. Don't expect this soon though.
        > >
        > Intuitively, I'd imagined that forcing a redraw when the command-line
        > window closes but before the command is executed might fix the problem.
        > I poked around a little bit this morning and made the following two-line
        > patch against Vim 7.2.25:
        >
        > --- vim72/src/ex_getln.c.orig 2008-11-02 07:34:57.000000000 -0500
        > +++ vim72/src/ex_getln.c 2008-11-02 07:30:20.000000000 -0500
        > @@ -6247,6 +6247,8 @@
        > setmouse();
        > # endif
        >
        > + update_screen(0);
        > + out_flush();
        > return cmdwin_result;
        > }
        > #endif /* FEAT_CMDWIN */
        >
        >
        > This fixes the symptoms I'm seeing, though I really have no idea how
        > wrong-headed this approach might be. I just stepped through the code to
        > see how re-drawing gets triggered, then added these calls to
        > update_screen(0) and out_flush() at the end of the ex_window()
        > function. I didn't study how the code works in-depth, so the patch may
        > well have some subtle problem related to the details of Vim's
        > implementation. At a higher level, however, I think it's a reasonable
        > trade-off to force an "extra" screen redraw when exiting the
        > command-line window. It has the right feel to me to pop up a temporary
        > editing window for command-line history, grab a new command to execute,
        > close the temporary window, and tidy up by re-drawing everything,
        > leaving no trace that the user didn't just type the command at the ex
        > prompt.
        >
        > Does this fix seem reasonable, perhaps with some tweaking?

        It sounds reasonable, but I don't know if this doesn't cause undesired
        side effects. Use it for a while to find out.

        --
        "Hit any key to continue" does _not_ mean you can hit the on/off button!

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

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Andy Wokula
        ... With equalalways off, I don t see the problem. ... -- Andy --~--~---------~--~----~------------~-------~--~----~ You received this message from the
        Message 3 of 5 , Nov 2, 2008
          Michael Henry schrieb:
          > All,
          >
          > It appears that the output from :echo and :echomsg does not
          > show up properly when used from the Command-line window
          > while a QuickFix window is open.
          >
          > Steps to reproduce:
          >
          > - Startup Vim clean:
          >
          > vim -u NONE -N
          >
          > - Test regular :echo command:
          >
          > :echo "Hello"<CR>
          >
          > This works properly.
          >
          > - Open command-line window:
          >
          > q:
          >
          > - Cursor up to :echo "Hello", press Enter to execute.
          >
          > This works properly.
          >
          > - Open the QuickFix window:
          >
          > :copen<CR>
          >
          > - Re-open the Command-line window:
          >
          > q:
          >
          > - Cursor up to :echo "Hello", press Enter to execute.
          >
          > The expected output ("Hello") does not show up (or perhaps
          > more likely, shows up but is subsequently erased, as my
          > testing with :redir shows that "Hello" is actually written).

          With 'equalalways' off, I don't see the problem.
          :set noea

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