Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gives wrong results with ivy-occur #7

Closed
Gleek opened this issue Feb 17, 2021 · 5 comments · Fixed by #8
Closed

Gives wrong results with ivy-occur #7

Gleek opened this issue Feb 17, 2021 · 5 comments · Fixed by #8
Labels
question Further information is requested

Comments

@Gleek
Copy link
Contributor

Gleek commented Feb 17, 2021

ivy-occur can be used to get the filtered results in a separate buffer.
It is similar to the default action which opens up the result in *jq-json* buffer but instead uses an occur buffer.

This can help in filtering multiple json objects and compare the filtered results without having subsequent runs replace the results of previous ones.

Running ivy-occur (C-c C-o by default I think) opens up the full json object instead of only displaying the filtered results.

I'm unsure of what might be causing this or if this is a bug upstream in ivy.

@munen
Copy link
Contributor

munen commented Feb 18, 2021

Hi @Gleek

Thanks for checking out counsel-jq!

Could you make a screencast showing what you're doing? I'm not a user of ivy-occur and don't understand how you compose it with counsel-jq from the description.

@munen munen added the question Further information is requested label Feb 18, 2021
@Gleek
Copy link
Contributor Author

Gleek commented Feb 18, 2021

Hello @munen,

Please see the screencast below. I first demo a sample run of ivy-occur on counsel-describe-variable function.
Running ivy-occur after some filtering returns the filtered results in a buffer.
Next I run counsel jq on a json and filter to a limited result. Running ivy-occur now does not retain the results, but instead shows the original json as is.

ivy-occur-counsel-jq.mp4

@munen
Copy link
Contributor

munen commented Feb 18, 2021

Thank you for providing that screencast, I can see it now! 👍

I assume ivy-occur is a wrapper around occur and that there's state tracked somewhere inside of ivy. counsel-jq uses ivy and counsel for dynamically querying an external command (jq). If ivy does not implicitly track this state, I assume that it has to be tracked explicitly to be compatible with ivy-occur (or maybe less likely that it is a bug within ivy).

Are you interested in looking into this and creating a PR for it?

@Gleek
Copy link
Contributor Author

Gleek commented Feb 19, 2021

I'll see if I can figure out something this weekend. 🙂

@munen
Copy link
Contributor

munen commented Feb 19, 2021

Cool, looking forward to it^^

Gleek added a commit to Gleek/counsel-jq that referenced this issue Feb 19, 2021
- Updates `ivy--old-cands‘ with the result of counsel-jq (Fixes 200ok-ch#7)
- Configurable buffer name and binary
Gleek added a commit to Gleek/counsel-jq that referenced this issue Feb 19, 2021
- Updates `ivy--old-cands‘ with the result of counsel-jq (Fixes 200ok-ch#7)
- Configurable buffer name and binary
Gleek added a commit to Gleek/counsel-jq that referenced this issue Feb 22, 2021
- Updates `ivy--old-cands‘ with the result of counsel-jq (Fixes 200ok-ch#7)
- Configurable buffer name and binary
@munen munen closed this as completed in #8 Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants