jEdit Community - Resources for users of the jEdit Text Editor
Mode woes
Submitted by haama on Friday, 6 February, 2009 - 17:09
Hi all, I've gotten a new Mode to work for the most part, but am still having trouble with Auto-Indent and RegExp tags. By the way, I'm using jEdit v4.3pre16, java 1.6u11, and Windows (XP). Auto-Indent: I'm going for begin/if stuff else/elseif more stuff endif/end So I tried It indents properly, but it doesn't unindent. Narrowing it down, the UnindentThisLine tag is working exactly like the IndentNextLines tag. For example, will indent the lines following "else" or "end". I thought it was a bug, but UnindentThisLine works prefectly with java mode. Not sure what I'm doing wrong, though. The props and main rule set is %% %g [\d.+-]+[ef] RegExp tags: As you can see in the rules above, I have a digits RegExp tag and a SEQ - neither one of them works. For digits, I'm trying to display decimals and negatives with the same highlight as numbers, using DIGIT_RE="[^%][.-](?=[0-9])". The decimal and negative display as Operators (which I have them defined as later) in every case I can think of ".4", "4.4", "-4", "423.543-45". Tried it as [.-](?=[0-9]) and that didn't work either. The SEQ_REGEXP tag is supposed to display anything like "%.3f" as a solitary operator. Instead, it displays the "%." as operators, the number(s) as digit, and when I type in the last letter the number and letter become null. I've tried this with and without the hash character to no avail. I know I'm looking over something, but I can't tell what and have exhausted my possibilities. Any help is much appreciated, thanks.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
New to Jedit
by sunwukong on Thu, 12/02/2009 - 07:35
Well looks good so far. I've been looking for an open source editor (I've been using Edit Pad Pro and the text editor that came with old WP 5.1). The one feature that JEdit has that I really needed was that the cursor insertion point does not scroll down to the bottom of the page. There are always a few lines visible below the cursor insertion point. Is there a way to adjust this up higher in the text area?
 
no
by Robert Schwenn on Fri, 13/02/2009 - 20:18
You can disable this feature, but You cannot adjust it.

Robert
Sorry about the mess
by haama on Fri, 06/02/2009 - 17:22
Oops, sorry about the mess there. Preview wasn't bringing anything up. Let's try that again: Hi all, I've gotten a new Mode to work for the most part, but am still having trouble with Auto-Indent and RegExp tags. By the way, I'm using jEdit v4.3pre16, java 1.6u11, and Windows (XP). Auto-Indent: I'm going for
begin/if
    stuff
else/elseif
    more stuff
endif/end
So I tried (without the * in the tag)
		<*PROPERTY NAME="indentNextLines" VALUE="\s*(begin|if|else(if)?)\b[\n]*" />
		<*PROPERTY NAME="unindentThisLine" VALUE="\s*(else(if)?|end)\b[\n]*" />
		<*PROPERTY NAME="unindentNextLines" VALUE="\s*(else(if)?|end)\b[\n]*" />
It indents properly, but it doesn't unindent. Narrowing it down, the UnindentThisLine tag is working exactly like the IndentNextLines tag. For example,
		<*PROPERTY NAME="unindentThisLine" VALUE="\s*(else|end)\b[\n]*" />
will indent the lines following "else" or "end". I thought it was a bug, but UnindentThisLine works prefectly with java mode. Not sure what I'm doing wrong, though. The props and main rule set is
	<*PROPS>
		<*PROPERTY NAME="lineComment" VALUE=";" />
		<*PROPERTY NAME="maxLineLen" VALUE="512" />
		
		
		<*PROPERTY NAME="indentNextLines" VALUE="\s*(begin|if)\b.*" />
		<*PROPERTY NAME="unindentThisLine" VALUE="\s*(else|end)\b.*" />
		<*PROPERTY NAME="unindentNextLines" VALUE="\s*(else|end)\b.*" />
	<*/PROPS>
	
	<*RULES HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[^%][.-](?=[0-9])">
		<*SEQ TYPE="OPERATOR">%%
		<*SEQ TYPE="OPERATOR">%g
		<*SEQ_REGEXP TYPE="OPERATOR" HASH_CHAR="%">[\d.+-]+[ef]<*/SEQ_REGEXP>
		<*IMPORT DELEGATE="Bethesda::MAIN"/>
		<*IMPORT DELEGATE="Bethesda::Commands"/>
		<*IMPORT DELEGATE="TES4Functions::All"/>
		<*IMPORT DELEGATE="Globals"/>
		<*IMPORT DELEGATE="SpecialVariables"/>
		<*IMPORT DELEGATE="Blocks"/>
	<*/RULES>
RegExp tags: As you can see in the rules above, I have a digits RegExp tag and a SEQ - neither one of them works.

For digits, I'm trying to display decimals and negatives with the same highlight as numbers, using DIGIT_RE="[^%][.-](?=[0-9])". The decimal and negative display as Operators (which I have them defined as later) in every case I can think of ".4", "4.4", "-4", "423.543-45". Tried it as a SEQ_REGEXP TYPE="DIGIT"... tag and that didn't work either. 

The SEQ_REGEXP tag is supposed to display anything like "%.3f" as a solitary operator. Instead, it displays the "%." as operators, the number(s) as digit, and when I type in the last letter the number and letter become null. I've tried this with and without the hash character to no avail.

I know I'm looking over something, but I can't tell what and have exhausted my possibilities. Any help is much appreciated, thanks
 
I got it never working, too.
by Robert Schwenn on Mon, 09/02/2009 - 21:45
I got it never working, too. I think it simply doesn't work, because the developers haven't had languages like Basic in mind...

Robert
 
Maybe some hints
by haama on Tue, 10/02/2009 - 20:28
Heh, well, I was hoping to get it working better than Notepad++ but at least this is basically the same way NP++ worked.

From poking around in the other forums, I found out the indentation does work, however you have to press indent (Ctrl+i) on the line. Also, something you commented on - the  tag works, but only the  tag can use RegExp. Are all other RegExp tags non-functional?
 
?
by Robert Schwenn on Tue, 10/02/2009 - 22:30
Sorry, I don't understand the question. What are "all other tags"?
 
Other tags
by haama on Fri, 13/02/2009 - 23:01
I mean other RegExp tags like EOL_REGEXP, etc.

If it's not possible, it's not a major issue. I've never seen another program which highlights decimals as numbers, either.
 
Of course they do work :-)
by Robert Schwenn on Sat, 14/02/2009 - 21:15
Of course they do work Smiling
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