Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AutoIt syntax highlighting #1017

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c449b6c
Add AutoIt syntax highlighting
Skif-off Apr 29, 2016
8122c41
Some fix filetypes.autoit
Skif-off May 26, 2016
2ac0313
Some fix filetypes.autoit:
Skif-off Jun 1, 2016
5fadc42
Merge pull request #2 from geany/master
Skif-off Jun 7, 2017
7588791
Merge pull request #3 from geany/master
Skif-off Aug 25, 2017
d8cae9d
Merge pull request #4 from geany/master
Skif-off Sep 29, 2017
1be0295
Merge pull request #5 from geany/master
Skif-off Oct 4, 2017
f67cbf5
Merge branch 'master' into geany-autoit
Skif-off Oct 4, 2017
25dd7e4
Merge pull request #6 from geany/master
Skif-off Oct 7, 2017
ca32056
Merge pull request #7 from Skif-off/master
Skif-off Oct 7, 2017
3398e3e
Fix indentation
Skif-off Oct 8, 2017
d395266
Add line: style as all other "case"
Skif-off Oct 8, 2017
e183d71
Merge pull request #8 from geany/master
Skif-off Oct 23, 2017
d8ae983
Merge pull request #9 from Skif-off/master
Skif-off Oct 23, 2017
dc6c70b
Merge pull request #10 from geany/master
Skif-off Nov 9, 2017
7280a9f
Merge pull request #11 from Skif-off/master
Skif-off Nov 9, 2017
acf468c
Merge pull request #12 from geany/master
Skif-off Nov 17, 2017
1758d86
Merge pull request #13 from Skif-off/master
Skif-off Nov 17, 2017
5222784
Merge pull request #14 from geany/master
Skif-off Nov 19, 2017
b41c14f
Merge pull request #15 from Skif-off/master
Skif-off Nov 19, 2017
3551f53
AutoIt: Add Ctags parser
Skif-off Nov 23, 2017
8dae73a
Merge pull request #16 from geany/master
Skif-off Dec 6, 2017
75ffca2
Merge pull request #17 from Skif-off/master
Skif-off Dec 6, 2017
cac68fe
Merge pull request #18 from geany/master
Skif-off Dec 17, 2017
386cb8c
Merge pull request #19 from Skif-off/master
Skif-off Dec 17, 2017
4dbc1b0
Merge pull request #20 from geany/master
Skif-off Dec 21, 2017
2d43aa4
Merge pull request #21 from Skif-off/master
Skif-off Dec 21, 2017
c0e25e6
Merge pull request #22 from geany/master
Skif-off Dec 22, 2017
4a9ea3f
Merge pull request #23 from Skif-off/master
Skif-off Dec 22, 2017
0f76309
Merge pull request #24 from geany/master
Skif-off Jan 13, 2018
a98bb2e
Merge pull request #25 from Skif-off/master
Skif-off Jan 13, 2018
0463317
Merge pull request #26 from geany/master
Skif-off Jan 25, 2018
c7f85c1
Merge pull request #27 from Skif-off/master
Skif-off Jan 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion data/Makefile.am
Expand Up @@ -70,7 +70,8 @@ filetypes = \
filedefs/filetypes.vhdl \
filedefs/filetypes.xml \
filedefs/filetypes.yaml \
filedefs/filetypes.zephir
filedefs/filetypes.zephir \
filedefs/filetypes.autoit

tagfiles = \
tags/c99.tags \
Expand Down
98 changes: 98 additions & 0 deletions data/filedefs/filetypes.autoit
@@ -0,0 +1,98 @@
# For complete documentation of this file, please see Geany's main documentation
# AutoIt 3.3.14.2
[styling]
# Edit these in the colorscheme .conf file instead
default=default
comment=comment
commentblock=comment
number=number,bold,italic
function=function,bold,italic
keyword=type
macro=preprocessor,bold
string=string
operator=operator,bold
variable=keyword_2
sent=0xd77100;;true;false
preprocessor=preprocessor,italic
special=type
expand=default
comobj=keyword_1,italic
udf=class,italic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styles here shouldn't include custom colors, italics, etc. I know it can be tricky to chose the mappings for things that don't have direct equivalents, but having arbitrary tuned ones makes it virtually impossible to theme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b4n, I fixed it, all fine except Gedit theme, because: function=default


# SciTE-like with Default "built-in" color scheme
#default=0x000000;0xffffff;false;false
#comment=0x009933;0xffffff;false;true
#commentblock=0x669900;0xffffff;false;true
#number=0xac00a9;0xffffff;true;true
#function=0x000090;0xffffff;true;true
#keyword=0x0000ff;0xffffff;true;false
#macro=0xff33ff;0xffffff;true;false
#string=0x9999cc;0xffffff;true;false
#operator=0xff0000;0xffffff;true;false
#variable=0xaa0000;0xffffff;true;false
#sent=0xff8800;0xffffff;true;false
#preprocessor=0xf000ff;0xffffff;false;true
#special=0xa00ff0;0xffffff;false;true
#expand=0xff0000;0xffffff;true;false
#comobj=0x0000ff;0xffffff;true;true
#udf=0xdd9900;0xffffff;false;false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not useful. if you want that, make a colorsheme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b4n, I agree with you and I deleted it.


[keywords]
keywords=and byref case const continuecase continueloop default dim do else elseif endfunc endif endselect endswitch endwith enum exit exitloop false for func global if in local next not null or redim return select static step switch then to true until volatile wend while with
functions=abs acos adlibregister adlibunregister asc ascw asin assign atan autoitsetoption autoitwingettitle autoitwinsettitle beep binary binarylen binarymid binarytostring bitand bitnot bitor bitrotate bitshift bitxor blockinput break call cdtray ceiling chr chrw clipget clipput consoleread consolewrite consolewriteerror controlclick controlcommand controldisable controlenable controlfocus controlgetfocus controlgethandle controlgetpos controlgettext controlhide controllistview controlmove controlsend controlsettext controlshow controltreeview cos dec dircopy dircreate dirgetsize dirmove dirremove dllcall dllcalladdress dllcallbackfree dllcallbackgetptr dllcallbackregister dllclose dllopen dllstructcreate dllstructgetdata dllstructgetptr dllstructgetsize dllstructsetdata drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype drivemapadd drivemapdel drivemapget drivesetlabel drivespacefree drivespacetotal drivestatus envget envset envupdate eval execute exp filechangedir fileclose filecopy filecreatentfslink filecreateshortcut filedelete fileexists filefindfirstfile filefindnextfile fileflush filegetattrib filegetencoding filegetlongname filegetpos filegetshortcut filegetshortname filegetsize filegettime filegetversion fileinstall filemove fileopen fileopendialog fileread filereadline filereadtoarray filerecycle filerecycleempty filesavedialog fileselectfolder filesetattrib filesetend filesetpos filesettime filewrite filewriteline floor ftpsetproxy funcname guicreate guictrlcreateavi guictrlcreatebutton guictrlcreatecheckbox guictrlcreatecombo guictrlcreatecontextmenu guictrlcreatedate guictrlcreatedummy guictrlcreateedit guictrlcreategraphic guictrlcreategroup guictrlcreateicon guictrlcreateinput guictrlcreatelabel guictrlcreatelist guictrlcreatelistview guictrlcreatelistviewitem guictrlcreatemenu guictrlcreatemenuitem guictrlcreatemonthcal guictrlcreateobj guictrlcreatepic guictrlcreateprogress guictrlcreateradio guictrlcreateslider guictrlcreatetab guictrlcreatetabitem guictrlcreatetreeview guictrlcreatetreeviewitem guictrlcreateupdown guictrldelete guictrlgethandle guictrlgetstate guictrlread guictrlrecvmsg guictrlregisterlistviewsort guictrlsendmsg guictrlsendtodummy guictrlsetbkcolor guictrlsetcolor guictrlsetcursor guictrlsetdata guictrlsetdefbkcolor guictrlsetdefcolor guictrlsetfont guictrlsetgraphic guictrlsetimage guictrlsetlimit guictrlsetonevent guictrlsetpos guictrlsetresizing guictrlsetstate guictrlsetstyle guictrlsettip guidelete guigetcursorinfo guigetmsg guigetstyle guiregistermsg guisetaccelerators guisetbkcolor guisetcoord guisetcursor guisetfont guisethelp guiseticon guisetonevent guisetstate guisetstyle guistartgroup guiswitch hex hotkeyset httpsetproxy httpsetuseragent hwnd inetclose inetget inetgetinfo inetgetsize inetread inidelete iniread inireadsection inireadsectionnames inirenamesection iniwrite iniwritesection inputbox int isadmin isarray isbinary isbool isdeclared isdllstruct isfloat isfunc ishwnd isint iskeyword isnumber isobj isptr isstring log memgetstats mod mouseclick mouseclickdrag mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox number objcreate objcreateinterface objevent objevent objget objname onautoitexitregister onautoitexitunregister opt ping pixelchecksum pixelgetcolor pixelsearch processclose processexists processgetstats processlist processsetpriority processwait processwaitclose progressoff progresson progressset ptr random regdelete regenumkey regenumval regread regwrite round run runas runaswait runwait send sendkeepactive seterror setextended shellexecute shellexecutewait shutdown sin sleep soundplay soundsetwavevolume splashimageon splashoff splashtexton sqrt srandom statusbargettext stderrread stdinwrite stdioclose stdoutread string stringaddcr stringcompare stringformat stringfromasciiarray stringinstr stringisalnum stringisalpha stringisascii stringisdigit stringisfloat stringisint stringislower stringisspace stringisupper stringisxdigit stringleft stringlen stringlower stringmid stringregexp stringregexpreplace stringreplace stringreverse stringright stringsplit stringstripcr stringstripws stringtoasciiarray stringtobinary stringtrimleft stringtrimright stringupper tan tcpaccept tcpclosesocket tcpconnect tcplisten tcpnametoip tcprecv tcpsend tcpshutdown tcpstartup timerdiff timerinit tooltip traycreateitem traycreatemenu traygetmsg trayitemdelete trayitemgethandle trayitemgetstate trayitemgettext trayitemsetonevent trayitemsetstate trayitemsettext traysetclick trayseticon traysetonevent traysetpauseicon traysetstate traysettooltip traytip ubound udpbind udpclosesocket udpopen udprecv udpsend udpshutdown udpstartup vargettype winactivate winactive winclose winexists winflash wingetcaretpos wingetclasslist wingetclientsize wingethandle wingetpos wingetprocess wingetstate wingettext wingettitle winkill winlist winmenuselectitem winminimizeall winminimizeallundo winmove winsetontop winsetstate winsettitle winsettrans winwait winwaitactive winwaitclose winwaitnotactive
macros=@appdatacommondir @appdatadir @autoitexe @autoitpid @autoitversion @autoitx64 @com_eventobj @commonfilesdir @compiled @computername @comspec @cpuarch @cr @crlf @desktopcommondir @desktopdepth @desktopdir @desktopheight @desktoprefresh @desktopwidth @documentscommondir @error @exitcode @exitmethod @extended @favoritescommondir @favoritesdir @gui_ctrlhandle @gui_ctrlid @gui_dragfile @gui_dragid @gui_dropid @gui_winhandle @homedrive @homepath @homeshare @hotkeypressed @hour @ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @kblayout @lf @localappdatadir @logondnsdomain @logondomain @logonserver @mday @min @mon @msec @muilang @mydocumentsdir @numparams @osarch @osbuild @oslang @osservicepack @ostype @osversion @programfilesdir @programscommondir @programsdir @scriptdir @scriptfullpath @scriptlinenumber @scriptname @sec @startmenucommondir @startmenudir @startupcommondir @startupdir @sw_disable @sw_enable @sw_hide @sw_lock @sw_maximize @sw_minimize @sw_restore @sw_show @sw_showdefault @sw_showmaximized @sw_showminimized @sw_showminnoactive @sw_showna @sw_shownoactivate @sw_shownormal @sw_unlock @systemdir @tab @tempdir @tray_id @trayiconflashing @trayiconvisible @username @userprofiledir @wday @windowsdir @workingdir @yday @year
sent={!} {#} {^} {{} {}} {+} {alt} {altdown} {altup} {appskey} {asc} {backspace} {break} {browser_back} {browser_favorites} {browser_forward} {browser_home} {browser_refresh} {browser_search} {browser_stop} {bs} {capslock} {ctrldown} {ctrlup} {del} {delete} {down} {end} {enter} {esc} {escape} {f1} {f10} {f11} {f12} {f2} {f3} {f4} {f5} {f6} {f7} {f8} {f9} {home} {ins} {insert} {lalt} {launch_app1} {launch_app2} {launch_mail} {launch_media} {lctrl} {left} {lshift} {lwin} {lwindown} {lwinup} {media_next} {media_play_pause} {media_prev} {media_stop} {numlock} {numpad0} {numpad1} {numpad2} {numpad3} {numpad4} {numpad5} {numpad6} {numpad7} {numpad8} {numpad9} {numpadadd} {numpaddiv} {numpaddot} {numpadenter} {numpadmult} {numpadsub} {oem_102} {pause} {pgdn} {pgup} {printscreen} {ralt} {rctrl} {right} {rshift} {rwin} {rwindown} {rwinup} {scrolllock} {shiftdown} {shiftup} {sleep} {space} {tab} {up} {volume_down} {volume_mute} {volume_up}
preprocessor=#ce #comments-end #comments-start #cs #include #include-once #notrayicon #onautoitstartregister #requireadmin
special=#endregion #forcedef #forceref #ignorefunc #pragma #region
expand=
udf=

[lexer_properties]
#settings for folding comment blocks and preprocessor lines
#lexer.au3.fold.comment=1
#lexer.au3.fold.compact=1
#lexer.au3.fold.preprocessor=0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We default to fold.compact=0, fold.comment=1 and fold.preprocessor=1 globally, and specifically set fold.comment.python=1 in Python filetype. For consistency, it would probably be good to enable lexer.au3.fold.comment=1 and lexer.au3.fold.preprocessor=1 by default, don't you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, scratch that; the lexer uses the unprefixed versions.
I'm not sure, but then, does these have any effect? Does Scintilla have a magic way of matching lexer prefixes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default fold.compact=1, LexAU3.cxx:

bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;

and I didn't change it.

I made ​​some changes, latest commit.


[settings]
# default extension used when saving files
extension=au3

# MIME type

# which characters should be skipped when moving (or included when deleting) to word boundaries
# should always include space and tab (\s\t)
whitespace_chars=\s\t!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~
# the following characters are these which a "word" can contains, see documentation
wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should generally stay commented out, unless it's very specific to the language. at least wordchars seem to be the generic one, so should stay out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b4n, ok.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, why are wordchars explicitly defined here? Still looks like the default, and a very common value

Copy link
Contributor Author

@Skif-off Skif-off Jun 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is very simple :) I did it the first time and I didn't want to miss anything (e.g.
# MIME type
too - it seems AutoIt doesn't have his type).


# single comments, like # in this file
comment_single=;
# multiline comments
comment_open=#cs
comment_close=#ce
# or alternatively
#comment_open=#comments-start
#comment_close=#comments-end

# set to false if a comment character/string should start at column 0 of a line, true uses any
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
#command_example();
# setting to false would generate this
# command_example();
# This setting works only for single line comments
comment_use_indent=true

# context action command (please see Geany's main documentation for details)
context_action_cmd=

[indentation]
#width=4
# 0 is spaces, 1 is tabs, 2 is tab & spaces
#type=1

[build_settings]
# %f will be replaced by the complete filename
# %e will be replaced by the filename without extension
# (use only one of it at one time)
compiler=C:\program files\autoit3\aut2exe\aut2exe.exe /in "%f"
run_cmd=C:\program files\autoit3\autoit3.exe "%f"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not generic at all, doesn't that autoit thing propose adding to the PATH, so you can use aut2exe and autoit3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@b4n, I checked it and forgot to fix, sorry.

1 change: 1 addition & 0 deletions data/filetype_extensions.conf
Expand Up @@ -8,6 +8,7 @@ ActionScript=*.as;
Ada=*.adb;*.ads;
Asciidoc=*.asciidoc;*.adoc;
ASM=*.asm;*.asm51;*.a51;
AutoIt=*.au3;
Batch=*.bat;*.cmd;*.nt;
CAML=*.ml;*.mli;
C=*.c;*.h;*.xpm;
Expand Down
1 change: 1 addition & 0 deletions scintilla/Makefile.am
Expand Up @@ -9,6 +9,7 @@ LEXER_SRCS= \
lexers/LexAbaqus.cxx \
lexers/LexAda.cxx \
lexers/LexAsm.cxx \
lexers/LexAU3.cxx \
lexers/LexBash.cxx \
lexers/LexBasic.cxx \
lexers/LexBatch.cxx \
Expand Down