masroore / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Pasting in a newline indents using spaces instead of tabs #502

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have 'Tabs to spaces' option unchecked
2. Put the caret at the end of a indented line
3. Press enter
4. Paste

What is the expected output? What do you see instead?

I expect the indentation to consist of tabs
Instead I get a syntax error on that line and if attempt to run it get

IndentationError: unindent does not match any outer indentation level

When the "Show special chars" option is checked it can be seen that the new 
line has been indented with spaces, while the lines that had been typed are 
indented with tabs

What version of the product are you using? On what operating system?

PyScripter 2.4.1.0
Windows 7 (x64)

Please provide any additional information below.

Problem existed in version 2.3.3

Original issue reported on code.google.com by Keogh16...@gmail.com on 10 Apr 2011 at 9:45

GoogleCodeExporter commented 9 years ago
It also occurs if instead of pasting you press delete 
i.e you have a situation like this

[tab]Line1
[tab][caret]
[tab]Line3

you then press delete and it becomes

[tab]Line1
[spaces][caret][tab]Line3

when it should become

[tab]Line1
[tab][caret][tab]Line3

Original comment by Keogh16...@gmail.com on 10 Apr 2011 at 10:06

GoogleCodeExporter commented 9 years ago
This occurs due to an interaction with "Trim trailing spaces". At some point I 
will revamp the way "Trim trailing spaces" works but in the meantime when you 
want tabs in your file you need to switch off "Trim trailing spaces" as well.

By the way using tabs in python files is not recommended practice.  
http://www.python.org/dev/peps/pep-0008/

Original comment by pyscripter on 1 Jun 2011 at 3:39