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

add space deletion to previous tabstop behavior #661

Closed
wants to merge 1 commit into from
Closed

add space deletion to previous tabstop behavior #661

wants to merge 1 commit into from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Jul 25, 2012

this allows to bind backspace to delete space until previous tabstop.
is deleting cm.tabSize space is not possible, it falls back to deleting
1 character, or delete selection if smth is selected.


hi,

I was not able to achieve the behavior I wanted only by configuring codemirror with availlable options, so I patched it and propose the change upstream.
Basically I want to indent with (4) space, and delete to the previous n*tabSize when possible, otherwise fall back to del 1 character.

Thanks.
--
Matthias

this allows to bind backspace to delete space until previous tabstop.
is deleting cm.tabSize space is not possible, it falls back to deleting
1 character, or delete selection if smth is selected.
@marijnh
Copy link
Member

marijnh commented Jul 30, 2012

Hi Matthias,

This does not have to be integrated in CodeMirror itself. If you just, in your code, do

CodeMirror.commands.delSpaceToPrevTabStop = function(cm) { /* your code here */ };

you can add a command. Or, even simpler, just associate the key with that function directly, without going through a command.

As I don't want to bloat up core CodeMirror with lots of useful but niche commands, I am not merging this.

Best,
Marijn

@marijnh marijnh closed this Jul 30, 2012
@Carreau
Copy link
Contributor Author

Carreau commented Jul 30, 2012

ok, no problem, I was just a proposal, I'm fine with defying this externally.
Great workBTW :-)

chebee7i pushed a commit to chebee7i/ipython that referenced this pull request Nov 16, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
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

2 participants