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 #493: strip whitespace from current_query and selection #494

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

tconbeer
Copy link
Owner

@tconbeer tconbeer commented Mar 29, 2024

Closes #493

What are the key elements of this solution?
This PR strips whitespace from editor.current_query, editor.previous_query, and app._validate_selection, so that the previous query is executed when the current query is only whitespace. The previous behavior was confusing (see issue).

Why did you design your solution this way? Did you assess any alternatives? Are there tradeoffs?
The database doesn't care about whitespace, so it's better to strip it than add new logic with isspace, etc.

Does this PR require a change to Harlequin's docs?

  • No.
  • Yes, and I have opened a PR at tconbeer/harlequin-web.
  • Yes; I haven't opened a PR, but the gist of the change is: ...

Did you add or update tests for this change?

  • Yes.
  • No, I believe tests aren't necessary.
  • No, I need help with testing this change.

Please complete the following checklist:

  • I have added an entry to CHANGELOG.md, under the [Unreleased] section heading. That entry references the issue closed by this PR.
  • I acknowledge Harlequin's MIT license. I do not own my contribution.

@tconbeer tconbeer merged commit bf28964 into main Mar 29, 2024
10 checks passed
@ml31415
Copy link

ml31415 commented Mar 29, 2024

Big thanks for the quick fix!

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.

Harlequin does not run previous query when current query is only whitespace
2 participants