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

Peculiar does not support incremental search highlighting #5

Closed
pluma9 opened this issue May 2, 2021 · 4 comments · Fixed by #6
Closed

Peculiar does not support incremental search highlighting #5

pluma9 opened this issue May 2, 2021 · 4 comments · Fixed by #6

Comments

@pluma9
Copy link

pluma9 commented May 2, 2021

I've just found this plugin today, it's brilliant.

When manually typing :g/pattern, I got great satisfaction from watching the matching text being highlighted. In many cases, it helps me confirm that there's no typo in the pattern. However, this does not happen when I use PeculiarG. Is there any chance that PeculiarG can support text highlighting?

@JRasmusBm
Copy link
Owner

JRasmusBm commented May 2, 2021

Happy I could help! 😄

The current implementation of the prompt is non-interactive. Thus I only know what you searched for when you submit.

Maybe one day to the power of lua I could try to build an interactive prompt, but currently I have no plan to do so:

  1. Because it would exclude regular vim users 😇
  2. Because it is a large refactor and I don't see the person need for the feature at this time.

If you know how to do this and make it performent, I will happily accept PRs 😄

In the meantime I would suggest the following workaround for searches for you really need incremental highlighting:

  1. First perform the search the normal v way (either with / or with pressing * or # on a word).
  2. Now run PeculiarG/PeculiarV, leaving the search field empty (Peculiar should pick the last search from the search history) 😄

Does this workaround make sense to you?

@JRasmusBm
Copy link
Owner

One potential dream scenario for this later on will be if you could use Lua to display a preview of the result of running the command against the file. 😇

This issue is very close to a wontfix because the plugin doesn't need it and it is a lot of work, but I will review PRs if someone submits an attempt 😄

@andymass
Copy link

andymass commented May 2, 2021

One "simple" possibility is instead of taking input() for the G mode, just pre-populate the cmdline with g/\v[cursor]/Peculiar or (a bit more complex), g/\v[cursor] and use CmdlineLeave to get special behavior. This will allow incsearch to be completely native.

@JRasmusBm
Copy link
Owner

@andymass Great idea, I will experiment with that 😄

@JRasmusBm JRasmusBm changed the title PenculiarG does not highlight the text that matches the specified pattern PeculiarG does not highlight the text that matches the specified pattern May 2, 2021
@JRasmusBm JRasmusBm changed the title PeculiarG does not highlight the text that matches the specified pattern Peculiar does not support incremental search highlighting May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants