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

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

Expand Messages
  • Michael Henry
    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
    Message 1 of 5 , Nov 1, 2008
    • 0 Attachment
      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).

      Tested Configuration: Vim 7.2, patches 1-25, compiled on Linux.
      :version output follows.

      Michael Henry
      --
      VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Oct 19 2008 19:56:42)
      Included patches: 1-25
      Compiled by vim@...
      Huge version with GTK2 GUI. Features included (+) or not (-):
      +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
      +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
      +comments
      +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
      +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
      +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand
      +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
      +localmap
      +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
      -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte
      +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl
      +postscript
      +printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind
      +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
      +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects
      +title
      +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra
      +viminfo
      +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
      +xsmp_interact +xterm_clipboard -xterm_save
      system vimrc file: "$VIM/vimrc"
      user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/gvimrc"
      user gvimrc file: "$HOME/.gvimrc"
      system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/usr/local/share/vim"
      Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
      -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
      -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
      -I/usr/lib/glib-2.0/include -I/usr/include/freetype2
      -I/usr/include/libpng12 -I/usr/include/pixman-1 -g -O2
      -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
      -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
      -I/usr/lib/perl/5.8/CORE -I/usr/include/python2.5 -pthread
      -I/usr/lib/ruby/1.8/i486-linux
      Linking: gcc -L. -Wl,-Bsymbolic-functions -rdynamic
      -Wl,-export-dynamic -Wl,-E -L/usr/local/lib -o vim -lgtk-x11-2.0
      -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0
      -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXt -lncurses -lgpm
      -Wl,-E -L/usr/local/lib /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
      -L/usr/lib/perl/5.8/CORE -lperl -L/usr/lib/python2.5/config -lpython2.5
      -lutil -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
      -lruby1.8 -lm


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... 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.
      Message 2 of 5 , Nov 1, 2008
      • 0 Attachment
        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.
        >
        > 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).

        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.

        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.

        --
        hundred-and-one symptoms of being an internet addict:
        162. You go outside and look for a brightness knob to turn down the sun.

        /// 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
        -~----------~----~----~----~------~----~------~--~---
      • 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 3 of 5 , Nov 2, 2008
        • 0 Attachment
          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 4 of 5 , Nov 2, 2008
          • 0 Attachment
            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 5 of 5 , Nov 2, 2008
            • 0 Attachment
              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.