4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: <BS> doesn't work with some combination of 'sts', 'linebreak' and
12 'backspace'. (Francois Ingelrest)
13 Solution: When adding white space results in not moving back delete one
18 *** ../vim-7.1.174/src/edit.c Sat Nov 24 21:27:33 2007
19 --- src/edit.c Fri Dec 7 21:32:48 2007
23 AppendCharToRedobuff(K_DEL);
26 + static void ins_bs_one __ARGS((colnr_T *vcolp));
29 + * Delete one character for ins_bs().
36 + getvcol(curwin, &curwin->w_cursor, vcolp, NULL, NULL);
37 + if (State & REPLACE_FLAG)
39 + /* Don't delete characters before the insert point when in
41 + if (curwin->w_cursor.lnum != Insstart.lnum
42 + || curwin->w_cursor.col >= Insstart.col)
46 + (void)del_char(FALSE);
50 * Handle Backspace, delete-word and delete-line in Insert mode.
51 * Return TRUE when backspace was actually used.
61 *inserted_space_p = FALSE;
62 if (p_sta && in_indent)
69 *inserted_space_p = FALSE;
70 if (p_sta && in_indent)
74 * 'showbreak' may get in the way, need to get the last column of
75 * the previous character. */
76 getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
79 getvcol(curwin, &curwin->w_cursor, NULL, NULL, &want_vcol);
83 /* delete characters until we are at or before want_vcol */
84 while (vcol > want_vcol
85 && (cc = *(ml_get_cursor() - 1), vim_iswhite(cc)))
88 ! getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
89 ! if (State & REPLACE_FLAG)
91 ! /* Don't delete characters before the insert point when in
93 ! if (curwin->w_cursor.lnum != Insstart.lnum
94 ! || curwin->w_cursor.col >= Insstart.col)
96 ! #if 0 /* what was this for? It causes problems when sw != ts. */
97 ! if (State == REPLACE && (int)vcol < want_vcol)
99 ! (void)del_char(FALSE);
100 ! extra = 2; /* don't pop too much */
108 ! (void)del_char(FALSE);
111 /* insert extra spaces until we are at want_vcol */
112 while (vcol < want_vcol)
114 /* delete characters until we are at or before want_vcol */
115 while (vcol > want_vcol
116 && (cc = *(ml_get_cursor() - 1), vim_iswhite(cc)))
119 /* insert extra spaces until we are at want_vcol */
120 while (vcol < want_vcol)
125 ins_str((char_u *)" ");
126 ! if ((State & REPLACE_FLAG) /* && extra <= 1 */)
130 ! replace_push_off(NUL);
140 getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
148 ins_str((char_u *)" ");
149 ! if ((State & REPLACE_FLAG))
152 getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
155 + /* If we are now back where we started delete one character. Can
156 + * happen when using 'sts' and 'linebreak'. */
157 + if (vcol >= start_vcol)
162 *** ../vim-7.1.174/src/version.c Sun Dec 9 19:37:37 2007
163 --- src/version.c Sun Dec 9 20:24:11 2007
167 { /* Add new patch number below this line */
173 hundred-and-one symptoms of being an internet addict:
174 215. Your mouse-clicking forearm rivals Popeye's.
176 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
177 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
178 \\\ download, build and distribute -- http://www.A-A-P.org ///
179 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///