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

formatters_reformat_selection: handle case that nothing was selected #422

Merged
merged 1 commit into from
May 2, 2021

Conversation

rntz
Copy link
Collaborator

@rntz rntz commented Apr 25, 2021

No description provided.

Copy link
Collaborator

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Looks good with one question

@@ -263,6 +263,9 @@ def formatters_reformat_last(formatters: str) -> str:
def formatters_reformat_selection(formatters: str) -> str:
"""Reformats the current selection."""
selected = edit.selected_text()
if not selected:
print("Asked to reformat selection, but nothing selected!")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't have a warning system to use for this kind of thing? If not then obv out of scope here but might be a useful thing to make at some point

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there is Python's logging.warning() but @knausj85 seemed to prefer print()?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with logging.warning - my suggestion on another PR was to open an issue so we remember switch to logging.warning more broadly if its useful to folks.

I previously hadn't really bothered since I run with zero output unless explicitly debugging something.

@knausj85
Copy link
Member

knausj85 commented May 2, 2021

i am going to go ahead and merge this one as is, please open an issue if you guys feel we should move to using logging.warning etc broadly and we can get it done

@knausj85 knausj85 merged commit 78a6f4d into talonhub:master 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 this pull request may close these issues.

None yet

3 participants