mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
vim-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)
89c17c02ca
This commit is contained in:
@@ -7782,7 +7782,7 @@ static void nv_open(cmdarg_T *cap)
|
|||||||
n_opencmd(cap);
|
n_opencmd(cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate start/end virtual columns for operating in block mode
|
// Calculate start/end virtual columns for operating in block mode.
|
||||||
static void get_op_vcol(
|
static void get_op_vcol(
|
||||||
oparg_T *oap,
|
oparg_T *oap,
|
||||||
colnr_T redo_VIsual_vcol,
|
colnr_T redo_VIsual_vcol,
|
||||||
@@ -7792,11 +7792,14 @@ static void get_op_vcol(
|
|||||||
colnr_T start;
|
colnr_T start;
|
||||||
colnr_T end;
|
colnr_T end;
|
||||||
|
|
||||||
if (VIsual_mode != Ctrl_V) {
|
if (VIsual_mode != Ctrl_V
|
||||||
|
|| (!initial && oap->end.col < curwin->w_width)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
oap->motion_type = MBLOCK;
|
if (VIsual_active) {
|
||||||
|
oap->motion_type = MBLOCK;
|
||||||
|
}
|
||||||
|
|
||||||
// prevent from moving onto a trail byte
|
// prevent from moving onto a trail byte
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
|
@@ -81,6 +81,13 @@ Go
|
|||||||
aaa
|
aaa
|
||||||
aaa
|
aaa
|
||||||
a2k2j~e.
|
a2k2j~e.
|
||||||
|
:let g:test ="Test 10: using normal commands after block-visual"
|
||||||
|
:$put =g:test
|
||||||
|
:set linebreak
|
||||||
|
Go
|
||||||
|
abcd{ef
|
||||||
|
ghijklm
|
||||||
|
no}pqrs2k0f{c%
|
||||||
:%w! test.out
|
:%w! test.out
|
||||||
:qa!
|
:qa!
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
@@ -46,3 +46,6 @@ Test 9: using redo after block visual mode
|
|||||||
AaA
|
AaA
|
||||||
AaA
|
AaA
|
||||||
A
|
A
|
||||||
|
Test 10: using normal commands after block-visual
|
||||||
|
|
||||||
|
abcdpqrs
|
||||||
|
@@ -470,7 +470,7 @@ static int included_patches[] = {
|
|||||||
// 821,
|
// 821,
|
||||||
820,
|
820,
|
||||||
// 819,
|
// 819,
|
||||||
// 818,
|
818,
|
||||||
817,
|
817,
|
||||||
816,
|
816,
|
||||||
815,
|
815,
|
||||||
|
Reference in New Issue
Block a user