Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift-Tab for removing indentation #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

newsiberian
Copy link

Hi,
added shift-tab binding for removing indentation

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 97.826% when pulling 80e3af7 on newsiberian:remove-intentation-shift-tab into c219dc5 on SamyPesse:master.

@mxstbr
Copy link
Collaborator

mxstbr commented Dec 7, 2017

Yesss! I'll review all of your PRs later today, thank you for contributing!

Copy link
Collaborator

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah that was easier than I thought—can you add some tests that this works as expected please?

@newsiberian
Copy link
Author

newsiberian commented Dec 8, 2017

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?

@mxstbr
Copy link
Collaborator

mxstbr commented Dec 8, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants