Friday, May 24, 2013

Re: problem with perl snips in xptemplate plugin

On Friday, May 24, 2013 4:33:46 PM UTC-5, KKde wrote:
> Hi,
>
> Is anyone using xptemplate plugin? If yes anyone has problem with snips for perl filetype?
>
> when I trigger any snippet defined for perl I get the below error
>
> Error detected while processing function XPPprocess..5..<SNR>45_DoStart..<SNR>45_RenderSnippet..<SNR>45_NewRenderContext..XPT#classNew..<SNR>35_New:
> E713: Cannot use empty key for Dictionary
>
> I enabled verbose setting and tried to debug. But I find tracing problem is hard in vim(i'm not expert in vim script.
>
> Note: For other file types i'm not having this problem. They are working fine.
>
> PS: I see xptemplate google group is inactive and hence asking the question here?

After setting verbose > 13, I found the issue.

code is having issue at this point

let indentkeysList = split( &indentkeys, ',' )
call filter( indentkeysList, 'v:val=~''\V\^0''' )
for k in indentkeysList
if k[ 1 ] == '='
let self.oriIndentkeys[ k[ 2: ] ] = 1
else
let self.leadingCharToReindent[ k[ 1: ] ] = 1
endif
endfor

For, perl language the indentkeys is set to 0{,0},:,0#,!^F,o,O,e,0=,0),0],0=or,0=and

and the expression 0= is causing problem. I fixed this problematic code using
if strlen(k) > 2
let self.oriIndentkeys[ k[ 2: ] ] = 1
endif

Question is, Is indentkeys 0= is meaningful?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: