Home Download Buy Blog Forum Support

Unindent no longer works?

Unindent no longer works?

Postby samkerr on Tue Aug 04, 2009 11:33 pm

I was editing a file and when I pressed shift+tab, nothing happened.

I looked in my keymap file and found:

Code: Select all
<binding key="shift+tab" command="noop"/>
<binding key="shift+tab" command="unindent">
        <context name="newlineInSelection" value="true"/>
</binding>
<binding key="shift+tab" command="prevField">
        <context name="hasPrevField" value="true"/>
</binding>


I tried commenting out the noop block, but that just made shift+tab act like regular tab.

Can anyone point me in the right direction?
samkerr
 
Posts: 50
Joined: Mon Aug 03, 2009 11:20 pm

Re: Unindent no longer works?

Postby tgkeul on Wed Aug 05, 2009 6:53 pm

I made a macro which selects the line I like to unindent and bind the call to shift+tab like this:

Code: Select all
<binding key="shift+tab" command="runMacroFileSilently 'Packages/User/unindentLine.sublime-macro'"/>


The macro is recorded and works for me.
Code: Select all
move lines 1
move lines -1
expandSelectionTo line
unindent
moveTo bol
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: Unindent no longer works?

Postby samkerr on Wed Aug 05, 2009 7:23 pm

It turned out it was working, just not the way I was expecting.

Turns out you can't unindent just one line, due to the <context /> tag, you have to select multiple lines.

I simply changed my bindings to:
Code: Select all
<binding key="shift+tab" command="unindent" />
<binding key="shift+tab" command="prevField">
        <context name="hasPrevField" value="true"/>
</binding>


to get the behavior I wanted.

I love the customizability (is that a word?) of this program :)
samkerr
 
Posts: 50
Joined: Mon Aug 03, 2009 11:20 pm

Re: Unindent no longer works?

Postby tgkeul on Wed Aug 05, 2009 8:46 pm

What a simple solution :D
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: Unindent no longer works?

Postby oats on Fri Dec 11, 2009 8:15 pm

samkerr wrote:Turns out you can't unindent just one line, due to the <context /> tag, you have to select multiple lines.
I simply changed my bindings to:
Code: Select all
<binding key="shift+tab" command="unindent" />
<binding key="shift+tab" command="prevField">
        <context name="hasPrevField" value="true"/>
</binding>

to get the behavior I wanted.

Thank you for this tip! Solved a confusing inconvenience for me. My preference is that this should be the default...
oats
 
Posts: 101
Joined: Mon Nov 09, 2009 4:39 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 27 guests