Python Forum
indentation loss - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Board (https://python-forum.io/forum-26.html)
+--- Thread: indentation loss (/thread-7171.html)

Pages: 1 2 3 4 5 6


indentation loss - metulburr - Dec-24-2017

1) pasted in source mode (Which should be default when you open an editor)
def list_count_4(nums):
  count = 0  
  for num in nums:
    if num == 4:
      count = count + 1
 
  return count
2) is correctly formated
3) then toggled to WYSIWYG mode
def list_count_4(nums):
count = 0
for num in nums:
if num == 4:
count = count + 1

return count
5) now loses indentation, and you cant get it back by toggling

However if you first toggle to WYWIWYG mode (if thats what you want) then paste code, it doesnt affect it. Only when you toggle between them.
def list_count_4(nums):
  count = 0  
  for num in nums:
    if num == 4:
      count = count + 1
 
  return count
So yeah i guess if you toggle the modes when code is already on the post, it just removes the indentation altogether. Ill add that in the help docs


RE: indentation loss - micseydel - Dec-24-2017

Can we just turn off WYSIWYG? This doesn't seem anywhere near worth it.


RE: indentation loss - Larz60+ - Dec-24-2017

It drives me crazy!


RE: indentation loss - metulburr - Dec-24-2017

we did with the default MyBB Editor. But then we found out the problem of the default editor was removing one space before code if you previewed it. So then we switch to Rin Editor. Which has a shit load even more problems. mainly the bad on being empty brackets and the indentation loss when toggling to WYSIWYG mode.

MyBB wont allow to toggle the option to turn off WYSIWYG mode until 1.10 or maybe even 2.0

The Rin Editor is a massive javascript fuck nest. I would love to just remove WYSIWYG mode at this point. It is not even worth it, and just causing a problem.

EDIT:
If we could remove the toggle button from view, that should work for now. Since we start in source mode by default that would just disallow toggling to WYSIWYG mode, but then there are other buttons that are only for WYSWIYG mode, that could also be removed. But i believe this is harder than it is due to javascript

EDIT2:
I tried editing the rin editor source from this
    if($mybb->user['sourceeditor'] == 0)
    {
        $sourcemode = "source";
    }
    else {
        $sourcemode = "wysiwyg";
    }
to this
    if($mybb->user['sourceeditor'] == 0)
    {
        $sourcemode = "source";
    }
    else {
        $sourcemode = "source";
    }
but nothing took effect when toggling. It stills goes to wysiwyg mode.


RE: indentation loss - Larz60+ - Dec-24-2017

I often use the WYSIWYG mode and then post directly from there. The font is so tiny that my antique eyes (eye actually, only one works) has a hard time reading it,
but I still prefer it to getting python tags reformatted with lots of code tags inserted, and non terminated URL tags.


RE: indentation loss - metulburr - Dec-24-2017

WOW posting that javascript doc here fucked the thread up

anyways. its here
https://community.mybb.com/mods.php?action=download&pid=73
/jscripts/ckeditor/ckeditor.js

If you guys want to look around to see what to edit to get rid of WYSIWYG mode.


RE: indentation loss - snippsat_testing - Dec-25-2017

I have to post with this account,
as editor don't work at all on my account.
So can you revert back the changes.


RE: indentation loss - metulburr - Dec-25-2017

i didnt make any permanent changes. The only change i made was reverted right after i found out it didnt work. /inc/plugins/rinedit.php line 717

I did however post javascript here, which for awhile was lagging this thread bad. But that was like 12+ hours ago that i removed it from the post.


RE: indentation loss - snippsat_testing - Dec-25-2017

I tried my account again,but editor stay inactive(grayed out),
no matter what i do.
No difference on phone,so it's related to my account Confused


RE: indentation loss - snippsat_testing - Dec-25-2017

Quote:i didnt make any permanent changes. The only change i made was reverted right after i found out it didnt work. /inc/plugins/rinedit.php line 717
Are you sure you got all revert back?
My account has not worked after this as editor is inactive(grayed out),
witch kind of annoying and i have no idea how to fix it.