MapTool Macros Vim Syntax Hilight/Completion/Doc
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
aliasmask:
Thanks for the zip file!
Thanks for the zip file!
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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.
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.
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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?
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
I'll post my files some time this week.
-
- Kobold
- Posts: 9
- Joined: Thu Nov 03, 2011 9:11 pm
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
Is this VIM code still available? I'm not sure where is the correct place to look to download it. Thanks.
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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.
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.
- Attachments
-
- mtmacro-vim.zip
- Updated syntax files for vim (entire fileset included)
- (42.63 KiB) Downloaded 169 times
-
- Kobold
- Posts: 9
- Joined: Thu Nov 03, 2011 9:11 pm
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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.
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.
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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).
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).
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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.
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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.
I see the VALUE= string but don't fully understand how it interacts with "s. Any thoughts? Am I looking in the wrong spot?
[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: Select all
" 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
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
Avoid the problem?
Code: Select all
[h:status=input(strformat(
"newType|%{types}|Marker Type|LIST|SELECT=%{index} VALUE=STRING"
))]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
I didn't know you could do that. %{} embeds a variable in a string. Wow.
[Edit]
But that didn't fix it.
[Edit]
But that didn't fix it.
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
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.RPTroll wrote:I didn't know you could do that. %{} embeds a variable in a string. Wow.
[Edit]
But that didn't fix it.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
So, I took out
and it stopped having the problem.
Code: Select all
syntax match input Value /VALUE\s*=\s*\S\+/ contained
Re: MapTool Macros Vim Syntax Hilight/Completion/Doc
I've placed the plugin files on github if anyone wants to contribute. Repository URL is https://github.com/rkathey/mtgvim.git