RPTools.net

Discussion and Support

Skip to content

It is currently Mon May 20, 2013 12:48 am 






Reply to topic  [ 10 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Cave Troll
 
Joined: Wed Oct 12, 2011 1:28 am
Posts: 78
 Post subject: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 3:54 am 
I found a plugin for notepad++ to allow code completion, called WebEdit. I've modified the config for some of the common macro language constructs.

To find out how to install, config, and use see http://www.addictivetips.com/windows-tips/webedit-use-text-expansion-integrate-code-snippets-into-notepad/.

All I did was replace the existing Tags section with my own. To use, just follow the instructions at the web site. Then copy existing [Tags] section with what's in the file. You want to tweak them to suit your style and preference.

Code:
[Tags]
; Tags are replaced with their Replacement when you select the
; "WebEdit\Replace Tag" menu item (Alt+Enter by default).
; Syntax: <Tag>=<Replacement>
; Tags can contain characters a-z, A-Z, 0-9. Maximum length of a tag is 32
; characters. The number of Tags is not limited. The pipe character "|" marks
; the caret position after the tag replacement.
; Known escape sequences:
; \c = system clipboard contents
; \i = indentation
; \n = new line
; \t = tab character
; \| = |
; \\ = \
md=@@ @|\n@PROPS@ fontColor=black;autoExecute=true;fontSize=1.00em;sortBy=1;color=default;playerEditable=false;applyToSelected=false;group=Group;tooltip=;minWidth=
mc=[H, macro("|"): ""]
ja=json.append("", |, )
jc=json.contains(|, )
jf=json.fields(|)
jfl=json.fromList(|)
jg=json.get(|, )
ji=json.isEmpty(|)
jl=json.length(|)
jm=json.merge(|, )
js=json.set(|, )
jtl=json.toList(|)
iff=[H: if(| == , "", "")]
ifr=[H, if(| == ): ;]
ifc=[H, if(| == ), code: {\n\n};{\n}]
ifce=[H, if(| == ), code: {\n\n};{\n\n}]
sw=[H, switch(|):\ncase : ;\ndefault: ]
swc=[H, switch(|), code:\ncase:\n{\n\n};\ndefault:\n{\n}]
co=[count(|): ]
wh=[while(|): ]
whc=[while(|), code:\n{\n\n}]
f=[H, for(|, , ): ]
fe=[H, foreach(|, , ): ]
fec=[H, foreach(|, , ), code:\n{\n\n}]
cmt=[H: '<!-- | -->']



Also feel free to add more.

Updated 2012-01-30.
Fix: swc generated an invalided case statement'
Added: cmt for comment

_________________
My Stuff:
-- Easy navigation Maptool macro function doc
-- Bracket Checker
-- Notepad++ code completion for maptool macro language


Ramblings of a Dead Marshal: http://louis-davout.blogspot.com/


Last edited by davout on Mon Jan 30, 2012 12:38 am, edited 1 time in total.

Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 5488
Location: Netherlands
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 4:46 am 
how is this different from Alias' plugin?

_________________
My stuff
Excel Tools: Table editor and Illumination Generator
MT Tools: Dungeon Builder Tool, Bag of Tricks: Teleport pads, Pits, Traps and Warded Areas and onMouseOverEvent
Framework: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade and Only War
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow

My dropbox referral. If you use this then both you and me get 500Mb extra space. 2.5Gb total.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 5303
Location: Bay Area
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:05 am 
Nice find.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Wed Oct 12, 2011 1:28 am
Posts: 78
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:07 am 
wolph42 wrote:
how is this different from Alias' plugin?


Head smack! I have his userDefineLang.xml but not the others. I have to take a look to see the difference.

With this one enter a couple letters hit Alt-Enter and the letters are replaced with code.

examples:
Code:
jc produces json.contains(|, )

ifc produces [H, if(| == ), code: {

};{

}]

_________________
My Stuff:
-- Easy navigation Maptool macro function doc
-- Bracket Checker
-- Notepad++ code completion for maptool macro language


Ramblings of a Dead Marshal: http://louis-davout.blogspot.com/


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Wed Oct 12, 2011 1:28 am
Posts: 78
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:18 am 
I took a look. And well crap :x

I like Aliasmak's function complete better.

Aliasmak, does your plugin create if() or foreach structures?

_________________
My Stuff:
-- Easy navigation Maptool macro function doc
-- Bracket Checker
-- Notepad++ code completion for maptool macro language


Ramblings of a Dead Marshal: http://louis-davout.blogspot.com/


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 5303
Location: Bay Area
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:32 am 
The difference is these are auto-filll aliases, while the other keywords and function only give a tooltip to show proper format and description.

It may be my settings or language selection, but I can't get the Alt-Enter combo to do the auto complete for me.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 5303
Location: Bay Area
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:33 am 
davout wrote:
I took a look. And well crap :x

I like Aliasmak's function complete better.

Aliasmak, does your plugin create if() or foreach structures?

No, but I'll look in to it.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Wed Oct 12, 2011 1:28 am
Posts: 78
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:37 am 
aliasmask wrote:
davout wrote:
I took a look. And well crap :x

I like Aliasmak's function complete better.

Aliasmak, does your plugin create if() or foreach structures?

No, but I'll look in to it.


Well then my work may not be complete waste of time.

_________________
My Stuff:
-- Easy navigation Maptool macro function doc
-- Bracket Checker
-- Notepad++ code completion for maptool macro language


Ramblings of a Dead Marshal: http://louis-davout.blogspot.com/


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 5303
Location: Bay Area
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 5:47 am 
Oops. Pressing wrong command key.

Works fine in conjunction with the other function auto complete, which doesn't include roll options. This goes great for doing that. I'll probably add instructions for installing with MT relevant code and commands.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Cave Troll
 
Joined: Wed Oct 12, 2011 1:28 am
Posts: 78
 Post subject: Re: Notepad++ code completion for maptool macro language
PostPosted: Fri Jan 20, 2012 6:51 am 
aliasmask wrote:
Oops. Pressing wrong command key.

Works fine in conjunction with the other function auto complete, which doesn't include roll options. This goes great for doing that. I'll probably add instructions for installing with MT relevant code and commands.


Cool. Thanks.

_________________
My Stuff:
-- Easy navigation Maptool macro function doc
-- Bracket Checker
-- Notepad++ code completion for maptool macro language


Ramblings of a Dead Marshal: http://louis-davout.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 10 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 1 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: Google [Bot] and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman