To: vim-dev@vim.org Subject: Patch 6.2.197 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.197 Problem: It is not possible to force a redraw of status lines. (Gary Johnson) Solution: Add the ":redrawstatus" command. Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c, src/screen.c *** ../vim-6.2.196/runtime/doc/various.txt Sun Jun 1 12:20:37 2003 --- runtime/doc/various.txt Wed Jan 21 13:57:43 2004 *************** *** 1,4 **** ! *various.txt* For Vim version 6.2. Last change: 2003 May 11 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *various.txt* For Vim version 6.2. Last change: 2004 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 24,35 **** or function. Also when halfway a mapping and 'lazyredraw' is set. *N* When entering a number: Remove the last digit. Note: if you like to use for this, add this ! mapping to your .vimrc: :map CTRL-V CTRL-V ! See |:fixdel| if your key does not do what you want. :as[cii] or *ga* *:as* *:ascii* --- 24,42 ---- or function. Also when halfway a mapping and 'lazyredraw' is set. + *:redraws* *:redrawstatus* + :redraws[tatus][!] Redraw the status line of the current window. When ! + is included all status lines are redrawn. + Useful to update the status line(s) when 'statusline' + includes an item that doesn't cause automatic + updating. + *N* When entering a number: Remove the last digit. Note: if you like to use for this, add this ! mapping to your .vimrc: > :map CTRL-V CTRL-V ! < See |:fixdel| if your key does not do what you want. :as[cii] or *ga* *:as* *:ascii* *** ../vim-6.2.196/src/ex_cmds.h Sun Jan 18 20:46:13 2004 --- src/ex_cmds.h Mon Jan 19 12:13:22 2004 *************** *** 618,623 **** --- 618,625 ---- BANG|FILES|TRLBAR|CMDWIN), EX(CMD_redraw, "redraw", ex_redraw, BANG|TRLBAR|CMDWIN), + EX(CMD_redrawstatus, "redrawstatus", ex_redrawstatus, + BANG|TRLBAR|CMDWIN), EX(CMD_registers, "registers", ex_display, EXTRA|NOTRLCOM|TRLBAR|CMDWIN), EX(CMD_resize, "resize", ex_resize, *** ../vim-6.2.196/src/ex_docmd.c Sun Jan 18 21:12:26 2004 --- src/ex_docmd.c Thu Jan 22 17:22:52 2004 *************** *** 269,274 **** --- 269,275 ---- static void ex_redo __ARGS((exarg_T *eap)); static void ex_redir __ARGS((exarg_T *eap)); static void ex_redraw __ARGS((exarg_T *eap)); + static void ex_redrawstatus __ARGS((exarg_T *eap)); static void close_redir __ARGS((void)); static void ex_mkrc __ARGS((exarg_T *eap)); static void ex_mark __ARGS((exarg_T *eap)); *************** *** 7178,7183 **** --- 7179,7213 ---- RedrawingDisabled = r; p_lz = p; out_flush(); + } + + /* + * ":redrawstatus": force redraw of status line(s) + */ + /*ARGSUSED*/ + static void + ex_redrawstatus(eap) + exarg_T *eap; + { + #if defined(FEAT_WINDOWS) + int r = RedrawingDisabled; + int p = p_lz; + + RedrawingDisabled = 0; + p_lz = FALSE; + if (eap->forceit) + status_redraw_all(); + else + status_redraw_curbuf(); + update_screen( + # ifdef FEAT_VISUAL + VIsual_active ? INVERTED : + # endif + 0); + RedrawingDisabled = r; + p_lz = p; + out_flush(); + #endif } static void *** ../vim-6.2.196/src/screen.c Mon Aug 4 20:55:46 2003 --- src/screen.c Thu Jan 22 17:22:13 2004 *************** *** 4584,4590 **** } } - # if defined(FEAT_KEYMAP) || defined(PROTO) /* * mark all status lines of the current buffer for redraw */ --- 4584,4589 ---- *************** *** 4600,4606 **** redraw_later(VALID); } } - # endif /* * Redraw all status lines that need to be redrawn. --- 4599,4604 ---- *** ../vim-6.2.196/src/version.c Sun Jan 25 19:28:46 2004 --- src/version.c Sun Jan 25 19:30:35 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 197, /**/ -- No children may attend school with their breath smelling of "wild onions." [real standing law in West Virginia, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///