romainl / vim-qlist

Persist the results of :ilist and related commands via the quickfix list.
MIT License
68 stars 7 forks source link

Add :Checkpath and :Checkpath! #7

Open kiryph opened 6 years ago

kiryph commented 6 years ago

I like the idea of using the quickfix list for [I and [D.

What about the builtin commands :checkpath and :checkpath! also described under :h include-search?

romainl commented 6 years ago

How do you think it could work?

kiryph commented 6 years ago

I am not sure if I got you right: do you mean how to do this technically or how it should work from a user point of view?

kiryph commented 6 years ago

I've raised a somewhat related issue here https://github.com/lervag/vimtex/issues/1148. For my given example, :che! returns (invoked in chapter1.tex):

--- Included files in path ---
main.tex
main.tex -->
  chapter1.tex
  chapter1.tex -->
    main.tex  (Already listed)    

For [I on \vec one gets a list with a filename and a line number:

main.tex
  1:    3 \renewcommand{\vec}[1]{\mathbf{#1}}
  2:    7 $\vec{a}\cdot\vec{b}$
main.tex (includes previously listed match)
chapter1.tex
  3:    4 $\vec{a}\cdot\vec{b}$

I guess I had hoped to have something like this for the included files

chapter1.tex|1 col 1| main.tex
main.tex|8 col 1| chapter1.tex (Skip: cyclic include)

I think I see your point: the return value of :checkpath! does not return the filename and line number where the file is included. Too bad.

I assume I can close this issue.

romainl commented 6 years ago

This could be added to the longterm goals of the new-parsers branch.