Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Henry Williams
iOS Development Techdegree Student 3,775 PointsToo large of an indent upon Return
When hitting the return key in a python workspace, I am getting an indent that is half way across the workspace.
I have tried changing the space and tab size to 1, but that seems to have no effect. I have also noticed that this isn't always occurring where hitting Return will just take me to the next line with no indent.
Is there a way to set my workspace so that Return simply takes me to the next line with no indent?
4 Answers
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsHey Henry,
That certainly is odd, and not something that it should be doing as far as I know, if you don't mind me asking have you tried this with a text editor on your computer, word pad or notepad on windows. or the default text editor if you use a mac?
It might also be your browser, what browser are you using and does it do the same in another browser? It's definitely doing something that it shouldn't.
If neither of these options help let me know.
Thanks.
Henry Williams
iOS Development Techdegree Student 3,775 PointsI started a new document with no code and started the following script:
user_input = input('What's your word? ')
When I completed that line of code and hit return, the cursor go beneath the single quote... and I think I may have discovered my problem.
I had been using single quotes instead of double quotes, and this seems to only happen for single quotes. I forgot that if you have a word that contain's a single quote ( like What's for example ) it won't end the string.
Thanks for helping me debug my own brain.
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsGlad to hear I could offer what help I could, let me know if there's anything else you might need help with.
Henry Williams
iOS Development Techdegree Student 3,775 PointsThis does not reproduce when editing docs in both Text Wrangler and TextEdit on Mac (which I am using).
I'm seeing the issue in both Safari and Chrome for Mac.
Henry Williams
iOS Development Techdegree Student 3,775 PointsI have discovered that if I hit option-Return it will go to the next line without an indent like I would expect. If it helps, I'm also using an Apple wired keyboard with number pad.
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsOkay, it doesn't sound like it's your computer, I played around with work spaces for a bit. Are there by any chance any open { curly braces that haven't been closed, I do know if these are open they will indent your text. Also do you have a copy of the code that it is doing this to, or is it just any code in general.
If you start a new work space with no lines of code in it will it do it still, ot does it just go the next line? It could be that there is open curly braces that haven't been closed yet, this will make it auto indent.