To: vim-dev@vim.org Subject: Patch 6.0.222 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.222 Problem: When 'virtualedit' is set and using autoindent, pressing Esc after starting a new line leaves behind part of the autoindent. (Helmut Stiegler) Solution: After deleting the last char in the line adjust the cursor position in del_bytes(). Files: src/misc1.c, src/ops.c *** ../vim60.221/src/misc1.c Sun Feb 10 14:27:03 2002 --- src/misc1.c Tue Feb 12 12:06:51 2002 *************** *** 1887,1898 **** { /* * If we just took off the last character of a non-blank line, and ! * fixpos is TRUE, we don't want to end up positioned at the NUL, ! * unless we are in virtual mode. */ ! if (col > 0 && fixpos && !virtual_active()) { --curwin->w_cursor.col; #ifdef FEAT_MBYTE if (has_mbyte) curwin->w_cursor.col -= --- 1887,1900 ---- { /* * If we just took off the last character of a non-blank line, and ! * fixpos is TRUE, we don't want to end up positioned at the NUL. */ ! if (col > 0 && fixpos) { --curwin->w_cursor.col; + #ifdef FEAT_VIRTUALEDIT + curwin->w_cursor.coladd = 0; + #endif #ifdef FEAT_MBYTE if (has_mbyte) curwin->w_cursor.col -= *** ../vim60.221/src/ops.c Thu Feb 7 12:41:51 2002 --- src/ops.c Tue Feb 12 12:02:27 2002 *************** *** 1693,1699 **** curwin->w_cursor.coladd = 0; } #endif ! (void)del_bytes((long)n, restart_edit == NUL); } else /* delete characters between lines */ { --- 1693,1699 ---- curwin->w_cursor.coladd = 0; } #endif ! (void)del_bytes((long)n, restart_edit == NUL && !virtual_active()); } else /* delete characters between lines */ { *************** *** 1710,1716 **** /* delete from start of line until op_end */ curwin->w_cursor.col = 0; (void)del_bytes((long)(oap->end.col + 1 - !oap->inclusive), ! restart_edit == NUL); curwin->w_cursor = oap->start; /* restore curwin->w_cursor */ (void)do_join(FALSE); --- 1710,1716 ---- /* delete from start of line until op_end */ curwin->w_cursor.col = 0; (void)del_bytes((long)(oap->end.col + 1 - !oap->inclusive), ! restart_edit == NUL && !virtual_active()); curwin->w_cursor = oap->start; /* restore curwin->w_cursor */ (void)do_join(FALSE); *** ../vim60.221/src/version.c Tue Feb 12 10:13:15 2002 --- src/version.c Tue Feb 12 12:09:48 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 222, /**/ -- 5 out of 4 people have trouble with fractions. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///