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
Lines not wrapping in editor #4622
Comments
Thanks for reporting. We'll take a look at this after we release Spyder 3.2. |
I think this is the intended behavior, the lines wrap according to the width of the editor; the vertical line at 79 characters (edge line) is just a guide, and isn't for wrapping lines. @ccordoba12 should we add and option for wrapping lines at edge line? although I don't think that option could be useful (I haven't see that option in other editors) |
Yeah, you're right. @aliceell, it's a bit unintuitive, but I don't think we're going to fix it. Thanks for taking the time to report this, though. |
Actually, auto-wrapping at the line margin seems both common and useful imo. For example, emacs does this in auto-fill-mode and MATLAB does as well. Otherwise one is left manually wrapping lines continually to make the comments uncluttered. Is there a better way? |
I was just looking into this, it's a usefull feature if you want to print your code on paper (and I actualy want to do this, because I need to major restructuring in my code and it seems easyer to do it on paper :p ) |
I see this is closed, but I'd like to point out a difference that doesn't seem clearly state here, and may be worth reopening the issue (or transforming it in a feature request). There is "visual" auto-wrapping, and text-level auto-wrapping. What Spyder does now, which I think is fine, is visual auto-wrapping to the width of the window. You resize the window, and the width of the lines changes on the fly. However, there is no EOL character inserted in the text source (if I save and open it with a "dumb" editor, it will be a single, long line). What valschmidt is referring to when it describes the MATLAB editor behavior, however, is on-the-fly text formatting to limit the length of the lines to a predetermined maximum (for which it would makes complete sense to consider the margin line). As you type the code, and reach the margin line, inserts the necessary characters (that depend on the context: comment, code, in parenthesis, etc...) to break the line and continue on the next one. I think it would be a nice feature to add, and it would be part of the source code automation that Spyder already does (inserting of colons, matching brackets, etc...). I'm a newby when it comes to Python, but if I understand recommendations correctly, this could be implemented this way. When, while typing, you reach the margin line, Spyder finds the last space characher before the margin line and:
|
@giacomociani, making this work on the fly is not easy (although it sounds easy). The best we can do is to autoformat the text after it's saved to respect the maximum width set by the user. That will come in Spyder 4 beta3. |
I thought the right margin was supposed to look something like this (ignore the syntax highlighting):
But it doesn't seem to be working:
I have checked "wrap lines" in Preferences > Editor > "Wrap Lines".
Versions and main components
Dependencies
The text was updated successfully, but these errors were encountered: