draft-js-code
draft-js-code copied to clipboard
Shift-Tab for removing indentation
Hi, added shift-tab binding for removing indentation
Coverage decreased (-1.4%) to 97.826% when pulling 80e3af7466fc894d3ced32a9a9548742b36d8e63 on newsiberian:remove-intentation-shift-tab into c219dc50d42f7db9c69b4b8c9be4b437116e8e6a on SamyPesse:master.
Yesss! I'll review all of your PRs later today, thank you for contributing!
Hi, here we should some extra work. I've checked again WebStorm behaviour on shift+Tab
and backspace
and their are differ.
If you press backspace
with cursor:
- before first word with any number of indentation and no code on previous line, its return to the line beginning
- before first word with +1(+0) number of indentation to indentation of previous line, its move to the end of previous line (it depends on context of code. It looks at object { }, or at
something
.method()
or could be
var a;
var b;
- before first word with >1 number of indentation to indentation of previous line, it return to place of indentation of previous line + 1 indentation
- in any place within line - it acts like a normal
backspace
If you press shift+Tab
with cursor:
- its never returns to previous line
- before first word with with any number of indentation, it remove one indentation
- in any place within line - it's again remove one indentation if presents
- with selection it move all line from any position of cursor to one indentation
I want to try to repeat this. What do you think?
You could try, but I don't know if it's worth going through all of that complexity/if it's possible. If it's not a lot of code though and/or you think you can make it happen, please go for it!