Ramel Eshed wrote:

> Hi Bram,
> 
> On Thursday, July 7, 2016 at 10:24:49 PM UTC+3, Bram Moolenaar wrote:
> > There has been a request that when adding items to the quickfix list, no
> > buffer is created to hold the file name.
> > 
> > The reason is that when there are many different file names this causes
> > the buffer list to get very long, which then causes various operations
> > to become slow.  Including finding the buffer for a file name.
> > 
> > Instead of using a buffer, where the file name is stored, and then using
> > the buffer number, the file name itself could be remembered.
> > 
> > Since there are so many quickfix commands, adding a flag to every one of
> > them would be creating quite a mess.  We could add an option, but
> > that has the danger of forgetting to reset the option after the
> > operation.  And it requires three more statements (save current value,
> > set the option, restore th option).  So I was thinking of using a command
> > modifier:
> > 
> >     :usefname caddexpr {expr}
> > 
> > How about that?
> > 
> Sounds good. Maybe we could also have an option only for search
> commands like :grep since this mode is most useful there? (Actually,
> this was one of the reasons which convinced me that quickfix is not
> the right tool to use for searches. See
> https://github.com/ramele/agrep).

What is called quickfix is what grew out of the actual quickfix feature
on the Amiga.  Now it's everything related to a list of locations with
various extra bells and whistles.  I would not want to duplicate code
and commands to have a separate list of search results.

> > Storing the file name instead of a buffer number has a few
> > disadvantages:
> > - When inserting or deleting lines in the file the position of the
> >   quickfix items is not adjusted.
> > - Using more memory to store a copy of the file name.
> > - Changing directory can make the file name invalid.  We could store the
> >   full path, but creating that also adds overhead.  Hmm, perhaps we
> >   could store the full path the moment the directory is changed.
> 
> Can't we just save the original working directory used when the
> quickfix list was created and use it when jumping to files stored with
> a relative path?

That's the same as turning the file name into a full name.  Not sure how
much overhead this has.  Anyway, doing it just before changing directory
is probably not too difficult.

-- 
hundred-and-one symptoms of being an internet addict:
227. You sleep next to your monitor.  Or on top of it.

 /// 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.

Raspunde prin e-mail lui