Scott Prager wrote:
> On Friday, August 8, 2014 4:03:32 PM UTC-4, Bram Moolenaar wrote:
>
> > I wonder, is an option the right way to change behavior?
>
> I've thought of three possibilities:
> 1) Make it a flag--one person suggested "-bfs". I tried this first, but
> don't understand how the "ex_" functions work yet, and I don't want
> to confuse ":edit" since ":find" and ":edit" share one exarg_T.
> Some advice would be appreciated.
> 2) Add a different command, like ":near" that use BFS.
> 3) The option.
>
> (1) and (2) seem reasonable, but I like (3) because there may be other places
> in vim that could use BFS over DFS (findfile(), finddir(), :Explore, etc),
> but I suppose that has the same lack of control.
>
> What has vim done in the past when faced with such design decisions?
Well, an alternative is to make the option a list of items, where each
item enables the behavior for a place where the search is used.
However, the problem with such an option is that any plugin that depends
on the specific behavior will need to save and restore that option. And
old plugins won't even know the options exists. This makes life for
plugin writers complicated.
If there is a way to avoid the option and add a flag to the specific
situation where the choice can be made, that would be preferred. At
least for findfile() it would be possible to add another argument.
And using ":findflat" (or some other name) instead of ":find" is also
nice, since the user can decide what he wants without changing the
option (and changing it back afterwards).
> > E.g. one might not what to change
> >
> > tags file search.
>
> A few places in vim's source, an option is disabled and then re-enabled
> after the routine is finished. Would that be fine?
It would work, but it gets complicated. It's better to pass an argument
in function calls to choose the behavior.
> > It would be good to have more tests for this. The find-file stuff has
> >
> > had several bugs in the past.
>
> I'll get right on it.
Thanks.
--
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
are already highlighted in purple.
/// Bram Moolenaar -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.