To: vim_dev@googlegroups.com Subject: Patch 8.0.1464 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1464 Problem: Completing directory after :find does not add slash. Solution: Adjust the flags for globpath(). (Genki Sky) Files: src/misc1.c, src/testdir/test_find_complete.vim *** ../vim-8.0.1463/src/misc1.c 2017-12-19 21:23:16.813960405 +0100 --- src/misc1.c 2018-02-03 20:42:56.167191549 +0100 *************** *** 10761,10766 **** --- 10761,10767 ---- char_u *curdir; garray_T path_ga; char_u *paths = NULL; + int glob_flags = 0; if ((curdir = alloc((unsigned)MAXPATHL)) == NULL) return 0; *************** *** 10777,10783 **** if (paths == NULL) return 0; ! globpath(paths, pattern, gap, (flags & EW_ICASE) ? WILD_ICASE : 0); vim_free(paths); return gap->ga_len; --- 10778,10788 ---- if (paths == NULL) return 0; ! if (flags & EW_ICASE) ! glob_flags |= WILD_ICASE; ! if (flags & EW_ADDSLASH) ! glob_flags |= WILD_ADD_SLASH; ! globpath(paths, pattern, gap, glob_flags); vim_free(paths); return gap->ga_len; *** ../vim-8.0.1463/src/testdir/test_find_complete.vim 2017-11-16 21:52:07.655021738 +0100 --- src/testdir/test_find_complete.vim 2018-02-03 20:29:55.896725018 +0100 *************** *** 86,91 **** --- 86,97 ---- call feedkeys(":find f\t\n", "xt") call assert_equal('Holy Grail', getline(1)) + " Test that find completion on directory appends a slash + call feedkeys(":find in/pa\tfile.txt\n", "xt") + call assert_equal('E.T.', getline(1)) + call feedkeys(":find ./i\tstuff.txt\n", "xt") + call assert_equal('Another Holy Grail', getline(1)) + " Test shortening of " " foo/x/bar/voyager.txt *** ../vim-8.0.1463/src/version.c 2018-02-03 20:11:36.416891937 +0100 --- src/version.c 2018-02-03 20:29:00.917101625 +0100 *************** *** 773,774 **** --- 773,776 ---- { /* Add new patch number below this line */ + /**/ + 1464, /**/ -- "Never be afraid to tell the world who you are." -- Anonymous /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///