jEdit Community - Resources for users of the jEdit Text Editor
Wrong indentation of perl code
Submitted by jope on Tuesday, 20 January, 2004 - 12:55
jedit does not indent perl code correctly in some instances. For example, when splitting an argument list between parentheses over several lines, jedit will indent the next statemetn under the argument list instead of under the beginning of the previous statement. Example:
somefunctioncall($arg1,
                 $arg2);

                 beginning of next statement;
Is there a way to change this behavior? Is it possible to customize the indentation rules?
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
I think that's the default be
by thebiMbo on Wed, 21/01/2004 - 08:38
I think that's the default behaviour, i also wish it to change but that's would mean to have a parser which take care of more then one line at a time which i don't know if jEdit is able to do.
 
That is a pity
by jope on Wed, 21/01/2004 - 10:02
This problem will probably occur with other languages too where you need to let a statement span several lines. Even if there is no argument list, you usually want to indent the continuation lines with respect to the first line, but then have the next statement indented under the beginning of the first line of the previous statement. So the parser *has* to take care of more than one line (well actually it only needs to keep a couple of numbers and flags up-to date, but I do not know how this is implemented).

The problem is that there is no acceptable workaround really: I currently manually insert a comment under the long statement and hope to never touch that. But this is a shortcoming that probably demotivates me enough to go back to xemacs Sad
 
I think it can be fixed
by Brad Mace on Mon, 26/01/2004 - 16:31
One option is turning off deep indent until it gets fixed. I wrote the first deep indent patch, so I'm looking at fixing the problem now.
 
Hmmm
by jope on Thu, 29/01/2004 - 12:53
with deep indent off, no indentation whatsoever is performed which is wrong either ... continued statements should at least get one level of indent. And *if* I fix that so that there is one level of indent, then the next statement is again wrongly indented below this.
It seems that indenting is simply done in a much too naive way. Indentation should at least know what a statement is and where the last statement begun - even if it was several lines earlier.

Anyways, looking forward to any improvement and thanks for the reply!
 
Patch has been submitted
by Brad Mace on Thu, 29/01/2004 - 17:12
I sent slava a patch a couple days ago (you saw it if you happen to be on the jedit-devel list) which fixes the problems you mentioned with deep indent as well as a fix to regular indenting where something like
public void something(int a,
                      int b) {
    System.out.println("hello");
                      }
would happen.
User login
Browse archives
« November 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300