From 713a957e9c90fc1c57935e33346347807595f946 Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Sun, 10 Sep 2017 18:21:52 +0800 Subject: vim-patch:8.0.0282 vim-patch:8.0.0291 (#7255) vim-patch:8.0.0291 Problem: Visual block insertion does not insert in all lines. Solution: Don't bail out of insert too early. Add a test. (Christian Brabandt, closes vim/vim#1290) https://github.com/vim/vim/commit/23fa81d2223cd9bb7c51829c48047b2976bc2d11 vim-patch:8.0.0282 Problem: When doing a Visual selection and using "I" to go to insert mode, CTRL-O needs to be used twice to go to Normal mode. (Coacher) Solution: Check for the return value of edit(). (Christian Brabandt, closes #1290) https://github.com/vim/vim/commit/0b5c93a7f266cd8c90ea27bdaf9f7214a95d64d7 --- src/nvim/normal.c | 5 ++++- src/nvim/ops.c | 2 +- src/nvim/testdir/test_visual.vim | 13 +++++++++++++ src/nvim/version.c | 4 ++-- 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 6415bec846..c40ed58550 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1942,8 +1942,11 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) * the lines. */ auto_format(false, true); - if (restart_edit == 0) + if (restart_edit == 0) { restart_edit = restart_edit_save; + } else { + cap->retval |= CA_COMMAND_BUSY; + } } break; diff --git a/src/nvim/ops.c b/src/nvim/ops.c index c01840cfd0..99dc4670f1 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -2060,7 +2060,7 @@ void op_insert(oparg_T *oap, long count1) } t1 = oap->start; - edit(NUL, false, (linenr_T)count1); + (void)edit(NUL, false, (linenr_T)count1); // When a tab was inserted, and the characters in front of the tab // have been converted to a tab as well, the column of the cursor diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index cf0e535937..74c26e3d66 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -15,3 +15,16 @@ func Test_block_shift_multibyte() call assert_equal(' ヹxxx', getline(2)) q! endfunc + +func Test_Visual_ctrl_o() + new + call setline(1, ['one', 'two', 'three']) + call cursor(1,2) + set noshowmode + set tw=0 + call feedkeys("\jjlIa\\:set tw=88\\", 'tx') + call assert_equal(['oane', 'tawo', 'tahree'], getline(1, 3)) + call assert_equal(88, &tw) + set tw& + bw! +endfu diff --git a/src/nvim/version.c b/src/nvim/version.c index ce1cc03c1f..e7061fff9d 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -661,7 +661,7 @@ static const int included_patches[] = { // 294, // 293, // 292, - // 291, + 291, 290, // 289, // 288 NA @@ -670,7 +670,7 @@ static const int included_patches[] = { // 285 NA // 284 NA // 283, - // 282, + 282, // 281 NA 280, // 279 NA -- cgit From ceade2fe53175555c44fdc4b65530f18aeb17591 Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Sun, 10 Sep 2017 18:52:43 +0800 Subject: vim-patch:8.0.0186 (#7154) Problem: The error message from assert_notequal() is confusing. Solution: Only mention the expected value. https://github.com/vim/vim/commit/5869cf060e60cc09e71b2b3bd85f0576ec78f9f5 --- src/nvim/eval.c | 24 +++++++++++++----------- src/nvim/version.c | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d6ee13857a..5ee91d417a 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6747,6 +6747,8 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, } else { if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH) { ga_concat(gap, (char_u *)"Pattern "); + } else if (atype == ASSERT_NOTEQUAL) { + ga_concat(gap, (char_u *)"Expected not equal to "); } else { ga_concat(gap, (char_u *)"Expected "); } @@ -6757,18 +6759,18 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, } else { ga_concat(gap, exp_str); } - tofree = (char_u *)encode_tv2string(got_tv, NULL); - if (atype == ASSERT_MATCH) { - ga_concat(gap, (char_u *)" does not match "); - } else if (atype == ASSERT_NOTMATCH) { - ga_concat(gap, (char_u *)" does match "); - } else if (atype == ASSERT_NOTEQUAL) { - ga_concat(gap, (char_u *)" differs from "); - } else { - ga_concat(gap, (char_u *)" but got "); + if (atype != ASSERT_NOTEQUAL) { + if (atype == ASSERT_MATCH) { + ga_concat(gap, (char_u *)" does not match "); + } else if (atype == ASSERT_NOTMATCH) { + ga_concat(gap, (char_u *)" does match "); + } else { + ga_concat(gap, (char_u *)" but got "); + } + tofree = (char_u *)encode_tv2string(got_tv, NULL); + ga_concat(gap, tofree); + xfree(tofree); } - ga_concat(gap, tofree); - xfree(tofree); } } diff --git a/src/nvim/version.c b/src/nvim/version.c index e7061fff9d..4c0071f248 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -766,7 +766,7 @@ static const int included_patches[] = { // 189, 188, // 187 NA - // 186, + 186, // 185, // 184, // 183, -- cgit