stefandtw / quickfix-reflector.vim

Change code right in the quickfix window
MIT License
347 stars 18 forks source link

Request: Support modifying paths (Line disappears when path is modified) #3

Closed idbrii closed 10 years ago

idbrii commented 10 years ago

I'm looking at replacing jceb/vim-editqf (edits your qf entries in a scratch buffer, but doesn't apply changes to files -- useful for filtering through errors or grep results) with quickfix-reflector (which I see as doing the same thing, but also allowing you to modify files from the quickfix). (Replacing instead of supplementing because the two plugins conflict: editqf remaps all editing keys in the quickfix.)

Sometimes my dumb compiler outputs the wrong full path and I need to fix it (and I haven't figured out a cleverer way to script it). qf-reflector doesn't support modifying paths within the quickfix. When I modify a path with quickfix-reflector and save (:w), it deletes that line from the quickfix.

Is deleting the line the intended behavior (it seemed surprising to me)? Is it possible to accept the new path instead?

stefandtw commented 10 years ago

Hi!

I just looked at how vim-editqf works. What you see in vim-editqf's scratch buffer is pretty much the full data of your quickfix entries, including in which column it starts, the error type and an unabbreviated file name. This would make it possible to completely change or add entries however you like.

On the other hand, the normal quickfix window that is used with quickfix-reflector.vim may have abbreviated file names (perhaps including directories). Basically it's a front-end to Vim's quickfix list and it may not display enough information to fully recreate quickfix entries.

That's why quickfix-reflector.vim can replace only the actual file content. The other parts of the line in the quickfix window are used to find the entry again after it has changed. This is necessary because the user may delete lines or sort them in a different way. Also, replacing text is really the main focus of the plug-in.

To sum things up, I don't see a clean or easy way to implement this. Sorry!

I think you are right trying to fix the compiler output. (If a simple regex does not do the job, maybe use a recorded Vim macro called via vim -c ... ;) . That is, if it outputs wrong paths in a consistent way)

Possibly another way for you might be to see if the special key mappings of vim-editqf can somehow be remapped so you could use both plug-ins in parallel.