New unindentThisLine property
Submitted by Monday, 14 March, 2005 - 22:24
on
I don't know if this is user error, or a bug, so I thought I'd start in the troubleshooting forum.
I constantly use jEdit to edit Ruby scripts (whose files end in .rb). Ruby uses a lot of keywords to specify blocks and other areas where one might want to indent. For example
def foo( num )
a=1
begin
# some code
if a==1
# more code
elsif a==2
# more code
else
# blah
end
# yadayadayada
end
return a
end
I can get indenting to work just fine when I use the indentNextLines="\s*((if\s+.*|elsif\s+.*|else\s*|do(\s*|\s+.*)|case\s+.*|when\s+.*|while\s+.*|for\s+.*|until\s+.*|loop\s+.*|def\s+.*|class\s+.*|module\s+.*|begin.*|unless\s+.*)*)"
However, if I add a unindentThisLine property, not only does it not work, it screws up my indentNextLines property. The following is how the same code above would look with indentThisLine="\s*((end\s*|else\s*|elsif\s+)*)"
def foo( num )
a=1
begin
# some code
if a==1
# more code
elsif a==2
# more code
else
# blah
end
# yadayadayada
return a
end
Normally, with only using the indentNextLines, I would get proper indentation after the begin, def, if, elsif and else statements. If I add the unindentThisLine property, not only do the lines not get unindented at the right time, but the indentNextLines breaks. As you can see in the above example, I only got indentation *after* and "else" or an "end" (which were specified in unindentThisLine). And only the next line was indented, after that it unindented.
So, it seems that the addition of unindentThisLine break indentNextLine, plus anything I specify in unindentThisLine does not unindent, but rather indents the next (and only the next 1) line.
Am I doing something wrong? Or is this a bug?
I constantly use jEdit to edit Ruby scripts (whose files end in .rb). Ruby uses a lot of keywords to specify blocks and other areas where one might want to indent. For example
def foo( num )
a=1
begin
# some code
if a==1
# more code
elsif a==2
# more code
else
# blah
end
# yadayadayada
end
return a
end
I can get indenting to work just fine when I use the indentNextLines="\s*((if\s+.*|elsif\s+.*|else\s*|do(\s*|\s+.*)|case\s+.*|when\s+.*|while\s+.*|for\s+.*|until\s+.*|loop\s+.*|def\s+.*|class\s+.*|module\s+.*|begin.*|unless\s+.*)*)"
However, if I add a unindentThisLine property, not only does it not work, it screws up my indentNextLines property. The following is how the same code above would look with indentThisLine="\s*((end\s*|else\s*|elsif\s+)*)"
def foo( num )
a=1
begin
# some code
if a==1
# more code
elsif a==2
# more code
else
# blah
end
# yadayadayada
return a
end
Normally, with only using the indentNextLines, I would get proper indentation after the begin, def, if, elsif and else statements. If I add the unindentThisLine property, not only do the lines not get unindented at the right time, but the indentNextLines breaks. As you can see in the above example, I only got indentation *after* and "else" or an "end" (which were specified in unindentThisLine). And only the next line was indented, after that it unindented.
So, it seems that the addition of unindentThisLine break indentNextLine, plus anything I specify in unindentThisLine does not unindent, but rather indents the next (and only the next 1) line.
Am I doing something wrong? Or is this a bug?