samclarke / SCEditor

A lightweight HTML and BBCode WYSIWYG editor
http://www.sceditor.com/
Other
660 stars 188 forks source link

Feature request: TAB creates tab jump (and stays in SCeditor) #654

Open q2apro opened 6 years ago

q2apro commented 6 years ago

Since we use SCeditor more and more for coding I would like to have an option to have TAB keys creating 4 spaces. Instead of loosing the focus.

Similar to this (see demo field and hit TAB key): http://jakiestfu.github.io/Behave.js/

Can we implement this?

PS: SCeditor/XHTML

brunoais commented 6 years ago

Tabs are captured when inside code BBCode tags and same inside HTML code (last I checked). Sounds like a regression to me, unless I'm remembering it wrong. I do remember it working but it may be because I worked with this and phpBB's code at the same time.

Edit: http://www.try-phpbb.com/32x/posting.php?mode=post&f=2 OK, it was phpBB's code. My bad.

brunoais commented 6 years ago

@samclarke If you want to do this, check this code: https://github.com/phpbb/phpbb/blob/release-3.2.2/phpBB/assets/javascript/core.js#L1145