diff src/testdir/test_goto.vim @ 22502:1503ecd54f8a v8.2.1799

patch 8.2.1799: some Normal mode commands not fully tested Commit: https://github.com/vim/vim/commit/d1ad99b65470d3e754f6a0588a6b0dc2214a1eab Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 4 16:16:54 2020 +0200 patch 8.2.1799: some Normal mode commands not fully tested Problem: Some Normal mode commands not fully tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/7073)
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Oct 2020 16:30:03 +0200
parents a4bd28e2cf1d
children dbec60b8c253
line wrap: on
line diff
--- a/src/testdir/test_goto.vim
+++ b/src/testdir/test_goto.vim
@@ -122,6 +122,24 @@ func Test_gd()
   call XTest_goto_decl('gd', lines, 3, 14)
 endfunc
 
+" Using gd to jump to a declaration in a fold
+func Test_gd_with_fold()
+  new
+  let lines =<< trim END
+    #define ONE 1
+    #define TWO 2
+    #define THREE 3
+
+    TWO
+  END
+  call setline(1, lines)
+  1,3fold
+  call feedkeys('Ggd', 'xt')
+  call assert_equal(2, line('.'))
+  call assert_equal(-1, foldclosedend(2))
+  bw!
+endfunc
+
 func Test_gd_not_local()
   let lines =<< trim [CODE]
     int func1(void)