To: vim-dev@vim.org Subject: patch 5.4.46 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.4.46 Problem: Backspacing did not always use 'softtabstop' after hitting , inserting a register, moving the cursor, etc. Solution: Reset inserted_space much more often in edit(). Files: src/edit.c *** ../vim-5.4.45/src/edit.c Sun Aug 22 16:12:18 1999 --- src/edit.c Sun Aug 22 16:46:23 1999 *************** *** 208,214 **** int line_is_white = FALSE; /* line is empty before insert */ #endif linenr_t old_topline = 0; /* topline before insertion */ ! int inserted_space = FALSE; /* just inserted a space */ int has_startsel; /* may start selection */ int replaceState = REPLACE; int did_restart_edit = restart_edit; --- 208,214 ---- int line_is_white = FALSE; /* line is empty before insert */ #endif linenr_t old_topline = 0; /* topline before insertion */ ! int inserted_space = FALSE; /* just inserted a space */ int has_startsel; /* may start selection */ int replaceState = REPLACE; int did_restart_edit = restart_edit; *************** *** 772,777 **** --- 772,778 ---- if (stuff_inserted(NUL, 1L, (c == Ctrl('A'))) == FAIL && c != Ctrl('A') && !p_im) goto doESCkey; /* quit insert mode */ + inserted_space = FALSE; break; /* *************** *** 779,784 **** --- 780,786 ---- */ case Ctrl('R'): need_redraw |= ins_reg(); + inserted_space = FALSE; break; #ifdef RIGHTLEFT *************** *** 801,806 **** --- 803,809 ---- case Ctrl('T'): ins_shift(c, lastc); need_redraw = TRUE; + inserted_space = FALSE; break; /* delete character under the cursor */ *************** *** 826,831 **** --- 829,835 ---- case Ctrl('U'): did_backspace = ins_bs(c, BACKSPACE_LINE, &inserted_space); need_redraw = TRUE; + inserted_space = FALSE; break; #ifdef USE_MOUSE *************** *** 943,948 **** --- 947,953 ---- case NL: if (ins_eol(c) && !p_im) goto doESCkey; /* out of memory */ + inserted_space = FALSE; break; #if defined(DIGRAPHS) || defined (INSERT_EXPAND) *************** *** 1097,1102 **** --- 1102,1111 ---- } break; } /* end of switch (c) */ + + /* If the cursor was moved we didn't just insert a space */ + if (arrow_used) + inserted_space = FALSE; #ifdef CINDENT if (curbuf->b_p_cin && can_cindent *** ../vim-5.4.45/src/version.h Sun Aug 22 14:14:53 1999 --- src/version.h Sun Aug 22 16:52:21 1999 *************** *** 19,26 **** #define VIM_VERSION_MINOR_STR "4" #define VIM_VERSION_BUILD 57 #define VIM_VERSION_BUILD_STR "57" ! #define VIM_VERSION_PATCHLEVEL 45 ! #define VIM_VERSION_PATCHLEVEL_STR "45" /* * VIM_VERSION_NODOT is used for the runtime directory name. --- 19,26 ---- #define VIM_VERSION_MINOR_STR "4" #define VIM_VERSION_BUILD 57 #define VIM_VERSION_BUILD_STR "57" ! #define VIM_VERSION_PATCHLEVEL 46 ! #define VIM_VERSION_PATCHLEVEL_STR "46" /* * VIM_VERSION_NODOT is used for the runtime directory name. *************** *** 30,35 **** */ #define VIM_VERSION_NODOT "vim54" #define VIM_VERSION_SHORT "5.4" ! #define VIM_VERSION_MEDIUM "5.4.45" ! #define VIM_VERSION_LONG "VIM - Vi IMproved 5.4.45 (1999 Aug 22)" ! #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 5.4.45 (1999 Aug 22, compiled " --- 30,35 ---- */ #define VIM_VERSION_NODOT "vim54" #define VIM_VERSION_SHORT "5.4" ! #define VIM_VERSION_MEDIUM "5.4.46" ! #define VIM_VERSION_LONG "VIM - Vi IMproved 5.4.46 (1999 Aug 22)" ! #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 5.4.46 (1999 Aug 22, compiled " -- hundred-and-one symptoms of being an internet addict: 188. You purchase a laptop so you can surf while sitting on the can. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /