Jump to content

scite for autoit indent


Recommended Posts

Hey, so I know this is trivial at best, and it really doesn't bother me all that much, I just wanted to (if it wasn't already) communicate an inconsistency in Scite for AutoIT's automatic indent functionality.  I have noticed that, whenever I am working with nested "if" statements, when closing the internal "if" statement, if the next line happens to be an "Else then" or "Else" statement of an external "if" statement, the line will maintain the same amount of white space between the beginning of the new line and the first character of code as the internal if statement and not "Tab Back" for lack of a better word.  Example:


But adding even a single line between the closing of the internal and the "Else" of the external is fine, even if it is blank:


From what I can tell, Scite seems to think (as far as formatting goes) that the "endif" of the internal loop also closes the external statement, which can be seen if you try to collapse the external statement (or maybe its like that by design, idk?):


However, everything compiles and runs perfectly, and I really don't care all that much.  I just figured I would make developers aware if they weren't already.  AutoIT is without a shadow of a doubt my favorite scripting language, just figured I put in my two cents.

Edited by MattHiggs
Link to comment
Share on other sites

  • Developers

Yea I know and it is quite hard to make it perfect. Just look at AutoItIndentFix.lua for all corrections performed.
In this case there is an issue with the retrieval of the previous header level when the last statement is an EndIf.

Always open to suggestions when somebody has a  solution for this one.


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Link to comment
Share on other sites

  • 1 year later...


Thanks for the info. I've been having a similar auto-indent problem (without nesting) and it's helpful to know issues like this have been identified.


(When I input an if-then-else-endif, as soon as I type the Else and press [Enter], the Else jumps one tab-stop to the right and has to be manually outdented. Not serious, just a nuisance.)

When the going gets tough, the tough start coding.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...