To: vim-dev@vim.org Subject: Patch 6.1.398 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.398 Problem: Saving the typeahead for debug mode causes trouble for a test script. (Servatius Brandt) Solution: Add the ":debuggreedy" command to avoid saving the typeahead. Files: runtime/doc/repeat.txt, src/ex_cmds.h, src/ex_cmds2.c, src/ex_docmd.c, src/proto/ex_cmds2.pro *** ../vim61.397/runtime/doc/repeat.txt Fri Mar 22 21:18:38 2002 --- runtime/doc/repeat.txt Wed Mar 12 20:10:03 2003 *************** *** 1,4 **** ! *repeat.txt* For Vim version 6.1. Last change: 2001 Dec 11 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *repeat.txt* For Vim version 6.1. Last change: 2003 Mar 12 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 486,490 **** --- 498,516 ---- *:breakl* *:breaklist* :breakl[ist] List all breakpoints. + + + OBSCURE + + *:debugg* *:debuggreedy* + :debugg[reedy] + Read debug mode commands from the normal input stream, instead + of getting them directly from the user. Only useful for test + scripts. Example: > + echo 'q^Mq' | vim -e -s -c debuggreedy -c 'breakadd file script.vim' -S script.vim + + :0debugg[reedy] + Undo ":debuggreedy": get debug mode commands directly from the + user, don't use typeahead for debug commands. vim:tw=78:ts=8:ft=help:norl: *** ../vim61.397/src/ex_cmds.h Mon Nov 11 21:42:40 2002 --- src/ex_cmds.h Wed Mar 12 20:10:25 2003 *************** *** 270,275 **** --- 270,277 ---- RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY), EX(CMD_debug, "debug", ex_debug, NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN), + EX(CMD_debuggreedy, "debuggreedy", ex_debuggreedy, + RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN), EX(CMD_delcommand, "delcommand", ex_delcommand, NEEDARG|WORD1|TRLBAR|CMDWIN), EX(CMD_delfunction, "delfunction", ex_delfunction, *** ../vim61.397/src/ex_cmds2.c Sun Mar 9 17:49:38 2003 --- src/ex_cmds2.c Wed Mar 12 20:11:24 2003 *************** *** 17,22 **** --- 17,24 ---- static void cmd_source __ARGS((char_u *fname, exarg_T *eap)); #if defined(FEAT_EVAL) || defined(PROTO) + static int debug_greedy = FALSE; /* batch mode debugging: don't save + and restore typeahead. */ /* * do_debug(): Debug mode. *************** *** 102,112 **** save_ex_normal_busy = ex_normal_busy; ex_normal_busy = 0; # endif ! save_typeahead(&typeaheadbuf); cmdline = getcmdline_prompt('>', NULL, 0); ! restore_typeahead(&typeaheadbuf); # ifdef FEAT_EX_EXTRA ex_normal_busy = save_ex_normal_busy; # endif --- 104,116 ---- save_ex_normal_busy = ex_normal_busy; ex_normal_busy = 0; # endif ! if (!debug_greedy) ! save_typeahead(&typeaheadbuf); cmdline = getcmdline_prompt('>', NULL, 0); ! if (!debug_greedy) ! restore_typeahead(&typeaheadbuf); # ifdef FEAT_EX_EXTRA ex_normal_busy = save_ex_normal_busy; # endif *************** *** 397,402 **** --- 401,419 ---- } /* + * ":debuggreedy". + */ + void + ex_debuggreedy(eap) + exarg_T *eap; + { + if (eap->addr_count == 0 || eap->line2 != 0) + debug_greedy = TRUE; + else + debug_greedy = FALSE; + } + + /* * ":breakdel". */ void *** ../vim61.397/src/ex_docmd.c Sun Mar 9 15:19:49 2003 --- src/ex_docmd.c Wed Mar 12 20:11:37 2003 *************** *** 401,406 **** --- 401,407 ---- #ifndef FEAT_EVAL # define ex_debug ex_ni # define ex_breakadd ex_ni + # define ex_debuggreedy ex_ni # define ex_breakdel ex_ni # define ex_breaklist ex_ni #endif *** ../vim61.397/src/proto/ex_cmds2.pro Sat Feb 1 16:43:17 2003 --- src/proto/ex_cmds2.pro Wed Mar 12 20:12:17 2003 *************** *** 3,8 **** --- 3,9 ---- void ex_debug __ARGS((exarg_T *eap)); void dbg_check_breakpoint __ARGS((exarg_T *eap)); void ex_breakadd __ARGS((exarg_T *eap)); + void ex_debuggreedy __ARGS((exarg_T *eap)); void ex_breakdel __ARGS((exarg_T *eap)); void ex_breaklist __ARGS((exarg_T *eap)); linenr_T dbg_find_breakpoint __ARGS((int file, char_u *fname, linenr_T after)); *************** *** 54,60 **** int mch_print_begin __ARGS((prt_settings_T *psettings)); void mch_print_end __ARGS((prt_settings_T *psettings)); int mch_print_end_page __ARGS((void)); ! int mch_print_begin_page __ARGS((char_u *msg)); int mch_print_blank_page __ARGS((void)); void mch_print_start_line __ARGS((int margin, int page_line)); int mch_print_text_out __ARGS((char_u *p, int len)); --- 55,61 ---- int mch_print_begin __ARGS((prt_settings_T *psettings)); void mch_print_end __ARGS((prt_settings_T *psettings)); int mch_print_end_page __ARGS((void)); ! int mch_print_begin_page __ARGS((char_u *str)); int mch_print_blank_page __ARGS((void)); void mch_print_start_line __ARGS((int margin, int page_line)); int mch_print_text_out __ARGS((char_u *p, int len)); *** ../vim61.397/src/version.c Sat Mar 15 16:28:26 2003 --- src/version.c Sat Mar 15 16:30:45 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 398, /**/ -- From "know your smileys": ;-0 Can't find shift key ,-9 Kann Umschalttaste nicht finden /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///