To: vim-dev@vim.org Subject: Patch 6.2.493 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.493 Problem: "@x" doesn't work when 'insertmode' is set. (Benji Fisher) Solution: Put "restart_edit" in the typeahead buffer, so that it's used after executing the register contents. Files: src/ops.c *** ../vim-6.2.492/src/ops.c Mon Apr 19 20:26:43 2004 --- src/ops.c Fri Apr 23 15:14:01 2004 *************** *** 96,101 **** --- 96,102 ---- #endif static void get_yank_register __ARGS((int regname, int writing)); static int stuff_yank __ARGS((int, char_u *)); + static void put_reedit_in_typebuf __ARGS((void)); static int put_in_typebuf __ARGS((char_u *s, int colon)); static void stuffescaped __ARGS((char_u *arg, int literally)); static int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg)); *************** *** 1154,1159 **** --- 1155,1161 ---- /* * Insert lines into typeahead buffer, from last one to first one. */ + put_reedit_in_typebuf(); for (i = y_current->y_size; --i >= 0; ) { /* insert NL between lines and after last line if type is MLINE */ *************** *** 1175,1180 **** --- 1177,1209 ---- return retval; } + /* + * If "restart_edit" is not zero, put it in the typeahead buffer, so that it's + * used only after other typeahead has been processed. + */ + static void + put_reedit_in_typebuf() + { + char_u buf[3]; + + if (restart_edit != NUL) + { + if (restart_edit == 'V') + { + buf[0] = 'g'; + buf[1] = 'R'; + buf[2] = NUL; + } + else + { + buf[0] = restart_edit == 'I' ? 'i' : restart_edit; + buf[1] = NUL; + } + if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE) == OK) + restart_edit = NUL; + } + } + static int put_in_typebuf(s, colon) char_u *s; *************** *** 1182,1187 **** --- 1211,1217 ---- { int retval = OK; + put_reedit_in_typebuf(); if (colon) retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, FALSE); if (retval == OK) *** ../vim-6.2.492/src/version.c Fri Apr 23 12:02:42 2004 --- src/version.c Fri Apr 23 15:16:05 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 493, /**/ -- The average life of an organization chart is six months. You can safely ignore any order from your boss that would take six months to complete. (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 ///