To: vim-dev@vim.org Subject: Patch 6.3b.011 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.3b.011 Problem: Using CTRL-\ e while obtaining an expression aborts the command line. (Hari Krishna Dara) Solution: Insert the CTRL-\ e as typed. Files: src/ex_getln.c *** ../vim-6.3b.010/src/ex_getln.c Sun May 16 22:38:42 2004 --- src/ex_getln.c Sat May 22 11:51:26 2004 *************** *** 570,576 **** #endif /* FEAT_WILDMENU */ /* CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to Insert ! * mode when 'insertmode' is set. */ if (c == Ctrl_BSL) { ++no_mapping; --- 570,576 ---- #endif /* FEAT_WILDMENU */ /* CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to Insert ! * mode when 'insertmode' is set, CTRL-\ e prompts for an expression. */ if (c == Ctrl_BSL) { ++no_mapping; *************** *** 578,584 **** c = safe_vgetc(); --no_mapping; --allow_keys; ! if (c != Ctrl_N && c != Ctrl_G && c != 'e') { vungetc(c); c = Ctrl_BSL; --- 578,586 ---- c = safe_vgetc(); --no_mapping; --allow_keys; ! /* CTRL-\ e doesn't work when obtaining an expression. */ ! if (c != Ctrl_N && c != Ctrl_G ! && (c != 'e' || ccline.cmdfirstc == '=')) { vungetc(c); c = Ctrl_BSL; *************** *** 586,631 **** #ifdef FEAT_EVAL else if (c == 'e') { /* * Replace the command line with the result of an expression. * Need to save the current command line, to be able to enter * a new one... */ ! if (ccline.cmdfirstc != '=') /* can't do this recursively */ { ! struct cmdline_info save_ccline; ! char_u *p; ! ! if (ccline.cmdpos == ccline.cmdlen) ! new_cmdpos = 99999; /* keep it at the end */ ! else ! new_cmdpos = ccline.cmdpos; ! save_ccline = ccline; ! ccline.cmdbuff = NULL; ! ccline.cmdprompt = NULL; ! c = get_expr_register(); ! ccline = save_ccline; ! if (c == '=') { ! p = get_expr_line(); ! if (p != NULL ! && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) ! { ! ccline.cmdlen = STRLEN(p); ! STRCPY(ccline.cmdbuff, p); ! vim_free(p); ! /* Restore the cursor or use the position set with ! * set_cmdline_pos(). */ ! if (new_cmdpos > ccline.cmdlen) ! ccline.cmdpos = ccline.cmdlen; ! else ! ccline.cmdpos = new_cmdpos; ! KeyTyped = FALSE; /* Don't do p_wc completion. */ ! redrawcmd(); ! goto cmdline_changed; ! } } } beep_flush(); --- 588,630 ---- #ifdef FEAT_EVAL else if (c == 'e') { + struct cmdline_info save_ccline; + char_u *p; + /* * Replace the command line with the result of an expression. * Need to save the current command line, to be able to enter * a new one... */ ! if (ccline.cmdpos == ccline.cmdlen) ! new_cmdpos = 99999; /* keep it at the end */ ! else ! new_cmdpos = ccline.cmdpos; ! save_ccline = ccline; ! ccline.cmdbuff = NULL; ! ccline.cmdprompt = NULL; ! c = get_expr_register(); ! ccline = save_ccline; ! if (c == '=') { ! p = get_expr_line(); ! if (p != NULL ! && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) { ! ccline.cmdlen = STRLEN(p); ! STRCPY(ccline.cmdbuff, p); ! vim_free(p); ! /* Restore the cursor or use the position set with ! * set_cmdline_pos(). */ ! if (new_cmdpos > ccline.cmdlen) ! ccline.cmdpos = ccline.cmdlen; ! else ! ccline.cmdpos = new_cmdpos; ! KeyTyped = FALSE; /* Don't do p_wc completion. */ ! redrawcmd(); ! goto cmdline_changed; } } beep_flush(); *** ../vim-6.3b.010/src/version.c Fri May 28 21:52:19 2004 --- src/version.c Sat May 29 13:46:21 2004 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 11, /**/ -- Contrary to popular belief, it's often your clothing that gets promoted, not you. (Scott Adams - The Dilbert principle) /// 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 /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///