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

PR: Add wrap lines action in Source menu and shortcut for it #20090

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from

Conversation

maurerle
Copy link
Contributor

@maurerle maurerle commented Nov 19, 2022

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)

Added wrap lines Command in Source Menu
Added Alt + Z as a shortcut for it, as it is used by VSCode and this shortcut is currently unused

Issue(s) Resolved

Supersedes #13496
Fixes #7997

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: Florian Maurer

@maurerle maurerle changed the title Feature/wrap lines menu PR: Add wrap lines action in source menu Nov 19, 2022
@ccordoba12 ccordoba12 changed the title PR: Add wrap lines action in source menu PR: Add wrap lines action in Source menu and shortcut for it Nov 19, 2022
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Thanks @maurerle for reviving @arteagac's contribution! I tested this locally and it's working as expected.

However, I'd be in favor of wrapping lines per file instead of doing it for all files (as in this PR). That's why I'd suggest to change wrap_lines_action to be a regular action (i.e. non-checkable), such as trailingspaces_action, which only has effect for the current file.

By doing that, we'll also be able to remove this option in our Preferences:

image

which I think is of little value because you don't want to see all your files wrapped.

@ccordoba12 ccordoba12 changed the base branch from master to 5.x November 19, 2022 17:14
@maurerle
Copy link
Contributor Author

This is a display/visualization setting which has two states (wrap lines on or off) I don't think that something without a checkbox is sufficient here.
It does not change the actual lines like traliningspaces_action does.

Notepad++ has this feature implemented as it is currently in spyder (once for all views).
PyCharm and VSCode remember this setting per opened editor.
All three use checkboxes to indicate the current setting.

I actually like the behavior as it is best.

@pep8speaks
Copy link

pep8speaks commented Oct 12, 2023

Hello @maurerle! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2023-11-28 11:53:13 UTC

@maurerle
Copy link
Contributor Author

Wouldn't this be a nice addition to the 6.0 release too? 😊

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.

Include toggable "Wrap lines" checkbox in Source menu for easy access
3 participants