diff options
author | Bram Moolenaar <bram@vim.org> | 2012-03-23 14:16:23 +0100 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2012-03-23 14:16:23 +0100 |
commit | 286179e7cec2cc7949714db0d890485878126fcf (patch) | |
tree | d8155776547d1d75ada305df97d42ef617e1bbc7 | |
parent | 61162256dfa7d8604196a7be688e2500d982e69c (diff) | |
download | vim-286179e7cec2cc7949714db0d890485878126fcf.tar.gz |
Problem: When selecting a block, using "$" to include the end of each line
and using "A" and typing a backspace strange things happen.
(Yuangchen Xie)
Solution: Avoid using a negative length. (Christian Brabandt)
-rw-r--r-- | src/ops.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -2602,7 +2602,8 @@ op_insert(oap, count1) firstline = ml_get(oap->start.lnum) + bd.textcol; if (oap->op_type == OP_APPEND) firstline += bd.textlen; - if ((ins_len = (long)STRLEN(firstline) - pre_textlen) > 0) + if (pre_textlen >= 0 + && (ins_len = (long)STRLEN(firstline) - pre_textlen) > 0) { ins_text = vim_strnsave(firstline, (int)ins_len); if (ins_text != NULL) diff --git a/src/version.c b/src/version.c index b514a5b6..f6250cda 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 476, +/**/ 475, /**/ 474, |