Community
Participate
Working Groups
In Emacs' java-mode, hitting TAB indents the line I'm currently on to the correct position (according to the current indentation settings). I would like *very much* to see this behaviour in the Eclipse java editor. Note that the line is indented to the correct position independently of the cursor's current position on the line. So even if I am at the end of a line with some code on it, hitting TAB will indent the current line, and the cursor will still be at the end of the line. If the line is already correctly indented, pressing TAB has no effect. If the cursor is located before the first non-whitespace character on the line, pressing TAB will both indent the line and place the cursor after the (newly created) whitespace at the beginning of the line (so that I can press TAB at the beginning of a line and then start typing). This is a duplicate of bug 5179. However, as CDT and JDT use different source code editors (!), I don't see any way of extending that bug to cover CDT also. Also, for me personally, this is a blocker. Emacs' indentation engine is IMO its greatest asset, and if changing development environment (from Emacs to Eclipse) will mean I can't have it I will be *very* reluctant to switch.
In the latest CDT driver (cdt-eclipse-20020116), you can customize the Tab key to indent the line, in a fashion very similar to what's requested here. The fix will consist of defining the Tab key in the 'emacs' LPEX base profile to indent the line's text. So here's the workaround: "Windows" -> "Preferences" -> "LPEX Editor" -> expand the [+] -> "User Key Actions" -> enter a new key definition: Key tab Action indentTab press "Set", then press "OK", and the Tab key will now indent the line's text.
I'll have a go at that as soon as the 2.0 build hits the streets.
The latest LPEX drivers (both Eclipse R1.0 and R2.0) - to be made available with the next CDT refresh(es)) - define the Tab key in the 'emacs' base profile as indentText (Alt+I stays as tab character). Its functionality is pretty close to the one requested here - if more is needed in order to match a real emacs editor, please indicate. Also, please note that in LPEX you can define your own actions (see API documentation, e.g., com.ibm.lpex.samples.TestAction) and bind them to your favorite key (via the Preferences pages, as indicated in a previous comment in here). If all is well, please resolve this bug as FIXED.
Apart from that I am unable to change the default indentation settings to something sane I think this does the trick. Since that is a separate problem I'm marking this bug FIXED.
Since the CDT has now been revamped, and LPEX thrown out the window, this is again an issue. Re-opening. CC:ing default CDT UI owner.
I think it is relevant to JDT as well.
The corresponding feature request for JDT is bug 5179.
ZClipse.org has TabNavigator which has an action called JavaLineIndent which does this. Due to bug #33495 and bug #34996, it doesn't work on linux, but OS/X and win32 are beautifully supported. http://sourceforge.net/projects/zclipse (get TavNavigator)
Bug 34996 is probably also a blocker.
*** Bug 32730 has been marked as a duplicate of this bug. ***
Just FYI, according to bug 37472, this has been fixed for the "JDT Text" component of Eclipse for 3.0.
The CEditor does not seem to respect the key-binding when the Style is set to Emacs in the workbench .... strange ... *** This bug has been marked as a duplicate of 10017 ***
Considering the CDT now uses the same editor the JDT uses, and the TAB issue may have been resolved (bug 37472 is closed but bug 5179 is still open) I think this is nowadays a more general Emacs-keybindings-should-work-in-CDT issue.