Skip to content

Better fontification of file names and line numbers in ivy results #399

Description

@hmelman

This is more a feature request. I'd like the formatting in an ivy buffer to be more consistent and more like compliation-mode or grep-mode.

counsel-grep lines begin "linenumber:" and swiper lines don't have the colon. Seems like that could be unified. Then there are other lines like from counsel-git-grep or other multifile searches that are prefixed "filename:linenumber:".

I think it would be nice if filenames were in compilation-info face and line numbers were in compilation-line-number face (which are what compilation mode uses (and grep-mode defaults to). It would be great if ivy could figure this out automatically so that new commands got this too. Also the match highlighting that happens of the typed in text, should be limited to after the file name or line number. Now if the search string is in the file name, it's highlighted as well.

In writing my own counsel-zgrep using counsel--async-command I'm not quite sure where to plug this in. I think ivy does the fontification as things are added to the minibuffer, but I don't have an easy hook into that. Following compilation-mode's model I think would be to turn on font-lock in the *counsel* buffer and have it highlighted as text is added to it, then hopefully those text properties would be preserved as they're copied into the minibuffer for display.

Just an idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions