[ANN] HungryBackSpace 0.8 released
Bug fix: Deletes matching quote, brace, bracket, etc. if you have "Insert pair bracket", "Insert pair brace", "Insert pair quote" turned on. This is accomplished by delegating to original backspace handler when the only action is to delete the previous non-whitespace char.
Bug fix: When there is text to the right of the caret and caret is to the right of the indent column, will now reindent the text to the indent column and move the caret to the indent column. If caret is equals or to the left of the indent column, then it will behave as before, i.e. the caret and text is moved up to end of the previous line.
will now produce the following when BackSpace? is pressed:
Please sign in to leave a comment.
http://www.intellij.org/twiki/bin/view/Main/HungryBackSpace
I added a minor revision 0.8.1 to fix a corner case
When there was only 1 charater to the right of the caret, it wasn't behaving properly.
A couple of bugs and an rfe for ya! (Cheers for the plugin btw! ;) )
(I'm using 0.8.1)
BUG #1 : I don't think the stop at indent is working correctly.
If the caret is in this position (incorrect indent):
public void foo()
{
|
}
pressing backspace gets me here:
public void foo()
{
}
-
BUG #2 : Weird bug when switching away from then back to IDEA
If the caret is in this position (incorrect indent):
public void foo()
{
}
then I switch to another app, and back to IDEA
pressing backspace gets me here!:
public void foo()
{|
}
-
RFE : Handle this situation
If the caret is in this position (at correct indent)
public void foo()
{
|
}
pressing backspace once gets me here:
public void foo()
{
}
I'd like it to get me here:
public void foo()
{
}
-
Alex wrote:
>
>
>
Hi,
Re: BUG#1, I noticed that too. It happens when the caret is at the beginning of any opening block. The problem is that I am using the EditorLineStart handler to move the caret to the indent column, and this is the behavior of EditorStartLine at the opening block. Try pressing HOME key at the beginning of a block. Pressing HOME 1st time moves to start of line, pressing 2nd time moves to indent column. But it moves to the indent column of the previoius line, which isn't correct in this case. There is no API that gives you the indent column of a line. I may have to come up with a different kludge.
Re: BUG#2 I dont' have any clue. It might have to do with the behavior of EditorStartLine also.
Re: RFE, I agree. Your example also displays BUG#1. If you factor that out, what you are asking for is the first BackSpace gobbles up all the blank lines and positions caret at indent level on the one remaining blank line. This is how I meant for it to work, but somehow it got reversed, so it first repositions caret at indent column on the last line, and then pressing again gobbles up all the blank lines.
-Alex
I fixed BUG#1 and RFE, Your BUG#2 is not reproducible by me. I found another kludge to determine line indent reliably; actually it works quite well so far...
I will post a HungryBackSpace-0.9 soon.
-Alex
Thanks a lot for your replies (and fixes)!
Cheers,
N.
Alex wrote:
>