RPTools.net

Discussion and Support

Skip to content

It is currently Sun Feb 18, 2018 4:09 am 






Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Fri Mar 27, 2009 6:34 am
Posts: 2
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Mon Jun 07, 2010 11:37 am 
aliasmask:

Thanks for the zip file! :)


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12111
Location: Tampa, FL
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Mon Jun 07, 2010 2:24 pm 
I've updated the vim syntax commands to fix some highlighting issues and I should package that stuff up and attach it here. I'll try to get to that one evening this week, but if anyone is really hot for it let me know.

The changes aren't anything major, but I noticed that some strings inside input statements cause highlighting to fail if there's not a space before the last close quote, for example.


Top
 Profile  
 
 Offline
Giant
 
Joined: Sat Apr 12, 2008 11:23 am
Posts: 100
Location: Latham, NY
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Sun Aug 01, 2010 10:03 pm 
Any word on that, Azhrei? I've been running with an older version for a while now, but the highlighting errors are starting to bug me. It sounds like the latest one that's been posted still has those issues?


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12111
Location: Tampa, FL
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Mon Aug 02, 2010 8:27 am 
I'll post my files some time this week.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Thu Nov 03, 2011 8:11 pm
Posts: 9
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Thu Dec 01, 2011 12:16 pm 
Is this VIM code still available? I'm not sure where is the correct place to look to download it. Thanks.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12111
Location: Tampa, FL
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Fri Dec 02, 2011 8:42 am 
Well, it looks like I've promised this twice. :( Instead of delaying further while I clean up the last few things and then package it up nicely, like Craig did, I'll just release the files themselves.

At some point (maybe tonight) I'll go back and release this as a set of patches. That way you'll be able to look at the patch and see exactly what I've changed.

Note that the syntax/ directory of the attached ZIP file has two files; the mtmacro.vim is the one that's used, the other is the original from Craig.

These files are from my ~/.vim/ directory so you'll need to put them wherever is appropriate for your platform. They do not contain any absolute pathnames so it shouldn't matter what directory you actually use as long as vim knows to look there.


File comment: Updated syntax files for vim (entire fileset included)
mtmacro-vim.zip [42.63 KiB]
Downloaded 94 times
Top
 Profile  
 
 Offline
Kobold
 
Joined: Thu Nov 03, 2011 8:11 pm
Posts: 9
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Fri Dec 02, 2011 1:03 pm 
Thanks! No trouble installing.

I do have a question however; a good deal of text in my macro's are displayed as errors (red background, white foreground). Any idea why this would be? Some I understand, like spaces at the end of a line. But there is a lot more than just that.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12111
Location: Tampa, FL
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Fri Dec 02, 2011 4:42 pm 
I'd have to see the code.

There is one problem that I know of with the Vim syntax file: any input function must have a space before the closing quote -- the one that comes after the options. For example, if it ends with ICON=TEXT" it won't display the syntax highlighting properly, but add a space in front of the double quote and it'll work. :(

I remember looking for the fix at some point in the past, but I don't know if I fixed it or not (I think I didn't for some reason).


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3496
Location: Austin, Tx
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Mon Mar 16, 2015 1:20 pm 
Updated OP fixing links and images and adding in Az's modifications. I'll add the b91 macro functions to the dropbox file as time allows and post here when a new file is available.

_________________
ImageImage ImageImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3496
Location: Austin, Tx
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Thu Mar 26, 2015 6:30 am 
This seems to give the GVIM plugin fits

[h:status=input(
"newType|"+types+"|Marker Type|LIST|SELECT="+index+" VALUE=STRING"
)]

It appears the the second = is escaping the preceding ". It restarts syntax highlighting on the ending ".

So I opened mtmacro.vim seeing if I could find the problem.

Code:
" Special string values
syntax match propSep /;/ contained
syntax match listSep /;/ contained
syntax match inputSep /|/ contained
syntax keyword inputText TEXT contained
syntax keyword inputList LIST contained
syntax keyword inputCheck CHECK contained
syntax keyword inputRadio RADIO contained
syntax keyword inputLabel LABEL contained
syntax keyword inputProps PROPS contained
syntax match inputWidth /WIDTH\s*=\s*\d\+/ contained
syntax match inputSelect /SELECT\s*=\s*\d\+/ contained
syntax match inputValue /VALUE\s*=\s*\S\+/ contained
syntax match inputText /TEXT\s*=\s*\(FALSE\|TRUE\)/ contained
syntax match inputIcon /ICON\s*=\s*\(FALSE\|TRUE\)/ contained
syntax match inputIconSize /ICONSIZE\s*=\s*\d\+/ contained
syntax match inputOrient /ORIENT\s*=\s*[HV]/ contained
syntax match inputSetVars /SETVARS\s*=\s*\(FALSE\|TRUE\)/ contained

syntax match macroLoc /\c[^"']\+@token/ contained
syntax match macroLoc /\c[^"']\+@campaign/ contained
syntax match macroLoc /\c[^"']\+@global/ contained
syntax match macroLoc /\c[^"']\+@lib:[^"']\+/ contained
syntax match macroLoc /\c[^"']\+@this/ contained


I see the VALUE= string but don't fully understand how it interacts with "s. Any thoughts? Am I looking in the wrong spot?

_________________
ImageImage ImageImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 8008
Location: Bay Area
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Thu Mar 26, 2015 9:00 am 
Avoid the problem?

Code:
[h:status=input(strformat(
"newType|%{types}|Marker Type|LIST|SELECT=%{index} VALUE=STRING"
))]

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3496
Location: Austin, Tx
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Thu Mar 26, 2015 9:11 am 
I didn't know you could do that. %{} embeds a variable in a string. Wow.
[Edit]
But that didn't fix it.

_________________
ImageImage ImageImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 8008
Location: Bay Area
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Thu Mar 26, 2015 9:19 am 
RPTroll wrote:
I didn't know you could do that. %{} embeds a variable in a string. Wow.
[Edit]
But that didn't fix it.


Only with strformat(). There's probably something in the vim definitions file that you can use to tell it to ignore = inside of quotes, assuming = has some other meaning to the parser. I'm unfamiliar with the editor though, so no help from me.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3496
Location: Austin, Tx
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Thu Mar 26, 2015 9:28 am 
So, I took out
Code:
syntax match input Value /VALUE\s*=\s*\S\+/ contained

and it stopped having the problem.

_________________
ImageImage ImageImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3496
Location: Austin, Tx
 Post subject: Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
PostPosted: Fri Mar 27, 2015 5:12 am 
I've placed the plugin files on github if anyone wants to contribute. Repository URL is https://github.com/rkathey/mtgvim.git

_________________
ImageImage ImageImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3

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 is 1 user online :: 0 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: No registered users and 1 guest





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

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman