Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 176314 - Add support for 'transpose' action to NetBeans editor
Add support for 'transpose' action to NetBeans editor
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar
PC Windows XP
: P3 (vote)
: 7.1
Assigned To: Miloslav Metelka
Depends on:
  Show dependency treegraph
Reported: 2009-11-09 17:57 UTC by tomwheeler
Modified: 2011-09-06 15:45 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description tomwheeler 2009-11-09 17:57:12 UTC
One common typing mistake is to transpose two letters.  The bash UNIX shell command line editor (based on emacs I think) handles this by allowing you to place your cursor between the two letters and hitting Ctrl + T.  This will flip the two letters on either side of the and correct the mistake.

I am filing this issue to request that NetBeans provide exactly the same feature by default.  

A simple implementation could just bind Ctrl+T to the following macro:

   selection-backward cut-to-clipboard caret-forward paste-from-clipboard

but it would be better if the implementation didn't replace whatever might have been in the clipboard.
Comment 1 Vitezslav Stejskal 2009-11-10 03:22:31 UTC
What about using the spellchecker module? Transposing letters is nice, but you have to know that the spelling is wrong in the first place.
Comment 2 tomwheeler 2011-08-03 16:08:12 UTC
No, I don't think the spellchecker module could do what I request. It's mainly for mistakes in human language, whereas mine can fix mistakes in human or programming language.

To be clear, let me give an example.  If you type this:

    ArrayList x = new ArryaList();

You could put the cursor between the 'y' and the 'a' in the class name and press Ctrl+T.  That would flip the position of those two letters and correct the class name.  

Since transposition is a common mistake (for me, anyway) it would be handy to have this feature in NetBeans, just like it already exists in emacs and bash.
Comment 3 Miloslav Metelka 2011-08-04 09:30:51 UTC
Ok, I understand, so I'll make a new action:
Name: "transpose-letters"
Localized name: "Transpose Letters"
Shortcut: Ctrl+T
I'll attempt to finish it within 7.1 timeframe, it should be easy.
Comment 4 Miloslav Metelka 2011-09-03 21:43:53 UTC
Oops. Although it's already past feature freeze, I've added it into 7.1.
Comment 5 Quality Engineering 2011-09-04 14:13:02 UTC
Integrated into 'main-golden', will be available in build *201109040600* on (upload may still be in progress)
User: Miloslav Metelka <>
Log: #176314 - Add support for 'transpose' action to NetBeans editor.
Comment 6 tomwheeler 2011-09-06 15:45:23 UTC
Perfect -- I just verified that this feature works exactly as I'd intended using a nightly build:

  Product Version: NetBeans IDE Dev (Build 201109040600)
  Java: 1.6.0_25; Java HotSpot(TM) Client VM 20.0-b11
  System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

Thank you for implementing it!

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo