[ANN] Hungry Backspace ccmode-0.2

I have continued to improve the Hungry Backspace plugin.

WHAT IT DOES:
Hungry deletion of whitespace, or as it more commonly called, hungry-delete mode, is a simple feature that some people find extremely useful.

In a nutshell, when ccmode-0.2.jar plugin is loaded, hitting the Backspace key will consume all preceding whitespace, including newlines and tabs. This can really cut down on the number of Backspace's you have to type if, for example you made a mistake on the preceding line.

FIXES
+ Checks that document is writeable.
+ If text is selection, pressing backspace will delete the selection (in keeping with regular backspace).
+ Now uses EditorWriteAction rather than AnAction.
From what I read, this is the proper way to implement editor actions. The initial implementation as an AnAction caused backspace key to stop working in other dialogs like Live Templates, File Templates, etc.

As a side effect of making it an EditorWriteAction, you can no longer assign a key to it. If you install the plugin, just leave the keymap alone. The Backspace key will now act very hungry, gobbling up whitespace in one click.

Please let me know if you find any problems or have suggestions. I will put it on plugins page when I have time but for now you can use the attached plugin ccmode-0.2.jar

-Alex

Previous Thread
http://www.intellij.net/forums/thread.jsp?forum=18&thread=29966&tstart=0&trange=15



Attachment(s):
ccmode-0.2a.jar
评论操作 固定链接

MINOR FIXES
+ Reposition caret before deleting whitespace. This seems to give a better effect. There were some cases where the page was getting repositioned even though both even though the old and new caret positions were completely visible. Now, the page stays put.
+ Instead of implementing the backspace when text is selected, I now just delegate to the original backspace handler. Should be more robust.



Attachment(s):
ccmode-0.3.jar
0

请先登录再写评论。