jEdit Community - Resources for users of the jEdit Text Editor
Auto-indentation in a new edit mode
Submitted by Anonymous on Thursday, 9 December, 2004 - 09:53
Hi, I've been writing an edit mode for the ABB RAPID industrial robot programming language. Just one thing outstanding - Auto Indentation

In UltraEdit, the following lines work. I need to do the equivalent in jEdit.
/Indent Strings = "ELSE" "ELSEIF" "THEN" "DO"
/Unindent Strings = "ENDIF" "ELSE" "ENDFOR" "ENDPROC" "ENDMODULE" "ENDWHILE" "ENDFOR" "ENDTEST"

Here are a few examples of how the RAPID code looks. Note there are no brackets used in structuring these statements in this language. Can jEdit handle this or not?

IF nCurrentTable=1 THEN
  pBegin1.trans.z:=nMaxDistT1;
  pEnd1.trans.z:=nMinDistT1;
ELSEIF nCurrentTable=2 THEN
  pBegin1.trans.z:=nMaxDistT2;
  pEnd1.trans.z:=nMinDistT2;
ENDIF

WHILE NOT ConditionsOK DO
  IF (diCtrl_Vacuum1=0 AND boEnable_Ch1=TRUE) RETURN TRUE;
  ConditionsOK:=TRUE;
ENDWHILE

FOR i FROM 1 TO 10 DO
  routine1;
ENDFOR

But the following "compact" (one-line) IF statement should not have the next line indented:
IF di3_LayerOrd=1 Layer;


Thanks for any help!

Andrew
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Try use <PROPERTY NAME="in
by Anonymous on Thu, 09/12/2004 - 15:24
Try use <PROPERTY NAME="indentNextLine" VALUE="" /> in <PROPS></PROPS> section.

--
Regards, Skalex
 
Thanks. I tried using "inden
by Anonymous on Fri, 10/12/2004 - 02:14
Thanks.
I tried using "indentNextLines" so that more than just the next line is indented, and that handles indentation ok.

But is there an auto "unindent" like UltraEdit has? e.g. if I type ENDIF it will automatically unindent the current line.

Andrew
 
I am also very interested in
by Anonymous on Mon, 13/12/2004 - 19:39
I am also very interested in seeing the aforementioned auto-*un*indent feature available. I do a lot of work in Ruby, which also uses similar syntax

while
....
end

if
...
elsif
...
else
...
end

unless ...
...
end

etc.
 
Eh! This feature is absent, I
by Anonymous on Fri, 10/12/2004 - 09:12
Eh! This feature is absent, I think. As far as I know, this possible only by using symbols like "{}" or "[]" etc.

--
Regards, Skalex
 
One could request this?
by bigted on Wed, 19/07/2006 - 20:15
I'm new here, but is this the type of thing that can be added to the wishlist?

http://community.jedit.org/cgi-bin/TWiki/view/Main/WishList

I used rapid on a ABB robot as well, and this would be very nice to have.
 
RAPID for Jedit. sweet, where do i sign up ?
by browsem on Tue, 04/04/2006 - 06:26
It's not the robot. It's the knowhow
 
can we have the work you did do?
by bigted on Wed, 19/07/2006 - 20:17
would the original poster be willing to share the work that they have done, so that I won't need to reinvent the wheel?
 
Uploaded to files section
by andrewt on Thu, 23/11/2006 - 05:32
Sorry I haven't checked this forum in ages - have not been working with this equipment for a long time.
Anyway I have uploaded it to the files section, as-is. I can't remember what state it was in exactly but I think at least the basics worked, syntax highlighting, Code Browser support.
Hope you can extend and update it.
User login
Browse archives
« March 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
31
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   82339
Context Free Art (*.cfdg)   0.31   46046
JBuilder scheme   .001   18487
BBEdit scheme   1.0   18108
ColdFusion scheme   1.0   18016
R Edit Mode - extensive version   0.1   17465
Advanced HTML edit mode   1.0   16198
Matlab Edit Mode   1.0   16060
jEdit XP icons   1.0   15221
XP icons for jEdit   1.1   14285