diff options
author | oni-link <knil.ino@gmail.com> | 2014-04-08 20:08:30 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-08 21:58:13 -0300 |
commit | d11f805150e644aa1c005729505c05971bdecc39 (patch) | |
tree | 423ace6638982f2b2b53ccb6240570ba336fe961 /src/ops.c | |
parent | ac620411383259400cff2f12ffe576f066ed4ca7 (diff) | |
download | rneovim-d11f805150e644aa1c005729505c05971bdecc39.tar.gz rneovim-d11f805150e644aa1c005729505c05971bdecc39.tar.bz2 rneovim-d11f805150e644aa1c005729505c05971bdecc39.zip |
vim-patch:7.4.186
Problem: Insert in Visual mode sometimes gives incorrect results.
(Dominique Pelle)
Solution: Remember the original insert start position. (Christian Brabandt,
Dominique Pelle)
https://code.google.com/p/vim/source/detail?r=4d12112c5efae071aecbeed1a7196f18950457b3
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -2142,16 +2142,16 @@ void op_insert(oparg_T *oap, long count1) /* The user may have moved the cursor before inserting something, try * to adjust the block for that. */ - if (oap->start.lnum == curbuf->b_op_start.lnum && !bd.is_MAX) { + if (oap->start.lnum == curbuf->b_op_start_orig.lnum && !bd.is_MAX) { if (oap->op_type == OP_INSERT - && oap->start.col != curbuf->b_op_start.col) { - oap->start.col = curbuf->b_op_start.col; + && oap->start.col != curbuf->b_op_start_orig.col) { + oap->start.col = curbuf->b_op_start_orig.col; pre_textlen -= getviscol2(oap->start.col, oap->start.coladd) - oap->start_vcol; oap->start_vcol = getviscol2(oap->start.col, oap->start.coladd); } else if (oap->op_type == OP_APPEND - && oap->end.col >= curbuf->b_op_start.col) { - oap->start.col = curbuf->b_op_start.col; + && oap->end.col >= curbuf->b_op_start_orig.col) { + oap->start.col = curbuf->b_op_start_orig.col; /* reset pre_textlen to the value of OP_INSERT */ pre_textlen += bd.textlen; pre_textlen -= getviscol2(oap->start.col, oap->start.coladd) |