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

feat: independent search #30

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tbung
Copy link
Contributor

@tbung tbung commented Jan 10, 2022

Closes #5.

I'll commit some more documentation later (i.e. on replacing rg with a different tool). We may consider replacing rg by default with grep, although rg is faster everybody has grep installed.

@vuki656
Copy link

vuki656 commented Jan 10, 2022

Regarding rg, I'd suggest checking if it's executable and if not, falling back to grep since as you said most people have it installed.

If you default to grep, a good chunk of people won't bother to change it and will have a worse experience out of the box.

@tbung
Copy link
Contributor Author

tbung commented Jan 10, 2022

Good idea, added!

command = "grep"
end


if vim.fn.executable(command) ~= 1 then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably isn't needed anymore

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth just keeping this just in case

Copy link
Contributor Author

@tbung tbung Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this basically cleanly saveguards against not having grep installed. I know grep is on every Linux system, I don't know about macOS, and I'm sure Windows doesn't have it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this check on line 27 and on line 21 are the same?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's to check for rg then grep

@petertriho
Copy link
Owner

This is looking good. I'll need to test this before I merge this in but do you know if this works with things like ignorecase?

@tbung
Copy link
Contributor Author

tbung commented Jan 11, 2022

I completely forgot about that, I will have to conditionally add some flags. Shouldn't be difficult, I'll update later today.

@CallumHoward
Copy link

Any update on this one?

@petertriho
Copy link
Owner

@CallumHoward Refactor of the main codebase is in the works, I'll try to add independent search based off this when I have the chance

@CallumHoward
Copy link

I'm excited for this refactor! Thanks for your hard work

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 this pull request may close these issues.

[Feature Request] Make search marks independent of hlslens
4 participants