jEdit Community - Resources for users of the jEdit Text Editor
Indent Next Line property
Submitted by Targ Collective on Thursday, 6 October, 2005 - 14:45
I am trying to get IndentNextLine to work in a custom XML, but as the Jedit documentation does not cover this in nearly enough depth I don’t know where to start. The example is no help, as there are more of these: “(“ than these: “ )“ which confuses things. The Jedit team should update their documentation of this really, but in the interim could someone fill me in?
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
qq
by hy263 on Tue, 29/08/2006 - 09:53
免费性电影 成人电影下载 性爱视频 偷拍图片 泳装美女 性感内衣 性爱贴图 性生活图片 作爱图片 性交电影 做爱电影 性福 人体摄影 裸女图片 乱伦图片 强暴电影 轮奸视频 迷奸图片 免费小电影 免费电影在线 免费影片 最新大片 免费电影下载 免费在线电影 看免费电影 免费电影网站 情色电影 激情视频下载 明星露点图片 激情写真 阴部图片 乳房图片 全裸美女 淫荡小说 淫乱小说 美女脱衣视频 裸体美女 手淫图片 波霸美女 淫水图片 阴户阴毛图片 美女图库 美女口交图片 韩国电影 性知识图片 最新电影 宽带电影 经典电影 恐怖电影 人体艺术 美女图片 美女走光 A片下载 毛片 偷窥图片 裸体视频聊天室 成人网站 成人论坛 性爱论坛 性变态图片 淫女 女大学生 美女下阴图 女性生殖器 操逼图片 激情论坛 两性生活 性教育片 两性知识 美腿图片 三级片 黄色电影 成人性爱电影 写真电影 美女阴部 美女乳房 强奸图片 裸体图片 美女自拍 色情图片 激情图片 激情小电影 性感图片 性交图片 做爱图片 黄色小说 成人小说 偷拍走光 美眉图片 人体写真 性虐待电影 写真集 激情电影 免费影院 日本av电影 美少女贴图 性感美女图片 美女写真 漂亮妹妹图片 同志电影 性交姿势 手机铃声制作 手机mp3下载 手机主题 如何制作手机铃声 真人原唱和弦铃声 qd铃声下载 经典铃声 联通手机彩铃 诺基亚手机铃声 小灵通铃声 移动手机铃声 手机动画 手机彩图 手机铃音 手机铃声论坛 搞笑手机铃声 个性铃声 dj铃声 唱得响亮铃声 手机铃声图片 高频铃声下载 手机铃声格式 搞怪铃声 比特铃声 自编铃声 adp铃声 七彩铃声 神奇铃声 最新铃声 另类铃声 短信铃声 来电铃声 音乐铃声 歌曲铃声 铃声试听 手机壁纸 彩色铃声 v3铃声下载 手机待机图片 免费手机图片 三星手机图片 经典铃声 最新手机铃声 戴尔笔记本报价 戴尔笔记本电脑价格 戴尔双核笔记本 戴尔电脑网站 戴尔家用电脑 戴尔电脑官方网站 戴尔台式机 戴尔网上订购 戴尔笔记本电脑网上订购 戴尔双核笔记本 戴尔服务器 戴尔电脑公司 戴尔电脑价格 戴尔台式电脑 戴尔手提电脑 戴尔中国 戴尔网站 戴尔笔记本官方网站 戴尔笔记本 戴尔笔记本电脑 dell笔记本电脑 双核笔记本电脑 戴尔笔记本电脑报价 戴尔电脑网上订购
Indent Next Line property
by pvondrak on Sat, 08/10/2005 - 02:00
The example uses a regular expression, so many of the "(" are intended to be part of the value to match. I just went through this trying to get it to work for a more basic language, and even with the new indenting features in 4.3pre2, it still doesn't do what I'd like it to.

In my case, ":" is a continuation character, and I wanted all continued lines to indent one space. I didn't care about whitespace after the ":", and anything could come before it.

[ PROPERTY NAME="indentNextLine" VALUE="\s*(.*:)\s*" /]
I could have just used VALUE=".*:\s*", but I made it easier for me to modify later, since I never care about whitespace. For example, if I decided I also wanted to indent just the next line after the word "case", I'd have VALUE="\s*(case|.*:)\s*" This translates to "Indent the next line if the current line starts with any whitespace characters and either "case" or any characters and ":", followed by any whitespace characters.

When I wanted to indent all the following lines, I used:
[ PROPERTY NAME="indentNextLines" VALUE="\s*(if.*|else.*|loop|switch|case.*|default)\s*" /]

matching lines are
if (1)
if
else
case "a" or "b"

but not
break if (1)
since there are non-whitespace characters before the "if".

As for the example in the documents:
VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)"

key:
\s* = any whitespace
.* = any character
\s+ = at least one whitespace
^ = start of line (this should have been "$" for end of line - doc error)
\( or \) = "(" or ")"

translation:
Any number of whitespace AND
(
( (if OR while)AND any whitespace AND (
OR else AND any whitespace
OR else AND one or more whitespace AND if AND any whitespace AND (
OR for AND any whitespace AND ( AND any character and )
)
AND
any number of start of line (sb end of line), { or ;
)

jEdit 4.3pre2 has some new auto indent properties such as unindentThisLine and unindentNextLines. Unfortunately, it doesn't appear to automatically unindent a line that matches unindentThisLine - you have to use electricKeys to trigger it to re-indent the current line. That didn't work for me since most of my unindent code ends with a end of line, the electricKeys property doesn't take regular expressions, and even if it did, it re-indents any line, not just current ones matching unindentThisLine, which was bad for me since there are instances where I don't want to use the default indenting. Oh well! Smiling

Hope this helped! If not, let me know if you have any specific questions and I'll try to be more understandable. Eye-wink
 
Hmm. That's pretty comprehens
by Targ Collective on Sat, 08/10/2005 - 11:15
Hmm. That's pretty comprehensive. It'll need some study for me to understand fully though. Now, let's see... What I'm after is an indent with any alphanumeric sequence after :, If, Then and End. I'm after an unindent with Disable and the backspace key, though I suspect Jedit supports the latter as default. If I read your example correctly brackets are used to separate individual entries. Would this work?

VALUE="(.*:)(if|then|end)"

For unindent:
VALUE="(disable)"

Or have I got it completely wrong?

Um, thanks for your help by the way.
 
You'll need something at the
by pvondrak on Sat, 08/10/2005 - 15:56
You'll need something at the end to match whitespace/end of line characters. You may find it helpful to show the end of line chars while testing it to see what I mean. The parenthesis aren't necessary if you aren't going to add extra terms later, but they don't hurt.

VALUE=".*:(if|then|end)\s*"
This matches (any character AND : AND one of (if or then or end) AND whitespace (including end of line)
So "[code]:if" or ":end" trigger it, but not "[code]: if" or "if:".

For unindent, unindentNextLines appears to work, although I can't get unindentNextLine to work, nor will unindentThisLine work unless you have a trigger key to reindent the line (which you don't with just "disable"). See the detailed change log in the 4.3 help for more info.

Anyway, remember to account for start and end whitespace, so you'll want unindentNextLines="\s*disable\s*", or if you wanted to later add something else to "disable", it would be:
VALUE="\s*(disable|something else)\s*".
 
Thanks again, but you misunde
by Targ Collective on Sat, 08/10/2005 - 16:20
Thanks again, but you misunderstood my meaning. If, Then and End are elements of logic statements in the language I am working in while things like :autorun, :elem1, :elem2 are rescognised as script elements. Correct me if I'm wrong, but I thought Jedit only supported one instance of indentnextline? Given this the correct syntax should be VALUE=".*:|\s*(if|then|end)\s*" unless I've missed something. Any character and ':' OR whitespace AND if OR then OR end AND whitespace. I think I might be getting the hang of this... Am I correct, or close to correct, in terms of my syntax?
 
jEdit has indentNextLine to i
by pvondrak on Sat, 08/10/2005 - 17:03
jEdit has indentNextLine to indent just the next line and then returns to the previous indent level (unless that next line also triggers an indent, in which case it remains at the temporarily indented level). It also has indentNextLines, which is used to increase the indent level for all following lines until you manually reset it or it runs across an unindentNextLines.

Your value will indent the next line when:
.*:
OR
\s* AND (if OR then OR end) AND \s*

you'll want \s* to be at the end of all your cases, otherwise it won't match those that don't have it because of the end of line character.

VALUE=".*:\s*|\s*(if|then|end)\s*"

.*: AND \s*
OR
\s* AND (if OR then OR end) AND \s*

which is the same as VALUE="(.*:|\s*(if|then|end))\s*"


I probably still don't quite understand just what you want to match though. If it's not working the way you want, could you post a code example and indicate how you'd like it to indent? If you like, you can also email an example and your current mode file to pvondrak1@comcast.net and I'll try to take a look at it later today.
 
That's very nice of you to of
by Targ Collective on Sun, 09/10/2005 - 09:10
That's very nice of you to offer, but now I'm getting the hang of it I'd rather work through it myself; I'll learn more that way, see. My major limitation is the :scriptelements don't have a closing tag apart from the optional Disable. Still, it's just one press of backspace, and most elements won't be constant anyway.

Thanks for all your help. It's great to know there are folk like you frequenting these forums.
User login
Browse archives
« April 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   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293