Open ChuckM2196 opened 7 months ago
Thanks for working on this!
As I wrote in the issue, you probably don't want to actually google multiple lines. For example, let's say someone selects all text in the whole file, right-click, and accidentally click the googling button. We don't want to send a google search that is hundreds of lines long.
A better fix would be to modify the add_rightclick_option()
function, so that there's some way to disallow multiple lines. For example, it could look like this:
rightclick_menu.add_rightclick_option(
"Search selected text on Google", google_search, needs_selected_text_single_line=True
)
where needs_selected_text_single_line=True
would be a new parameter that you would add to the function.
This will need several things to be changed in rightclick_menu.py
. Let me know if you need help :)
So we could still have the feature if someone wanted it, but have it optional and set it to disabled by default? I'll look into rightclick_menu.py
to see what would need to be changed.
I don't think anyone wants to google multiple lines at once. We can change it later if someone actually makes an issue and asks for it.
You can Google with newlines?
Google will replace it with a space, but yes, this is a completely valid search query: https://www.google.com/search?q=foo%0Abar
Just starting to learn to contribute to other projects. So I have no idea if I'm doing this correctly. Fixes #1427 - Fixed the issue of now allowing google searches with multiple lines selected Edited line 19 in plugins/google_search.py to include an additional conditional with multiple lines