Python Forum

Full Version: strange change of the indention to 3 spaces
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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
def foo():
"""This is just some dummy code"""
  
    a=0
    for n in range(10):
        a+=n
    return a
i cant seem to replicate this at all. It remains 4 space indent after editing on numerous occasions.

Quote: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)

both python and code tags are linked to the same syntax highlighter code, so im not sure why one would do it and the other would not. Though i cant really test it as i cant replicate it.
Testing:

def foo():
"""This is just some dummy code"""
  
   a=0
   for n in range(10):
       a+=n
   return a
It did change to 3 spaces for me.
(May-19-2017, 04:18 PM)metulburr Wrote: [ -> ]i cant seem to replicate this at all.
(May-19-2017, 06:06 PM)Larz60+ Wrote: [ -> ]It did change to 3 spaces for me.
Browser? OS?
Testing something else

def foo():
"""This is just some dummy code"""
  
   a=0
   for n in range(10):
       a+=n
   return a
So, it doesn't happen with Edit, Only with Full Edit and Moderate. Also immediately after you click Full Edit and Moderate, the indentation is off - i.e. it's not after the Update. The preview of the post for edit is already broken
def foo():
"""spam"""
    a=0
    for n in range(10):
        a+=n
    return a
*edit* Ok, so you have to actually save for the change to happen. If you just go into Full Edit, the indentation is off, but if you cancel the edit without saving, it's still 4 spaces.
Seems like the Full Editor might be whack.
Quote:Browser? OS?
Mozilla firefox 53.0.2 windows 7 pro
used quick reply with typed code tags
as soon as I tried to edit, text was converted
sorry for brain fart
(May-19-2017, 07:32 PM)nilamo Wrote: [ -> ]you have to actually save for the change to happen. If you just go into Full Edit, the indentation is off, but if you cancel the edit without saving, it's still 4 spaces.
yes, I should have mentioned that from the beginning
Looking a little into it.
I guess no one can get 3-space indent if do as image under.
Also first click on Preview Post button,then paste in code into editor(now Post a New Reply window).
In editor clicking on Preview Post will change nothing.
[Image: Bo4iGN.jpg]
When in Quick Reply window an now paste code in that window.
Then hit Preview Post button it will be 3-space indent.
The problem is from Quick Reply when clicking on Preview Post
It will always lose 1-indent
Eg.
1-indent(be 0-indent after click Preview Post)
4-indent(will be 3-indent after click Preview Post)
Pages: 1 2 3 4