# Annoying If/Else behavior in SciTE

**URL:** <https://www.ruby-forum.com/t/annoying-if-else-behavior-in-scite/74214>\
**Category:** Ruby\
**Created:** [November 1, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/annoying-if-else-behavior-in-scite/74214 "2006-11-01T23:44:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [November 1, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/annoying-if-else-behavior-in-scite/74214/1 "2006-11-01T23:44:59Z")

</div>

Currently, when using SciTE, my if/else statements are formatted like  
so:

if (x \> 0)  
y = 1  
else  
z = 2  
end

I’d like it to look like this:

if (x \> 0)  
y = 1  
else  
z = 2  
end

How should I adjust my properties to get this behavior?

Thanks,  
Drew

---

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [November 7, 2006, 10:56am UTC](https://www.ruby-forum.com/t/annoying-if-else-behavior-in-scite/74214/2 "2006-11-07T10:56:16Z")

</div>

Drew O. wrote:

> How should I adjust my properties to get this behavior?

From a cursory glance at ruby.properties, the SciTE autoindentation  
seems rather rudimentary and only supports things like “indent line  
after seeing these words in token stream”. If you want smart formatting,  
I’d recommend a more powerful editor like vim, Emacs, jEdit, SciTEs  
qualities are on the “lightweight” side of things to serve as a config  
file touchup editor, or to make quick fixes to stuff.

There is a version of SciTE that ships with Artistic Style, but I’ve no  
idea how that program or SciTE’s integration therewith works.

David V.

---

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [November 7, 2006, 10:58am UTC](https://www.ruby-forum.com/t/annoying-if-else-behavior-in-scite/74214/3 "2006-11-07T10:58:20Z")

</div>

Drew O. wrote:

> Currently, when using SciTE, my if/else statements are formatted like  
> so:  
> …  
> How should I adjust my properties to get this behavior?

I get the impression to get smarter behavior you’d have to implement a  
Ruby lexer.

I like to use a simple reformat script  
([Ruby Beautifier Script Listing](http://www.arachnoid.com/ruby/rbeautify.rb.html))  
Add it to the tool menu for ruby and it seems to work well. Have to  
configure Scite so it checks for file changes and will reload (it  
prompts for reload) after the format changes are made

Cheers
