# \[BUG\] Copy/Paste of Python code doesn't maintain correct tabs

**URL:** <https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893>\
**Category:** Ignition\
**Tags:** ignition79, ignition80\
**Created:** [August 19, 2020, 2:43am UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893 "2020-08-19T02:43:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 19, 2020, 2:43am UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/1 "2020-08-19T02:43:09Z")

</div>

This has been bugging me for a while, but when you copy and paste Python code, the first line has the correct position, however the following lines of code are all indented.

Example below, I copied this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/c/9c595fca3ba8009729e9a0a12e61517b422641f5.png)  
And when pasted into another script at the same indentation as the cursor in the above shot, I get this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/f/4ffcf3ffdc3e2d12a43ab3acf9506dddf37655a1.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 19, 2020, 12:36pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/2 "2020-08-19T12:36:51Z")

</div>

We’re in the process of replacing all the code editors in the designer, which will likely solve this problem (and equally likely, replace it with a bunch of different ones 🙂 ).

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 19, 2020, 1:04pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/3 "2020-08-19T13:04:09Z")

</div>

the new code editor will be for 8.1 only or for 8.0 too ?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 19, 2020, 2:09pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/4 "2020-08-19T14:09:40Z")

</div>

Not sure yet. Likely 8.1.X.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [August 19, 2020, 2:14pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/5 "2020-08-19T14:14:47Z")

</div>

Yes there are huge expectations for the new editor 👨‍🔧

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/5827d61180ccfbc73725794d245493d628a6ea4b.png)

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [October 13, 2025, 5:30pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/6 "2025-10-13T17:30:59Z")

</div>

I am on 8.1.48. Did the improvements mentioned here happen? I really wish the scripting used Bython, the tab/space issue is frustrating. What is the best way to make sure scripts have tab indentation when it needs to? The editor in 8.1.48 does not show a difference and it would really help to indicate something that helps debug for this

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 13, 2025, 5:34pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/7 "2025-10-13T17:34:30Z")

</div>

Just checking, but are you aware that the editor can show tabs and spaces?

[![](https://us1.discourse-cdn.com/inductiveautomation/optimized/3X/6/e/6ef8125427064cea9f28121e433f46a4efe8d418_2_690x304.png) ](https://us1.discourse-cdn.com/inductiveautomation/optimized/3X/6/e/6ef8125427064cea9f28121e433f46a4efe8d418_2_690x304.png)

---

<div class="post-metadata">

**Author:** ![pdixon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pdixon/32/6899_2.png) [@pdixon](https://forum.inductiveautomation.com/u/pdixon)\
**Post date:** [October 13, 2025, 6:01pm UTC](https://forum.inductiveautomation.com/t/bug-copy-paste-of-python-code-doesnt-maintain-correct-tabs/37893/8 "2025-10-13T18:01:12Z")

</div>

That’s it! I didn’t know, but now that I do it is a great help
