aboutsummaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2014-04-29 15:34:02 +0200
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-29 15:11:57 -0300
commit48fa2be92be96b348ffd5c812846178f7835fe15 (patch)
tree790c6886f4136bf5a1a1f91cb935239fdf01b642 /src/edit.c
parent35ca06603948aba029a82bf094fffaf7f17da4e3 (diff)
downloadrneovim-48fa2be92be96b348ffd5c812846178f7835fe15.tar.gz
rneovim-48fa2be92be96b348ffd5c812846178f7835fe15.tar.bz2
rneovim-48fa2be92be96b348ffd5c812846178f7835fe15.zip
vim-patch:7.4.269
Problem: CTRL-U in Insert mode does not work after using a cursor key. (Pine Wu) Solution: Use the original insert start position. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=81c26975e8f9dc7435353581346542409403f296
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/edit.c b/src/edit.c
index 53bb8815ec..702d117580 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -7339,8 +7339,8 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
|| (!can_bs(BS_START)
&& (arrow_used
- || (curwin->w_cursor.lnum == Insstart.lnum
- && curwin->w_cursor.col <= Insstart.col)))
+ || (curwin->w_cursor.lnum == Insstart_orig.lnum
+ && curwin->w_cursor.col <= Insstart_orig.col)))
|| (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
&& curwin->w_cursor.col <= ai_col)
|| (!can_bs(BS_EOL) && curwin->w_cursor.col == 0)))) {
@@ -7378,15 +7378,14 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
* delete newline!
*/
if (curwin->w_cursor.col == 0) {
- lnum = Insstart.lnum;
- if (curwin->w_cursor.lnum == Insstart.lnum
- || revins_on
- ) {
+ lnum = Insstart_orig.lnum;
+ if (curwin->w_cursor.lnum == lnum || revins_on) {
if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
- (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
+ (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL) {
return FALSE;
- --Insstart.lnum;
- Insstart.col = MAXCOL;
+ }
+ --Insstart_orig.lnum;
+ Insstart_orig.col = MAXCOL;
}
/*
* In replace mode:
@@ -7517,9 +7516,10 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
/* insert extra spaces until we are at want_vcol */
while (vcol < want_vcol) {
/* Remember the first char we inserted */
- if (curwin->w_cursor.lnum == Insstart.lnum
- && curwin->w_cursor.col < Insstart.col)
- Insstart.col = curwin->w_cursor.col;
+ if (curwin->w_cursor.lnum == Insstart_orig.lnum
+ && curwin->w_cursor.col < Insstart_orig.col) {
+ Insstart_orig.col = curwin->w_cursor.col;
+ }
if (State & VREPLACE_FLAG)
ins_char(' ');
@@ -7584,8 +7584,8 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
} while (
revins_on ||
(curwin->w_cursor.col > mincol
- && (curwin->w_cursor.lnum != Insstart.lnum
- || curwin->w_cursor.col != Insstart.col)));
+ && (curwin->w_cursor.lnum != Insstart_orig.lnum
+ || curwin->w_cursor.col != Insstart_orig.col)));
did_backspace = TRUE;
}
did_si = FALSE;
@@ -7601,9 +7601,10 @@ static int ins_bs(int c, int mode, int *inserted_space_p)
AppendCharToRedobuff(c);
/* If deleted before the insertion point, adjust it */
- if (curwin->w_cursor.lnum == Insstart.lnum
- && curwin->w_cursor.col < Insstart.col)
- Insstart.col = curwin->w_cursor.col;
+ if (curwin->w_cursor.lnum == Insstart_orig.lnum
+ && curwin->w_cursor.col < Insstart_orig.col) {
+ Insstart_orig.col = curwin->w_cursor.col;
+ }
/* vi behaviour: the cursor moves backward but the character that
* was there remains visible