| Summary: | [typing] regression - Smart Paste doesn't indent enough after line starting with spaces | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | daniel_megert, hudsonr |
| Version: | 3.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | stalebug | ||
I200408170800 Tom, looks like a computation problem when computing the number of tabs out of the spaces. hm, the second parameter was deep-indented in the original code, but when pasting, it was re-aligned with the current formatting settings (which I assume said to only double indent parameters on additional lines, but not deep-align them). Since the correction on the second line pasted is taken as the difference in white space that is applied to all following lines, everything after that is wrong. If you configure the formatter to deep-align (it's called indent-on-column, I believe) method declarations, the results will be ok. *** This bug has been marked as a duplicate of 65317 *** *** Bug 96004 has been marked as a duplicate of this bug. *** Reopening as this is not about the continuation support, but rather about how we paste code that has different formatting rules than the target document. Always taking the second line to compute the shift amount leads to wrong results if the format differs. Possible solutions: - own transfer type, passing also the formatting context of the source document (see bug 96004) - use the *first* line as the reference if it includes leading white space Moving back to inbox. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
200408170800, default settings. public class Dingsbums { public int m(int first, int second) { // indented with spaces int i= first; } } - copy all 4 lines of method m() and then paste again - expected: indentation preserved (at least for lines 3-4) - was: several spaces deleted from 2nd line; lines 3-4 shifted to left by 1 tab: public int m(int first, int second) { // indented with spaces int i= first; }