| Summary: | [preference][typing] Allow to disable smart auto-indent on return | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> | ||||||||||
| Component: | Text | Assignee: | Rajesh <rthakkar> | ||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||
| Severity: | enhancement | ||||||||||||
| Priority: | P3 | CC: | aclark.xyz, deepakazad, markus.kell.r | ||||||||||
| Version: | 3.4 | ||||||||||||
| Target Milestone: | 3.7 M2 | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Dani Megert
Forwarding from an email to Dani Megert:
From what I gathered from the BugZilla, you had pretty much agreed to
implement some kind of equivalent to having the "Smart Insert Mode"
being off by default... and then changed your mind. I have been
looking around in Helios 3.6, and there doesn't seem to be anything
different.
Is there any reason for this? I mean, considering that eclipse has
about 10,000 configurable options, and the feature that I (and
many others) want is already a menu option, a single extra bit of
information to make it default to the desired state seems pretty
reasonable.
If there's nothing that could be done about it, is there any chance
that you could recommend a way to make a personalised copy of Eclipse
where the feature is compiled out? I haven't looked in the Eclipse
source code, but one might imagine that there could be a line
something like 'addMenuItem("Smart Insert Mode",true)'. Would that
approach be realistic, or is it much more complex?
Thanks,
Alex.
>From what I gathered from the BugZilla, you had pretty much agreed to >implement some kind of equivalent to having the "Smart Insert Mode" >being off by default... No, I did not. The agreement was to not do this (that's why the bug is closed as WONTFIX) but instead a new preference that allows to disable auto-indent on return (this bug here). You agreed to that in bug 250594 comment 6. We could provide this for 3.7 if that helps. >If there's nothing that could be done about it, is there any chance >that you could recommend a way to make a personalised copy of Eclipse >where the feature is compiled out? You don't need to make a copy. You could write a small plug-in that adds a part listener and each time an editor is opened you check whether it's an ITextEditorExtension3. If so, you call ITextEditorExtension3.setInsertMode(ITextEditorExtension3INSERT) on it. Created attachment 177587 [details]
Fix
Adds a preference to the Typing page to enable/disable smart indent on New Line. If disabled, it still indents to previous line. I think it might also make sense to add a note to the Indentation page under Formatter to indicate that many of those preferences depend on this Typing page preference.
Comment on attachment 177587 [details]
Fix
This patch is not good: it doesn't compile on my machine.
Created attachment 178016 [details]
Fix
Sorry about the compile issue - working on multiple patches in some common set of files got me all confused :)
Created attachment 178018 [details]
Fix
Did some optimization.
The patch breaks auto-indent out of the box. Also, I don't like to introduce a new group for just one option. I suggest we put it into one of the existing groups by renaming the group. Suggestions? (In reply to comment #7) > The patch breaks auto-indent out of the box. I guess you mean that the default setting for this preference should be true? > > Also, I don't like to introduce a new group for just one option. I suggest we > put it into one of the existing groups by renaming the group. Suggestions? We could rename 'Tabulators' to 'Smart Indent' and have 2 preferences - 'On new line' and 'Tab key adjusts indentation of current line'. >I guess you mean that the default setting for this preference should be true? I simply mean that auto-indent no longer works for me ;-). Any reason you chose the default that way? >We could rename 'Tabulators' to 'Smart Indent' and have 2 preferences - 'On new >line' and 'Tab key adjusts indentation of current line'. Sounds good, except that I would rename it to 'Indentation': [Indentation] [ ] Enter key adjust the indentation of the next line [ ] existing pref Created attachment 178124 [details] Fix (In reply to comment #9) > >I guess you mean that the default setting for this preference should be true? > I simply mean that auto-indent no longer works for me ;-). Any reason you chose > the default that way? I had basically missed choosing the default at all. Patch is good. Adjusted wording of preference a bit. Committed to HEAD. Available in builds >= N20100903-2000. Filed bug 325242 to update the documentation for the 'Typing preference page'. |