summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2007-12-09 19:26:44 +0000
committervimboss <devnull@localhost>2007-12-09 19:26:44 +0000
commitb5fd34cb56f7a28c602f3ee26276b549e12c444d (patch)
treea5a372ca9ac91aaaafe4b2c8935b678fab69eaf7
parentc36fef2f657c34f55cb84bde6a3d5f03b74a67a9 (diff)
downloadvim-b5fd34cb56f7a28c602f3ee26276b549e12c444d.tar.gz
updated for version 7.1-175v7.1.175v7-1-175
-rw-r--r--src/edit.c73
-rw-r--r--src/version.c2
2 files changed, 35 insertions, 40 deletions
diff --git a/src/edit.c b/src/edit.c
index f2fe692d..d906d788 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -8189,6 +8189,29 @@ ins_del()
AppendCharToRedobuff(K_DEL);
}
+static void ins_bs_one __ARGS((colnr_T *vcolp));
+
+/*
+ * Delete one character for ins_bs().
+ */
+ static void
+ins_bs_one(vcolp)
+ colnr_T *vcolp;
+{
+ dec_cursor();
+ getvcol(curwin, &curwin->w_cursor, vcolp, NULL, NULL);
+ if (State & REPLACE_FLAG)
+ {
+ /* Don't delete characters before the insert point when in
+ * Replace mode */
+ if (curwin->w_cursor.lnum != Insstart.lnum
+ || curwin->w_cursor.col >= Insstart.col)
+ replace_do_bs();
+ }
+ else
+ (void)del_char(FALSE);
+}
+
/*
* Handle Backspace, delete-word and delete-line in Insert mode.
* Return TRUE when backspace was actually used.
@@ -8418,9 +8441,7 @@ ins_bs(c, mode, inserted_space_p)
int ts;
colnr_T vcol;
colnr_T want_vcol;
-#if 0
- int extra = 0;
-#endif
+ colnr_T start_vcol;
*inserted_space_p = FALSE;
if (p_sta && in_indent)
@@ -8431,6 +8452,7 @@ ins_bs(c, mode, inserted_space_p)
* 'showbreak' may get in the way, need to get the last column of
* the previous character. */
getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
+ start_vcol = vcol;
dec_cursor();
getvcol(curwin, &curwin->w_cursor, NULL, NULL, &want_vcol);
inc_cursor();
@@ -8439,30 +8461,7 @@ ins_bs(c, mode, inserted_space_p)
/* delete characters until we are at or before want_vcol */
while (vcol > want_vcol
&& (cc = *(ml_get_cursor() - 1), vim_iswhite(cc)))
- {
- dec_cursor();
- getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
- if (State & REPLACE_FLAG)
- {
- /* Don't delete characters before the insert point when in
- * Replace mode */
- if (curwin->w_cursor.lnum != Insstart.lnum
- || curwin->w_cursor.col >= Insstart.col)
- {
-#if 0 /* what was this for? It causes problems when sw != ts. */
- if (State == REPLACE && (int)vcol < want_vcol)
- {
- (void)del_char(FALSE);
- extra = 2; /* don't pop too much */
- }
- else
-#endif
- replace_do_bs();
- }
- }
- else
- (void)del_char(FALSE);
- }
+ ins_bs_one(&vcol);
/* insert extra spaces until we are at want_vcol */
while (vcol < want_vcol)
@@ -8479,22 +8478,16 @@ ins_bs(c, mode, inserted_space_p)
#endif
{
ins_str((char_u *)" ");
- if ((State & REPLACE_FLAG) /* && extra <= 1 */)
- {
-#if 0
- if (extra)
- replace_push_off(NUL);
- else
-#endif
- replace_push(NUL);
- }
-#if 0
- if (extra == 2)
- extra = 1;
-#endif
+ if ((State & REPLACE_FLAG))
+ replace_push(NUL);
}
getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
}
+
+ /* If we are now back where we started delete one character. Can
+ * happen when using 'sts' and 'linebreak'. */
+ if (vcol >= start_vcol)
+ ins_bs_one(&vcol);
}
/*
diff --git a/src/version.c b/src/version.c
index b77a93ed..1e320534 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 175,
+/**/
174,
/**/
173,