Jump to content

Scite Editor Autoit Settings


Recommended Posts

I don't see any that you forgot. However, it is debateable whether or not . and , should be included. It depends on whether or not you want all non-text characters colored or not (Personally I like coloring all non-text, but it doesn't matter a lot).

You can probably simplify your code by using ispunct(). However, I don't know what exactly it looks for. Documentation just says anything which will return false to isalnum (or a space) is punctuation. I also didn't test the function or code so use at your own risk.

inline bool IsAOperator(char ch) 
{
    if (ispunct(ch) && (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
        ch == '&' || ch == '^' || ch == '=' || ch == '<' || ch == '>' ||
        ch == '(' || ch == ')' || ch == '[' || ch == ']'))
         return true;
    return false;
}
Link to post
Share on other sites
  • Replies 136
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Developers

I don't see any that you forgot.

The code shown in my post is the corrected code, just to show what the lexer is looking for.

I just put in the IsAOperator list the stuff listed in the Helpfile under "Language Reference - Operators" which I thought makes kind of sence. agree that the []() is handy to do as well.

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 post
Share on other sites

#include-once does not format properly.

It looks like: #include-once

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to post
Share on other sites
  • Developers

#include-once does not format properly.

It looks like:  #include-once

Ok understand now.... found the issue in the lexer, fixed and uploaded it scite.zip

EDIT: fixed link

Edited by JdeB

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 post
Share on other sites

JdeB,

Looks very good so far. One thing I noticed, though.

When I have something like "{DOWN}" in a string it gets highlighted as a SendKeys keyword, which is great. But, if I have something like "{DOWN 7}" it doesn't. Any way to get SciTe to highlight the later as a SendKeys keyword as well?

Also, not having used SciTe that long, so excuse me if this is elementary, but is there a way to get SciTe to change the case of AutoIt3 keywords as you type. I know AutoIt3 itself is case incensitive, but I would like, for instance, when I type "winclose" for SciTe to "correct" that to be "WinClose". (It just looks nicer. :D) Or would I have to run tidy to get that "fixed"?

Anyway, thank for all your hard work!

Later...

My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!
Link to post
Share on other sites

JdeB,

Looks very good so far. One thing I noticed, though.

When I have something like "{DOWN}" in a string it gets highlighted as a SendKeys keyword, which is great. But, if I have something like "{DOWN 7}" it doesn't. Any way to get SciTe to highlight the later as a SendKeys keyword as well?

Also, not having used SciTe that long, so excuse me if this is elementary, but is there a way to get SciTe to change the case of AutoIt3 keywords as you type. I know AutoIt3 itself is case incensitive, but I would like, for instance, when I type "winclose" for SciTe to "correct" that to be "WinClose". (It just looks nicer. :)) Or would I have to run tidy to get that "fixed"?

Anyway, thank for all your hard work!

Later...

Try out the formatting utility that will upper or lower case key words and/or variables for you. Indenting and documenting processing levels are available too.

It is at "http://groups.yahoo.com/group/AutoItList/files/AU3/UTIL/tidy.exe".

Gene :D:huh2:

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Link to post
Share on other sites

Try out the formatting utility that will upper or lower case key words and/or variables for you.  Indenting and documenting processing levels are available too.

It is at "http://groups.yahoo.com/group/AutoItList/files/AU3/UTIL/tidy.exe".

Thanks for that, Gene, but I know about tidy. I even mentioned it in my post. It is even included in JdeB's SciTE zip file and appears on the menu of the editor. I was hoping the editor itself would correct the case of keywords and such as you type, even though AutoIt3 doesn't care about the case, I think it looks better and is easier to read. Tidy does do a nice job; I'd just like it if the editor helped me to create nice looking code as I write it.
My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!
Link to post
Share on other sites
  • Developers

Klaatu, currently the only way you could highlight those is adding them to the AU3.PROPERTIES file as well.... but i realise that this would mean a lot of options needs to be added.

The way the lexer works at this moment is that it checks for exact matches in the keywords defined in au3.properties.

Don't know a simple way without lots of hardcoding to do this....

Edited by JdeB

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 post
Share on other sites
  • Developers

Also, not having used SciTe that long, so excuse me if this is elementary, but is there a way to get SciTe to change the case of AutoIt3 keywords as you type. I know AutoIt3 itself is case incensitive, but I would like, for instance, when I type "winclose" for SciTe to "correct" that to be "WinClose". (It just looks nicer. :D) Or would I have to run tidy to get that "fixed"?

To have Scite update the keywords to the proper case you can hit Ctrl+I when you finished the keyword (or type only the beginning of it)

When its unique, it will update it to the proper case else it will show a dropdown list with possible options....

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 post
Share on other sites

Thanks JdeB, it's better than nothing. :D For more than just keywords, Ctrl-Enter and Ctrl-Space are nice too.

PS: it appears that "Opt" was left out of the list of keywords in au3.properties..(unless it wasn't supposed to be there in the first place. :huh2: )

My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!
Link to post
Share on other sites
  • Developers

Opt is missing and so are the sendkey words (shiftup, controlup, altup that I recall).  I think there are a few other function's missing, too, but I don't recall which ones.

I use the files supplied by Jon as the base for all keywords, functions and macros.

Added the SendKeys that were missing to the au3.propreties file and uploaded it..... tnx

Scite.zip or just the config update : au3.properties

Also added "command.save.before.9.*.au3=1" to it to avoid the save question before running tidy.exe.

Edited by JdeB

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 post
Share on other sites

JdeB, don't know if I missed this one or you haven't fixed it yet, but if you add this line to your au3.properties then macro's will appear in the auto-complete box when you type @:

autocomplete.au3.start.characters=$(chars.alpha)$chars.numeric)@

Edited by Valik
Link to post
Share on other sites
  • Developers

JdeB, don't know if I missed this one or you haven't fixed it yet, but if you add this line to your au3.properties then macro's will appear in the auto-complete box when you type @:

autocomplete.au3.start.characters=$(chars.alpha)$chars.numeric)@

Valik, didn't know about this one , thats a nice one to include... Added it to the au3.properties file.

I was working on a new upload because there was one other minor issue with SENDKEYS not being terminated properly... eg "{enter" ... It would still show up with the SENDKEY colour.

Could you and others pls. test this Scite.zip version a bit more to make sure its correct now before i submit it to the Scite Folks ?

tnx

Edited by JdeB

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 post
Share on other sites

Valik, didn't know about this one , thats a nice one to include... Added it to the au3.properties file.

I was working on a new upload because there was one other minor issue with SENDKEYS not being terminated properly...  eg "{enter" ...  It would still show up with the SENDKEY colour.

Could you and others pls. test this Scite.zip version a bit more to make sure its correct now before i submit it to the Scite Folks ?

tnx

I will report any problems if I encounter them, but today is the first day I've done any AutoIt scripting in 2 weeks or something. I've started what should be a fairly small project (AutoIt-GUI), and it won't be using any sendkeys. In fact, the bulk will probably be GUI design/interaction, so I'll only be able to "test" the normal highlighting stuff. In fact, I can't think of any project I have started that uses sendkeys in any form.

One suggestion to think about (I don't know how hard it would be to implement).

Should these highlight as send keys?

Send("{Enter 5}asdf") - Shows up as string color, is it easily doable to make {Enter 5} a sendkey and asdf string color?

Send("{a down}bcd") - Same as above.

A thought might be that instead of searching for {Enter} in the lexer, get the sendkey-keyword "enter", then automatically prepend a { for comparison sake, then allow a number or the words up/down to follow the keyword and then it must immediately have a closing }.

Pseudo-example:

Editor Text:

Send("{Enter 5}bcdef")

Lexer gets that text above and the following sendkey list:

keywords4.$(au3)=enter shiftup shiftdown ! #

Now, automatically add a { to each of the keywords and you should be able to make a match against the word "{Enter ". Then check the next word to see if it is either numeric, "up" or "down" (or a closing brace), followed by a closing brace }. If the criteria is met, it's a sendkey, otherwise, treat it as a string.

I hope you could understand that, it's rather confusing to explain. If you can't, let me know and I'll try to diagram it better in HTML or something.

Link to post
Share on other sites
  • Developers

I will report any problems if I encounter them, but today is the first day I've done any AutoIt scripting in 2 weeks or something.  I've started what should be a fairly small project (AutoIt-GUI), and it won't be using any sendkeys.  In fact, the bulk will probably be GUI design/interaction, so I'll only be able to "test" the normal highlighting stuff.  In fact, I can't think of any project I have started that uses sendkeys in any form.

One suggestion to think about (I don't know how hard it would be to implement).

Should these highlight as send keys?

Send("{Enter 5}asdf") - Shows up as string color, is it easily doable to make {Enter 5} a sendkey and asdf string color?

Send("{a down}bcd") - Same as above.

A thought might be that instead of searching for {Enter} in the lexer, get the sendkey-keyword "enter", then automatically prepend a { for comparison sake, then allow a number or the words up/down to follow the keyword and then it must immediately have a closing }.

Pseudo-example:

Editor Text:

Send("{Enter 5}bcdef")

Lexer gets that text above and the following sendkey list:

keywords4.$(au3)=enter shiftup shiftdown ! #

Now, automatically add a { to each of the keywords and you should be able to make a match against the word "{Enter ".  Then check the next word to see if it is either numeric, "up" or "down" (or a closing brace), followed by a closing brace }.  If the criteria is met, it's a sendkey, otherwise, treat it as a string. 

I hope you could understand that, it's rather confusing to explain.  If you can't, let me know and I'll try to diagram it better in HTML or something.

Valik, understand what you are looking for and have already starting to look at senkeys.cpp to see what logic Jon uses there.... also need to do some more RTFMing on C++ before I am able to properly code that and didn't want to wait to long before sending this update to Neil....

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 post
Share on other sites
  • Developers

Thank goodness you understood me, I didn't want to try to explain that again...

yea... the thing is that its easy to understand what you are looking for but ...looking at the logic AutoIt3 can handle .... that's a different thing !!!

Just look at the examples from the Helpfile and al its possibilities.... Especially the last example gets really complicated... :D

To send the ASCII value A (same as pressing ALT+065 on the numeric keypad)
    Send("{ASC 65}")

Single keys can also be repeated, e.g.
    Send("{DEL 4}");Presses the DEL key 4 times
    Send("{S 30}");Sends 30 'S' characters
    Send("+{TAB 4});Presses SHIFT+TAB 4 times

To hold a key down (generally only useful for games)
    Send("{a down}");Holds the A key down
    Send("{a up}");Releases the A key

To set the state of the capslock, numlock and scrolllock keys
    Send("{NumLock on}");Turns the NumLock key on
    Send("{CapsLock off}");Turns the CapsLock key off
    Send("{ScrollLock toggle}");Toggles the state of ScrollLock

If you with to use a variable for the count, try
    $n = 4
    Send("+{TAB " & $n & "}")

If you wish to send the ASCII value A four times, then try
    $x = Chr(65)
    Send("{" & $x & " 4}")

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 post
Share on other sites
  • Developers

yea...  the thing is that its easy to understand what you are looking for but ...looking at the logic AutoIt3 can handle .... that's a different thing !!!

Just look at the examples from the Helpfile and al its possibilities.... Especially the last example gets really complicated...  :huh2: 

Valik/Klaatu,

I really put my mind to it last evening and coded up the syntax in the lexer to check for the sendkeys with a second option....

Uploaded a test SciLexer.dll and au3.properties that will handle all the examples shown in the previous post except ofcourse the ones with the $Vars in it.

Download: scilexer.zip

So... what do you think ? :D

and Klaatu, with these settings in the au3.properties, the keywords pop-up automatically.. ...think you askedfor that...

Edited by JdeB

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 post
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...