• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A new TESH Syntax Highlighter for Warcraft 3

Level 2
Joined
Dec 31, 2011
Messages
12
Hm, I tried some korean chars in the old version and it doesn't seem to work... Can you post some chars you would like to be recognized?


[Try 1]
In old TESH :
I make new triggers like this. And I saved.

Trigger1:
attachment.php


Trigger2:
attachment.php



In new TESH :
I load the map(saved with old TESH).

Trigger1:
attachment.php


Trigger2:
attachment.php

The trigger is broken. Missing all scripts below the korean chars.



[Try 2]
I make a new trigger like this with new TESH.
attachment.php


It write is very well. but I go to other trigger, and I come back again.
attachment.php

The korean chars is broken.


Here is my scripts for test :
JASS:
/**************************************************
 * Block Comment Test
 * 가나다라마바사아자차카타파하
 **************************************************/
library Test
    // Line Comment Test
    // 가나다라마바사아자차카타파하
    private function TestFunction takes nothing returns nothing
    endfunction
endlibrary

And I attached my test map.

Thank you.
 

Attachments

  • new1.png
    new1.png
    1.5 KB · Views: 415
  • new2.png
    new2.png
    1.8 KB · Views: 458
  • new3.png
    new3.png
    10.5 KB · Views: 463
  • new4.png
    new4.png
    6.1 KB · Views: 406
  • old1.png
    old1.png
    7.4 KB · Views: 416
  • old2.png
    old2.png
    5.2 KB · Views: 408
  • comment test.w3m
    12.1 KB · Views: 118
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hi, thanks for the detailed description and the testmap, I will have a look at this.

I guess you have the korean version of the World Editor? Because in my version I can't copy/paste those chars even with no tesh at all (they are just translated to ? by the WE himself)...

Or can you somehow switch the language of the World Editor?
 
Level 2
Joined
Dec 31, 2011
Messages
12
Hi, thanks for the detailed description and the testmap, I will have a look at this.

I guess you have the korean version of the World Editor? Because in my version I can't copy/paste those chars even with no tesh at all (they are just translated to ? by the WE himself)...

Or can you somehow switch the language of the World Editor?

Hm.. Maybe because of my windows is for korean.
I don't know how to change language but I'll attach my worldedit.exe in my war3 directory.

I guess 2byte char problem is caused by "Character Set".
Could you check the Project's character set?
Project Properties > Configuration Properties > General and change the value of the Character Set property : Use Unicode Character Set

Thank you.


References :
http://stackoverflow.com/questions/9349342/about-the-character-set-option-in-visual-studio-2010
 

Attachments

  • Warcraft III.zip
    3.6 MB · Views: 328
Level 14
Joined
Dec 12, 2012
Messages
1,007
I guess 2byte char problem is caused by "Character Set".
Could you check the Project's character set?
Project Properties > Configuration Properties > General and change the value of the Character Set property : Use Unicode Character Set

Well, actually the project is already set up to use Unicode Character Set, so this is strange...

Could you please upload the old tesh you are using, which works correctly for you? I mean the folder of the old tesh which contains the old tesh dll and everything required by it, just zip it and upload it here please.

I need to check that one because there are many different versions of the old tesh out there and I must verify that its not a windows thing, so I need to have your version of the old tesh.
 
Level 2
Joined
Dec 31, 2011
Messages
12
Well, actually the project is already set up to use Unicode Character Set, so this is strange...

Could you please upload the old tesh you are using, which works correctly for you? I mean the folder of the old tesh which contains the old tesh dll and everything required by it, just zip it and upload it here please.

I need to check that one because there are many different versions of the old tesh out there and I must verify that its not a windows thing, so I need to have your version of the old tesh.

I'm using JNGP 2.06. This is from that.

Thank you.

Ps. I tested without TESH(without JNGP). 2 bytes character was not broken. so I think the textbox (or text check algorithm) of new TESH is cannot support 2 bytes character.
 

Attachments

  • tesh.zip
    1 MB · Views: 131
Level 3
Joined
Dec 30, 2010
Messages
53
He probably means Jass keywords like "function", "call", "return" etc. and types like "unit", "integer"...
There's no point it highlighting them it just makes it harder to read the rest of the code when the cursor is on one of them.
You should only highlight variable names.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hi,

Is there anyway to make this TESH work in something like Notepad++?

No, thats not possible.

Why? Because in Notepad++, a user-defined language is just a xml-document where you can specify the keywords/operators etc. of the language.

This TESH however doesn't even use the "standard" Scintilla library that is used by Notepad++, but a customized version. I had to modify various parts of the Scintilla Source Code to realize some features (like having the Autocomplete List and the Calltip List open at the same time or the semanic behaviour of the Autocomplete list for example). Also I don't even use xml to manage all the keywords, because I needed to attach aditional information to them to maximize performance and that was not possible with the default xml-Scheme which is required by tools like Notepad++.

But its really easy to add a new language to Notepad++, just create a xml document with all the keywords inside and you are basically done. You won't get the functionality provided by this TESH however.
 
Level 10
Joined
Sep 19, 2011
Messages
527
My suspect is that he wants to use TESH2 to implement the Wurst script inside it.

no no, that would be kinda silly having already something so powerful like eclipse xD.

what use would plugin support in Tesh give you?
the ability to extend functionality without having to touch/read the hole thing.

an example: plugin for specific library, where i can type and suggestions will pop up.
other example: multiple cursors.
example 3: attach funcionality to custom hotkeys (example: shift + del = delete current line).

etc.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
an example: plugin for specific library, where i can type and suggestions will pop up.

if I understand this correctly, this is like IntelliSense giving you hints about your own, nonstandard class. I think LFH said he would like to implement something like that at later point(so for instance working with Table you would get the methods etc, kind of prototype images can be seen in JNGP 2.0.x thread)

the other ones sounds good, but I think that could maybe be implemented into TESH as well
 
Level 3
Joined
Dec 30, 2010
Messages
53
If I try to open a second map (I've already opened a map and click on the "Open Map" icon world editor freezes.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
does this even belong to here? This doesnt really seem as TESH problem, more like JNGP problem, and also this shouldnt happen, when you try opening second map window should open that says your world editor is already running
 
Level 3
Joined
Dec 30, 2010
Messages
53
It only happens with TESH 2. Also I never said about opening a second world editor... I said when I open a second map in the world editor.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
the ability to extend functionality without having to touch/read the hole thing.

an example: plugin for specific library, where i can type and suggestions will pop up.
other example: multiple cursors.
example 3: attach funcionality to custom hotkeys (example: shift + del = delete current line).

etc.

Well you could already do that quite easily. Just create a dll named tesh.dll and let it load my tesh.dll so that both get loaded on startup of the editor. Then you can use the Scintilla API to extend the functionaliy with the code in your own dll while you wouldn't have to touch any of the tesh logic. Actually I kinda like the idea, so maybe I will add (some very simple) possiblity to make this process easier and support plug-ins after all. But I can't promise anything :D

But just out of curiosity, why would you like to have multiple cursors?

If I try to open a second map (I've already opened a map and click on the "Open Map" icon world editor freezes.

Thats strange, that never happend to me... Does this always happen when you try to open a second map? What version of JNGP are you using?
 
Level 3
Joined
Dec 30, 2010
Messages
53
Open JNGP (I'm assuming it opens a new empty map), go to trigger editor, Edit -> Convert to Custom Text, click the "Open map..." (the folder icon), cancel, on the trigger list click "Initialization" folder, or the "Untitled" and then click "Open map..." again. It freezes.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hm, I can't reproduce this even with your instructions... No matter what I do I never get a freeze...

Can you please tell me the following things:

  • Which version of windows are you using?
  • On which position is the "Open map..." option located in your menu? I guess on the second position of the "file"-menu, right?
  • What is the hotkey for the "Open map..." option in your Trigger Editor? I guess CTRL-O, right?
  • Does the problem also occure if you use CTRL-O (or whatever hotkey you use) or only if you hit the "Open map..." button?
  • On which language are you running the editor/windows?
  • When the problem happens, which window had the focus? The Scintilla Window or the Trigger Editor window?

Thanks in advance.
 
Level 3
Joined
Dec 30, 2010
Messages
53
  • Which version of windows are you using?
  • On which position is the "Open map..." option located in your menu? I guess on the second position of the "file"-menu, right?
  • What is the hotkey for the "Open map..." option in your Trigger Editor? I guess CTRL-O, right?
  • Does the problem also occure if you use CTRL-O (or whatever hotkey you use) or only if you hit the "Open map..." button?
  • On which language are you running the editor/windows?
  • When the problem happens, which window had the focus? The Scintilla Window or the Trigger Editor window?

  • Windows 7
  • Yes it's the second option of file menu
  • Yes it is CTRL-O
  • Either using File->Open, using the button on the toolbar or using ctrl+o shortcut result in a hang up
  • The editor is in English, windows are in Greek.
  • The trigger editor. As long as the Scintilla Window (you are talking about the subwindow of trigger editor that has the custom code right?) is on focus I can use "Open Map..." without any problems. But if the focus is somewhere else in the trigger editor, even if I simply put the cursor in the trigger comment area in a custom text trigger, the moment I invoke "Open Map..." the window freezes. If the focus is on a different module like the terrain editor or the object editor "Open Map..." works fine.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
So i was typing something and all of a sudden a window popped up

Error -

The text '1' is not a valid trigger name

and it completely froze WE (that dialog box render frozen in the frame)

(I literally just installed it like 15 seconds ago)

let me know if u need any other information

(although now that I think of it, I doubt this has anything to do with TESH...)

E/ its definitely TESH related. I accidently tried to save with the map open and it did the same thing
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
I didnt really install it yet, but I wonder if it correctly highlights keywords such as:

Yes.

So i was typing something and all of a sudden a window popped up

Error -

The text '1' is not a valid trigger name

and it completely froze WE (that dialog box render frozen in the frame)

Hm, this could be the thing that was causing the problems! I need to investigate this, thanks for the report.


let me know if u need any other information

Yes, please tell me which version/language your windows and your WE have. Also, your WE trigger window is "Trigger Editor", right?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
New Update available

This update mainly adresses the remaining bugs off the TESH, namely the crashing/freezing issues as wel as the problems with non-standard characters like korean or chinese characters. Those issues took quite some time to get fixed (especially the freezing), but now everything should work as intended.

Additionally, this update brings back the TESH Menu in the Trigger Editor, with some new functionality, namely commenting/uncommenting the current selection. Attached is a screenshot of the new menu.

sze4ummi.png



And here a fixlist:

Update to Version 0.8

- Fixed a bug that could cause the editor to freeze
- Added support for all localization dependend chars like chinese or korean chars
- Integrated the TESH Menu to the Trigger Editor
- Comment Selection/Uncomment Selection functionality is now available
 
Last edited:
Level 3
Joined
Dec 30, 2010
Messages
53
Unfortunately my warcraft editor still freezes if I try to open a map with the trigger editor in focus but not the tigger function edit box.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Your last post put me into thoughts and it seems like http://actualtools.com/windowmanager/ is the culprit.

Yes, this is very likely possible and would also explain why I can't reproduce the error. I have read about scintilla having issues with such programms.

Can you please try the following things:

  • Does the error still happen if you disable this window manager tool?
  • Does the error also happen with the old TESH?
 
Level 3
Joined
Dec 30, 2010
Messages
53
It doesn't hang up if I close it, and it doesn't hang up with the old TESH. For the time being I've added an exclusion for the WE window to stop the crash.

My guess is that it has to do with the way you hook into the WE windows, since AWM also tries to hook everywindow. If it was a problem with Scintilla wouldn't the old TESH have a problem too?
 
Level 3
Joined
Dec 30, 2010
Messages
53
There was a script that started with:
Code:
//TESH.scrollpos=223
//TESH.alwaysfold=0

After saving it transformed into:
Code:
?kh?[(crollpos=223
//TESH.alwaysfold=0

I can't reproduce it, but it has already happened twice, and another time the script vanished completely and was replaced with a 0.
No idea what could be causing this (I'm not even sure it has anything to do with TESH) but my guess is that it is related to the localization support change.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
New Update Available

This update brings a new feature, namely that each trigger now has its own, independent Undo history. So if a trigger is now modified, deselected and selected again, the Undo history of this trigger is still available, making the illusion of a native editor almost perfect.

Furthermore, the issue that the Hook.dll caused the editor to crash if Window Manager programs were used in combination with the TESH is also fixed now. A smaller enhancement is, that weathereffect char-keys are now also included to the char specific autocomplete list. Attached is a screenshot showing the new weathereffect icon.

bvfh6qkb.png



Finally, the TESH menu got improved further by adding more functionality. It contains now options to convert all tabs of the current selection to spaces and vice versa, as well as conversion to upper- and lowercase. Also several new trigger templates were added to the menu to make system or testing/benchmarking creation easier.

ek6jlxdo.png



And here a full change list:

Update to Version 0.8.5
- Each trigger has now an independent Undo history
- Fixed a bug that could cause a crash in combination with window manager programs
- Added Conversion to upper/lower case to the TESH Menu
- Added Conversion from Spaces to Tabs and from Tabs to Spaces to the TESH Menu
- Added new trigger templates to the TESH Menu, e.g. for scope with timer
- Added weathereffect rawcodes to the the char-specific autocomplete list
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
The idea in regard to "inits" is nice and all, tho if you really want to do this, then you have to implement more options like: struct init with timer and so on. It's not like we use init-timer just within scopes :)

Also, switching the "inits" options overwrites everything, even the code that has been previously implemented. Meaby there could be a possibility to "append" inits instead of overwritting?
Anyway, TESH2 owns.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Imho if you really want templates then probably you could organize them in tree form:

JASS:
Templates
   Initializers
       Library
           func initializer
           func initializer + timer
       Scope
           func initializer
           func initializer + timer
       Struct
           method onInit
           method onInit + timer
       Module
           method onInit
           method onInit + timer
    Structs
        array struct
            spell - create / destroy / callback
            basic - create / destroy
            static struct
        generic struct
            spell - callback
You could provide additional window when e.g struct menu option is clicked: "Provide your type name:", thus your template would append base code with already added type name.

It's hard to decide what should/should not be added since everyone seems to have different style - we are not an organization or team i.e we don't have someone in charge that sets some general rules of how to write / name / syntax our code. Bribe's JPAG describes most of general things, yet a) decision is still up to user b) there is ton of stuff that it doesn't stadarize e.g doesn't enforce module inits naming -> "init" or <struct type> + "Init"? Why do I mentioned that? Because someone who likes the second version (like me, I like to know the struct type my module init is going to be implemented to) may be discouraged to use your templates just because it's called "init".

And yes, lol, ppl might be pedantic and care about such things.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Imho if you really want templates then probably you could organize them in tree form:

Yeah, that a treeform like that is maybe the best solution, I will think a bit more about that. However, I'm not sure about the appending of those templates to current source code. The main purpose to use those templates is that when you write a new library/struct, you don't have to rewrite the basics of such a library like initializers. If you already have Source Code in your current trigger, you will most likely already have setup such things before, making the use of such a template quite useless.

Wow this is getting really good progress wise.

I just gotta throw some more rep your, way :p keep it up.

Thanks :)
I'm confident that within the next months I can finally release version 1.0, although before there might be some more updates.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
It's not like some systems doesn't use 2x module initializer cuz those might implement multiple strucy types instead of just one. As of now, I can not write two inits without overwritting the first one.

Yes thats right, but its not possible to provide templates for every special situation that might occur anyway, at least not with a reasonable amount of templates. The templates should just provide a fast way to load a common code configuration on trigger creation (because the default one which you get by converting GUI is really bad), and are not meant to extend existing code.

Because if you start something like this, the possible combinations grow exponentially. You then can add library with struct init, with module init, with timer and struct init, with timer and module init, with two struct inits, with two struct inits and timer, with two module inits, two module inits and timer, one module init and one struct init, one module init and one struct init with timer, and so on. Same for scope, same for everything again but not within a library (struct without library) and so on. No one will be able to overlook that amount of templates.

Realizing all this combinations will make the tree (and therfore the template menu) unreasonably huge and it might take more time to navigate to the correct template than just typing out everything.

And if you really are about to design a system with 2 module initializers (which is quite rare), you can do this very easily by just loading the one-initializer template and copy/paste the initializer. This is still much faster than writing everything by hand.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Downloading latest version. Congrats on the release, LFH.

Thanks :)

Is it possible to provide the code open-source, or at least keep version history in the original post?

I added a version history to the original post with links to the all the corresponding updates.

I will publish the source code some day, but not in near future because without a proper documentation it is pretty much not useable.
 
Top