Friday, August 25, 2017

How to use stop directory in up/down search

I'm struggling to understand how to use "stop directories" in a combined upward/downward search.

I have the following directory layout:

/home/user/test/
| nosearch/
| | file.txt
| stopdir/
| | somedir/


I expect these commands in Vim to NOT find the file "file.txt", because the search should stop at "stopdir" and avoid searching the "nosearch" directory:

:cd /home/user/test/stopdir/somedir
:echo findfile('file.txt', '**;/home/user/test/stopdir')

However, instead I get the output:

/home/user/test/nosearch/file.txt

Likewise, if I do the following:

:set path=**;/home/user/test/stopdir
:find file.txt

Then file.txt is edited.

What am I doing wrong? I thought I'm doing just about exactly what's documented in the help under :help starstar, item 3) "Combined up/downward search".

Tested in a "HUGE" 8.0.987 build on both Windows 10 and an Xubuntu VM.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment