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

Fix finding the start and end of the current query. #239

Merged
merged 1 commit into from
Oct 27, 2023
Merged

Fix finding the start and end of the current query. #239

merged 1 commit into from
Oct 27, 2023

Conversation

PhilRunninger
Copy link
Contributor

Fixes #173.

This isn't a treesitter solution, but it's at least a quick and easy, if only temporary, patch.

  1. start_request was searching forward from the cursor position. Adding 'b' to the search flags fixed that.
  2. Both start_request and end_request depended on the user having set 'nowrapscan' to prevent wrapping around the end of the file. Such wrapping could result in finding the wrong query. Adding 'W' to the search flags fixed that, and removed the need for the stopline parameter.
  3. Refactored the way last_line is used in end_request.

1. start_request was searching forward from the cursor position. Adding
   'b' to the search flags fixed that.
2. Both start_request and end_request depended on the user having set
   'nowrapscan' to prevent wrapping around the end of the file. Such
   wrapping could result in finding the wrong query. Adding 'W' to the
   search flags fixed that, and removed the need for the stopline
   parameter.
3. Refactored the way last_line is used in end_request.
Copy link
Member

@NTBBloodbath NTBBloodbath left a comment

Choose a reason for hiding this comment

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

Thank you so much for this patch. It is indeed a great solution in the meantime :)

@NTBBloodbath NTBBloodbath merged commit b8d6c0a into rest-nvim:main Oct 27, 2023
2 checks passed
@PhilRunninger PhilRunninger deleted the fix-query-selection branch October 28, 2023 05:05
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.

wrong query selected in multiple query file
2 participants