With the current jedit trunk (and also the previous jedit 5.2.0 release) I
get the following behavior when using auto-indent == full and
tab width != indent width.
Here is an example with tab width == 8 and indent width == 4.
t_ marks tab, _ marks a whitespace.
~~~~
int myfunc(int a)
{
____if (a==5) {
____t_ printf("Hello World\n");
____}
}
~~~~
But I would like to get (and I think this is also more correct):
~~~~
int myfunc(int a)
{
____if (a==5) {
t_ printf("Hello World\n");
____}
}
~~~~
So basically I want that the "printf" line simply uses one TAB and not a
combination of 4 SPACEs + one TAB.
The reason why I think this is more correct is, that when indenting the
whole function with "shift-TAB", then the indentation will be as in the
second example.
Submitted | lundril - 2016-04-04 18:08:48.634000 | Assigned | ezust |
---|---|---|---|
Priority | 5 | Labels | auto-indent |
Status | open | Group | |
Resolution | None |
2016-04-06 20:45:50.872000 marchaefner |
I'm a bit skeptical about this proposal. I think it's a feature that jEdit tries to
keep the indentation consistent, which is relevant when editing other peoples files.
|
---|---|
2016-04-07 16:08:14.514000 snarum-micron |
|
2016-04-07 16:10:06.144000 snarum-micron |
(Sorry, formatting got bungled.)
|
2016-04-07 18:10:21.014000 lundril |
A more comprehensive description how to reproduce it.
|
2016-04-07 18:21:03.592000 lundril |
Now with the previous explanation how to reproduce:
|
2016-04-07 18:23:49.227000 lundril |
@Steve:
|
2016-04-07 18:37:18.451000 lundril |
Note to myself and for discussion:
|
2016-04-07 18:43:53.515000 snarum-micron |
alternate (9.3Kio) |
2016-04-07 19:31:34.508000 daleanson |
"Mixing them within a file is BAD, and the person(s) who did it should be alternate (6.1Kio) |
2016-04-07 21:02:29.985000 marchaefner |
I think I understand your particular problem, but as a counterexample in python where
your suggested behavior would not be correct:
|
2016-04-11 12:56:19.603000 lundril |
I just tried out some python code.
|
2016-04-11 13:01:55.795000 lundril |
> Mixing them within a file is BAD, and the person(s) who did it
|
2016-04-13 10:51:49.496000 lundril |
Ok here is another try.
auto_indent_change_3.patch (4.0Kio) |
2017-03-26 14:27:36.675000 ezust |
- **assigned_to**: Alan Ezust |
2017-03-27 23:27:18.500000 ezust |
Actually, I've tried using tabs on one line and space on the other in Python. As long
as all lines in the same block are consistent with each other, it should not matter
if you use spaces for one level and a combo of spaces and tabs for the other, and
just tabs on another.
|