Adventure - General-Purpose IDE, Lightweight Text Editor

Open source general-purpose IDE, lightweight text editor. Previously known as AutoGUI.
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

11 May 2021, 20:06

@boiler
One of the new features of Adventure that can come in handy in the situation you described is multiple selection (Options > Enable Multiple Selection). Hold the Ctrl key and double-click the variables, one by one, from a section of the code and copy them all at once to be pasted elsewhere.

@kczx3
kczx3 wrote:
03 May 2021, 10:08
Actually... My Tools menu is empty. Are all the included Tools not automatically added here?
Most of the tools included with Adventure are relevant to AutoHotkey only. And that's why the Tools menu is initially empty. For a preset of tools, rename the file AHK-Tools.xml to Tools.xml.

@joedf
Thanks, Joe!

@oldbrother
The GUI designer is no longer directly integrated with the IDE. It became a separate tool, which can be found in the Tools folder.

@autohost
Maybe soon. I have to do some tests to determine exactly what needs to be adapted.

@lexikos
lexikos wrote:
08 May 2021, 06:38
The code pane flickers very noticeably when I resize the window. This appears to be easily fixed by adding the WS_CLIPCHILDREN style (option +0x2000000) to the main GUI.
Thanks for pointing that out!
lexikos wrote:
08 May 2021, 06:38
The Find in Files tool refuses to run if A_ScreenDPI != 96.
I will fix that for the next release of Adventure. I was actually planning to completely redesign the user interface of Find in Files and add more functionality when I noticed that such task would demand a considerable amount of time, delaying even more the publication of the current release.
User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

11 May 2021, 20:16

Alguimist wrote: One of the new features of Adventure that can come in handy in the situation you described is multiple selection (Options > Enable Multiple Selection). Hold the Ctrl key and double-click the variables, one by one, from a section of the code and copy them all at once to be pasted elsewhere.
That does sound like a very useful feature. Thanks for pointing that out. Perhaps that and the many other features it has will have me not missing multiple panes (but it's still on my wish list :D).
User avatar
kunkel321
Posts: 969
Joined: 30 Nov 2015, 21:19

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

04 Jun 2021, 15:05

Hi Alguimist, Thanks for making this and for sharing it! The new Adventure is a real beauty!

A question for you or others:
-Is it possible to "import" the old AHK tools? Or an easy way to add them in bulk to the Tools menu (like AutoGUI had)? I'm sure it would only take me 5 minutes to add them using the Tools Manager. Thought I'd make sure there's not already a better way to add them, though.

EDIT 6-5-2021. I manually added a couple. They work fine, but I had to copy AutoHotkey.exe into each of the tools' subfolders and rename it as the tool "A_Variables.exe" etc. Of course now they don't have the associated icons like they do in the menu of AutoGUI, so that's a shame. I'm not sure if it is relevant, but I'm using portable versions of all my AHK stuff.
ste(phen|ve) kunkel
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

24 Jun 2021, 13:05

How can I make the editor automatically load my session from exit upon startup? Currently, I have to manually go to the Sessions menu to do this.
User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 12:45

kczx3 wrote: How can I make the editor automatically load my session from exit upon startup? Currently, I have to manually go to the Sessions menu to do this.
Did you enable this option? Options > On Exit > Remember Session
User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 13:18

@Alguimist - I discovered an issue with AHK syntax highlighting in Adventure. It occurs when a line is an expression whose first character is an open parenthesis, like in the script below that takes advantage of the short-circuit Boolean evaluation of the && operator (to act as a shorthand if statement):

Code: Select all

(WinExist("ahk_exe notepad.exe") && NotepadOpenOnScriptStart := 1)
return

#If NotepadOpenOnScriptStart
F1::WinActivate, ahk_exe notepad.exe

You can see the difference in how it is highlighted when that first line is commented out or not:
Image


The above is a contrived example. The issue was discovered when viewing teadrinker's script in this post in Adventure. It kills the highlighting for most of the script.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 14:08

boiler wrote:
08 Jul 2021, 12:45
Did you enable this option? Options > On Exit > Remember Session
Yep, that's enabled. And my session is definitely saved upon Exit. The problem is when I startup Adventure, the window starts blank. I want it to automatically load my session that was saved on Exit.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 14:22

boiler wrote:
08 Jul 2021, 13:18
@Alguimist - I discovered an issue with AHK syntax highlighting in Adventure. It occurs when a line is an expression whose first character is an open parenthesis, like in the script below that takes advantage of the short-circuit Boolean evaluation of the && operator (to act as a shorthand if statement):

Code: Select all

(WinExist("ahk_exe notepad.exe") && NotepadOpenOnScriptStart := 1)
return

#If NotepadOpenOnScriptStart
F1::WinActivate, ahk_exe notepad.exe

You can see the difference in how it is highlighted when that first line is commented out or not:
Image


The above is a contrived example. The issue was discovered when viewing teadrinker's script in this post in Adventure. It kills the highlighting for most of the script.
That's not a new issue. Alguimist uses the version of Scintilla built by RaptorX that has a lexer for AHK. This can be found here - https://github.com/RaptorX/LexAHKL
If you look at https://github.com/RaptorX/LexAHKL/blob/102ae22ac64d114622ac3dab190483b3e7b89f04/scintilla/lexers/LexAHKL.cxx#L649 I think that is where it marks a line containing only spaces and an open parenthesis that it sets the state to SCE_AHKL_STRINGOPTS which is used for continuation section flags.
User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 15:48

kczx3 wrote: Yep, that's enabled. And my session is definitely saved upon Exit. The problem is when I startup Adventure, the window starts blank. I want it to automatically load my session that was saved on Exit.
Hmm. Mine does automatically load my session that was saved on exit. I would check that your settings are getting updated as they should in the FileHistory.xml file, including something like this:

Code: Select all

	<recent items="2|3|4|5|6|7|8|1|9"/>
	<sessions>
		<session name="Session Saved on Exit" items="1|9" active="2"/>
	</sessions>
User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 15:53

kczx3 wrote: That's not a new issue. Alguimist uses the version of Scintilla built by RaptorX that has a lexer for AHK. This can be found here - https://github.com/RaptorX/LexAHKL
If you look at https://github.com/RaptorX/LexAHKL/blob/102ae22ac64d114622ac3dab190483b3e7b89f04/scintilla/lexers/LexAHKL.cxx#L649 I think that is where it marks a line containing only spaces and an open parenthesis that it sets the state to SCE_AHKL_STRINGOPTS which is used for continuation section flags.
OK. I'm not sure if that means either of them has fixing it on their to-do list. Other editors handle it correctly, so I would think they would want to get their lexer to handle it as well. Not a big deal for me, but I just wanted to point it out since I ran across it.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

08 Jul 2021, 18:29

I know Alguimist has mentioned rewriting the lexer before but it’s not a simple task as it is written in c++. And Scintilla 5 has a new way of providing lexers though I don’t recall if they can be written in other languages or not.

Edit: Lever -> lexer
Last edited by kczx3 on 09 Jul 2021, 07:56, edited 1 time in total.
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 04:09

@kczx3
I believe it could be done in any language that can create an ILexer5 object and pass it to SCI_SETILEXER, including AutoHotkey. As with COM, the object is just a struct starting with a pointer to a "virtual function table" (an array of function pointers in a specific order). Passing the object means passing the address of the struct (the address of the address of the v-table).

However, it was already possible to create a container lexer in any language that can host the Scintilla control. I wrote one in 2012, but it ran on AutoHotkey v2-alpha, which has changed a lot since then (and I didn't share it).

There's also Scintillua, which I use with SciTE on a regular basis, but I'm not sure that my lexers work with the latest version of Scintillua (for Scintilla 5). I think it is considerably easier and less tedious to write an LPEG based lexer and keep it up to date, as it is more like describing the syntax than writing code to parse it.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 08:10

Makes sense. I know that @TheArkive has worked with the container lexer a bit.
I hadn't read up on Scintillua and don't know Lua at all. It seems that enabling that in Scintilla requires you to build it manually from what I read. I can certainly see how the LPEG versions would be easier to write and understand than a full parser. It'd be great to have a fresh lexer for the official 2.0 release.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 08:20

boiler wrote:
08 Jul 2021, 15:48
Hmm. Mine does automatically load my session that was saved on exit. I would check that your settings are getting updated as they should in the FileHistory.xml file, including something like this:
Not sure what was going on. The FileHistory.xml file looked fine to me. I checked my Adventure.ini file and the LoadLastSession was set to 0 however in Adventure under Options > On Exit, I had Remember Session checked. I unchecked it and then checked it, then closed Adventure. Inspecting Adventure.ini again now properly showed

Code: Select all

[Options]
LastSessionName=Session Saved on Exit
LoadLastSession=1
RememberSession=1
So it is working now. Strange!
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 08:24

Actually I haven't done any work with the lexer yet :P ... Only messing with all the bells and whistles in the Scintilla control.

I did manage to accomplish the example that lexikos linked. It's fairly straight forward, until you get into handling multi-byte characters :P

It's still on my To-Do list to create a framework that's easier to populate a lexer in this way.

EDIT: If someone beats me to it, I won't complain!
User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 08:52

kczx3 wrote:
09 Jul 2021, 08:20
Not sure what was going on. The FileHistory.xml file looked fine to me. I checked my Adventure.ini file and the LoadLastSession was set to 0 however in Adventure under Options > On Exit, I had Remember Session checked. I unchecked it and then checked it, then closed Adventure. Inspecting Adventure.ini again now properly showed

So it is working now. Strange!
One time mine didn’t load the last session after Windows shut Adventure down when it performed a restart on its own ( :x ), so maybe Adventure needs to be closed down conventionally in order for it to set itself to restart correctly. That might not have been your case, but maybe something like that causes it to not leave a 1 in the LoadLastSession setting.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 08:59

boiler wrote:
09 Jul 2021, 08:52
One time mine didn’t load the last session after Windows shut Adventure down when it performed a restart on its own ( :x )
I've started using my OnExit() event to write script data to disk. That should take care of unexpected shutdowns prompted by the OS.
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

09 Jul 2021, 18:56

kczx3 wrote:
09 Jul 2021, 08:10
It seems that enabling that in Scintilla requires you to build it manually from what I read.
Feature #1 of Scintillua is "Drop-in installation in most Scintilla environments – no modifications to Scintilla are necessary."

However, "Scintillua requires Scintilla 4.4.5 or greater for a drop-in installation". I think the Scintilla version requirement has changed since I started using it, because I'm sure I did a "drop-in installation" with SciTE 3.5.1. That might be an issue for Adventure. I have no idea how much work it would be to update Scintilla.
It'd be great to have a fresh lexer for the official 2.0 release.
My LPEG lexers (linked in my last post) are fairly up to date, but maybe not fully as I only update them when I notice an issue. Also, I hadn't bothered to commit any changes to git for the last three years, so I've just pushed an update.

If you want to try to use it with Adventure (without updating Scintilla), you'll probably need to find (or build) an older version of Scintillua (the files I have are dated 2016-10-16). Unfortunately the original website appears to have been taken down, and GitHub only has Scintillua binaries for Scintilla 4.4.5 and later.

I considered writing a new lexer that can be more easily used for any Scintilla-based projects and existing programs, but I wouldn't be satisfied with anything less accurate than what I already have, and that would be a lot of work. I've also recently been using VSCode, which is obviously not Scintilla-based, and does a bunch of things so well that I've pretty much abandoned any plan to make my own editor. Then there are other ideas; if the actual AutoHotkey parser can be redesigned to be reusable for highlighting (and static analysis) without a loss of efficiency, it might be better for me to do that.
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

10 Jul 2021, 14:32

kunkel321 wrote:Is it possible to "import" the old AHK tools?
As already stated on the top of this page and in the documentation: "For a preset of tools, rename the file AHK-Tools.xml to Tools.xml".
kczx3 wrote:How can I make the editor automatically load my session from exit upon startup? Currently, I have to manually go to the Sessions menu to do this.
Aside from the option "Remember Session", you also have to make sure that "Session Saved on Exit" is defined as the startup session: Sessions > Manage Sessions... > Settings. Adventure does not necessarily load on startup the session automatically saved when the program is closed.
boiler wrote:I discovered an issue with AHK syntax highlighting in Adventure...
I've noticed that the AHK lexer is fairly complex compared to the lexer of other programming languages. While the AHK lexer lacks the "operator" identifier (of low relevance to syntax styling), others lack the "function" identifier (highly relevant). I'm planning to add new categories of keywords to the lexers that have insufficient groups of keywords, such as Pascal, Python and Ruby, and then I will take some time to examine in details the minor bugs that affect the AHK lexer.

Edit: grammar.
Last edited by Alguimist on 10 Jul 2021, 21:41, edited 1 time in total.
User avatar
kczx3
Posts: 1640
Joined: 06 Oct 2015, 21:39

Re: Adventure - General-Purpose IDE, Lightweight Text Editor

10 Jul 2021, 20:45

lexikos wrote:
09 Jul 2021, 18:56
I've also recently been using VSCode, which is obviously not Scintilla-based, and does a bunch of things so well that I've pretty much abandoned any plan to make my own editor.
Interesting. I use VSCode a lot in my day to day work. I have used it for AHK but honestly, I have never really enjoyed coding AHK in it. For some reason, I really prefer a near instant startup time when opening an editor to work on a script for AHK. And I've found that an editor like Adventure with the toolbar really lends itself well to AHK usage and development. VSCode doesn't really have much of a toolbar. It is possible this all stems from AHK being my first language I learned and working in Notepad++ then.

It has also been difficult to get good tooling for AHKv2 for obvious reasons.

Return to “Adventure IDE”

Who is online

Users browsing this forum: No registered users and 29 guests