From fa9cd8b878c3100f893f4dc958ca62a7e18d2145 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 2 Dec 2016 16:02:11 -0500 Subject: vim-patch:7.4.1748 Problem: "gD" does not find match in first column of first line. (Gary Johnson) Solution: Accept match at the cursor. https://github.com/vim/vim/commit/1538fc34fae3fae39773ca43f6ff52401fce61d8 --- src/nvim/normal.c | 2 +- src/nvim/testdir/test_alot.vim | 1 + src/nvim/version.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 76e3829bee..a85c350e7b 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -3646,7 +3646,7 @@ nv_gd ( size_t len; char_u *ptr; if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0 - || !find_decl(ptr, len, nchar == 'd', thisblock, 0)) + || !find_decl(ptr, len, nchar == 'd', thisblock, SEARCH_START)) clearopbeep(oap); else if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP) foldOpenCursor(); diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 083f57aec1..c9d7b332e4 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -8,6 +8,7 @@ source test_ex_undo.vim source test_expr.vim source test_expr_utf8.vim source test_feedkeys.vim +source test_goto.vim source test_menu.vim source test_messages.vim source test_options.vim diff --git a/src/nvim/version.c b/src/nvim/version.c index 05855ee385..29e7990b1b 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -696,7 +696,7 @@ static int included_patches[] = { // 1751, // 1750 NA // 1749 NA - // 1748, + 1748, // 1747 NA // 1746 NA // 1745 NA -- cgit From a4f646dde87157f9aba8ca8e4bf4c87ad5366203 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 2 Dec 2016 16:03:39 -0500 Subject: vim-patch:f9660b5 Add missing test file. https://github.com/vim/vim/commit/f9660b59b2bdaa3ec2e7b31ab52186ad8b99f047 --- src/nvim/testdir/test_goto.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/nvim/testdir/test_goto.vim (limited to 'src') diff --git a/src/nvim/testdir/test_goto.vim b/src/nvim/testdir/test_goto.vim new file mode 100644 index 0000000000..fb8f190fa6 --- /dev/null +++ b/src/nvim/testdir/test_goto.vim @@ -0,0 +1,10 @@ +" Test commands that jump somewhere. + +func Test_geedee() + new + call setline(1, ["Filename x;", "", "int Filename", "int func() {", "Filename y;"]) + /y;/ + normal gD + call assert_equal(1, line('.')) + quit! +endfunc -- cgit From d9dffeb4868c2c036663faa142f1ed7b1d51400a Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 2 Dec 2016 20:29:00 -0500 Subject: lint --- src/nvim/normal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index a85c350e7b..312777d3b9 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -3646,10 +3646,11 @@ nv_gd ( size_t len; char_u *ptr; if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0 - || !find_decl(ptr, len, nchar == 'd', thisblock, SEARCH_START)) + || !find_decl(ptr, len, nchar == 'd', thisblock, SEARCH_START)) { clearopbeep(oap); - else if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP) + } else if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP) { foldOpenCursor(); + } } /* -- cgit