Mercurial > vim
comparison src/ops.c @ 10670:bce3eccea39a v8.0.0225
patch 8.0.0225: put in Visual block mode terminates early
commit https://github.com/vim/vim/commit/9957a10d0f0c34d8083af6ed66e198e4796038e0
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 23 21:53:53 2017 +0100
patch 8.0.0225: put in Visual block mode terminates early
Problem: When a block is visually selected and put is used on the end of
the selection only one line is changed.
Solution: Check for the end properly. (Christian Brabandt, neovim issue
5781)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 23 Jan 2017 22:00:04 +0100 |
parents | 94db9c08e206 |
children | 3d1872fbecc4 |
comparison
equal
deleted
inserted
replaced
10669:f916ebf3a8b2 | 10670:bce3eccea39a |
---|---|
3772 /* | 3772 /* |
3773 * simple case: insert into current line | 3773 * simple case: insert into current line |
3774 */ | 3774 */ |
3775 if (y_type == MCHAR && y_size == 1) | 3775 if (y_type == MCHAR && y_size == 1) |
3776 { | 3776 { |
3777 linenr_T end = curbuf->b_visual.vi_end.lnum; | |
3778 | |
3779 if (curbuf->b_visual.vi_end.lnum < curbuf->b_visual.vi_start.lnum) | |
3780 end = curbuf->b_visual.vi_start.lnum; | |
3781 | |
3777 do { | 3782 do { |
3778 totlen = count * yanklen; | 3783 totlen = count * yanklen; |
3779 if (totlen > 0) | 3784 if (totlen > 0) |
3780 { | 3785 { |
3781 oldp = ml_get(lnum); | 3786 oldp = ml_get(lnum); |
3799 curwin->w_cursor.col += (colnr_T)(totlen - 1); | 3804 curwin->w_cursor.col += (colnr_T)(totlen - 1); |
3800 } | 3805 } |
3801 } | 3806 } |
3802 if (VIsual_active) | 3807 if (VIsual_active) |
3803 lnum++; | 3808 lnum++; |
3804 } while (VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum); | 3809 } while (VIsual_active && lnum <= end); |
3805 | 3810 |
3806 if (VIsual_active) /* reset lnum to the last visual line */ | 3811 if (VIsual_active) /* reset lnum to the last visual line */ |
3807 lnum--; | 3812 lnum--; |
3808 | 3813 |
3809 curbuf->b_op_end = curwin->w_cursor; | 3814 curbuf->b_op_end = curwin->w_cursor; |