Python Forum
strange change of the indention to 3 spaces
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
strange change of the indention to 3 spaces
#1
I noticed strange behaviour when post code. Sometimes it change the indention to 3 spaces, instead of 4. FYI, I use Firefox, in case it is browser specific. Happens on Windows 7, Windows 10 and Linux Mint, so not OS specific.
I think that happens if you open the post for edit/moderate, but cannot be 100% sure. Some times it change just some lines, some times - all of the indentation. When it is for one line and you reopen it to fix this, when you save the post again it changes the indentation of yet another row. You need to redo the indentation of all lines manually in order to avoid this.
Anyone else noticed such issue?
Reply
#2
No I haven't noticed, yet. Would be good if you can describe details how to reproduce.
Reply
#3
(May-19-2017, 08:32 AM)Kebap Wrote: Would be good if you can describe details how to reproduce.
Yeah, sure I know that, however I haven't found a way to reproduce it at will :-(
Reply
#4
test post to try and replicate the problem

def foo():
"""This is just some dummy code"""

   a=0
   for n in range(10):
       a+=n
   return a
In this case it happened by posting code, then click moderate and update post
Reply
#5
def foo():
"""This is just some dummy code"""

   a=0
   for n in range(10):
       a+=n
   return a
Reply
#6
def foo():
"""This is just some dummy code"""

   a=0
   for n in range(10):
       a+=n
   return a
Reply
#7
OK, in the three posts above it happened when after post I go to full edit or Moderate and update it (no actual change was made).
In all three cases it happened to all rows with indentation.
The code is with 4 space (not tab) originally
Reply
#8
Note that only one space is deleted. the loop is still indented 4 spaces
Reply
#9
def foo():
"""This is just some dummy code"""

   a=0
   for n in range(10):
       a= a + n
   return a
Reply
#10
(May-19-2017, 10:52 AM)buran Wrote: OK, in the three posts above it happened when after post I go to full edit or Moderate and update it (no actual change was made).
In all three cases it happened to all rows with indentation.
The code is with 4 space (not tab) originally

Confirmed.

However, it seems to only happen with the [ python ] codebox and not with the [ code ] codebox which I tend to use (not clicking the button rather typing the tag myself)

Furthermore, it has to do with the python codebox not rendering in full edit/moderate mode. However the code codebox (yes) does show rendered there. At that time, the python codebox code has only 3 spaces left where it before had 4, while the code codebox code (indeed) stays intact.

def foo():
"""This is just some dummy code"""
 
   a=0
   for n in range(10):
       a+=n
   return a
def foo():
"""This is just some dummy code"""
  
    a=0
    for n in range(10):
        a+=n
    return a
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020