Mercurial > vim
comparison src/normal.c @ 7001:27f8247d2619 v7.4.818
patch 7.4.818
Problem: 'linebreak' breaks c% if the last Visual selection was block.
(Chris Morganiser, Issue 389)
Solution: Handle Visual block mode differently. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 11 Aug 2015 17:46:36 +0200 |
parents | a25618cbc68a |
children | 286fd54c7ae3 |
comparison
equal
deleted
inserted
replaced
7000:2ffb934a31db | 7001:27f8247d2619 |
---|---|
9581 cap->retval |= CA_COMMAND_BUSY; /* don't call edit() now */ | 9581 cap->retval |= CA_COMMAND_BUSY; /* don't call edit() now */ |
9582 } | 9582 } |
9583 #endif | 9583 #endif |
9584 | 9584 |
9585 /* | 9585 /* |
9586 * calculate start/end virtual columns for operating in block mode | 9586 * Calculate start/end virtual columns for operating in block mode. |
9587 */ | 9587 */ |
9588 static void | 9588 static void |
9589 get_op_vcol(oap, redo_VIsual_vcol, initial) | 9589 get_op_vcol(oap, redo_VIsual_vcol, initial) |
9590 oparg_T *oap; | 9590 oparg_T *oap; |
9591 colnr_T redo_VIsual_vcol; | 9591 colnr_T redo_VIsual_vcol; |
9592 int initial; /* when true: adjust position for 'selectmode' */ | 9592 int initial; /* when TRUE adjust position for 'selectmode' */ |
9593 { | 9593 { |
9594 colnr_T start, end; | 9594 colnr_T start, end; |
9595 | 9595 |
9596 if (VIsual_mode != Ctrl_V) | 9596 if (VIsual_mode != Ctrl_V |
9597 || (!initial && oap->end.col < W_WIDTH(curwin))) | |
9597 return; | 9598 return; |
9598 | 9599 |
9599 oap->block_mode = TRUE; | 9600 oap->block_mode = VIsual_active; |
9600 | 9601 |
9601 #ifdef FEAT_MBYTE | 9602 #ifdef FEAT_MBYTE |
9602 /* prevent from moving onto a trail byte */ | 9603 /* prevent from moving onto a trail byte */ |
9603 if (has_mbyte) | 9604 if (has_mbyte) |
9604 mb_adjustpos(curwin->w_buffer, &oap->end); | 9605 mb_adjustpos(curwin->w_buffer, &oap->end); |