maestrith / AHK-Studio

Created with AHK Studio
http://www.maestrith.com
363 stars 68 forks source link

Indents after commands #148

Closed derz00 closed 6 years ago

derz00 commented 6 years ago

AHK Studio Beta automatically indents the next line after entering a command, etc (after which you wouldn't normally indent) when the file extension is different than .ahk (But it is in my personal extensions list)

maestrith commented 6 years ago

What sort of file, and what command?

maestrith commented 6 years ago

Also if you could include the file that would be great.

derz00 commented 6 years ago

I have been using .ahk2 to allow for running both versions of AutoHotkey. Attached is a test file. test.txt

You're evidently online 👍

maestrith commented 6 years ago

And you didn't create a ahk2.xml file? Just so we are on the same page

derz00 commented 6 years ago

No, I wouldn't be that smart :)

maestrith commented 6 years ago

aww, don't say that. I'll make a bit of a tutorial on how to make one....eventually.

Anyway, I'll look into it.

maestrith commented 6 years ago

oh wow...yea, that's not good. I will see what I can do.

derz00 commented 6 years ago

Thank you. Do I open a Github issue for every problem like this I have with Studio? Or where can I ask you simple questions?

maestrith commented 6 years ago

I put in a quick fix. Force an update if it doesn't say there is one....which it probably won't. I'll push an official update when I get a few more things fixed up.

derz00 commented 6 years ago

Uh, yes, there was an update, but it didn't change the version number (1.005.00). There wasn't an update there when I told it to check a couple days ago. And, yes, now the indent seems to work (doing further testing)

derz00 commented 6 years ago

No, it doesn't quite work. It doesn't indent at all now, for example after if loop etc .ahk files still work

maestrith commented 6 years ago

I don't always change the version numbers. If it does not show "No new updates" (or whatever I put in there I honestly can't remember) then the code has been updated.

maestrith commented 6 years ago

Right, if there isn't a control file for the file type, like .txt or .ahk2, it will not know that anything needs indented. I am changing Studio to work with multiple languages. Do you call the files .ahk2 ? Edit: duh, you said you did. OK, I'll tell you what to do

Close Studio

  1. Look for the file AHK-Studio Directory\Lib\Languages\ahk.xml
  2. Copy that file and call it something like ahk2.xml
  3. Change the line <FileTypes lexer="ahk" language="ahk" name="AutoHotkey">ahk</FileTypes> to <FileTypes lexer="ahk" language="ahk2" name="AutoHotkey2">ahk2</FileTypes> You can add whatever file types you want to work like ahk2 by adding them space delimited in <FileTypes lexer="ahk" language="ahk" name="AutoHotkey2">ahk2 txt whatever</FileTypes> OR! Edit the line in ahk.xml <FileTypes lexer="ahk" language="ahk" name="AutoHotkey">ahk ahk2</FileTypes>
derz00 commented 6 years ago

Would the last line be more like this, with ahk2? (to clarify what you say) Sorry, but I feel insecure with this yet, and didn't want to get confused. <FileTypes lexer="ahk" language="ahk" name="AutoHotkey2">ahk2 txt whatever</FileTypes>

uh, I see the latest edit now 😛

derz00 commented 6 years ago

I think I will make a ahk2.xml to tweak syntax, etc

maestrith commented 6 years ago

<FileTypes lexer="ahk" language="ahk" name="AutoHotkey2">ahk2 txt</FileTypes> That should work if you want .txt to work the same as .ahk2 files. I think that is a great idea :)

derz00 commented 6 years ago

Did you make ahk.xml all by hand or could you automate it with data from the documentation?

maestrith commented 6 years ago

a little bit of both to be honest. I had to write something to build the syntax and the area was something I had to write completely by hand. was also something I have been working on for a few years to get "right"

derz00 commented 6 years ago

I am having problems with editing the theme. Does it work for you in beta? Changes are inneffective...

maestrith commented 6 years ago

which things in theme are you trying to change?

derz00 commented 6 years ago

matching braces, and variables colour. I click on it, change it, but the examples in the theme do not change, and clicking them again, the settings are back to the original.

maestrith commented 6 years ago

is this for .ahk files or .ahk2?

derz00 commented 6 years ago

I didn't know there is a difference? It behaves the same when either of the two is the selected script

derz00 commented 6 years ago

Where's the next best place to talk to you besides Discord or opening GitHub issues? ;)

maestrith commented 6 years ago

Up to you, I'm on Discord right now but you let me know where would be the best place to chat about this.

derz00 commented 6 years ago

ahk irc is easiest for me to grab right now. Otherwise forum PM (not instant though