Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Error while '\vf' to create a new viki

  • Tom Link
    Tom Link

    May I kindly ask you to describe the error? What steps would I have to follow in order to reproduce the problem?

  • bybor

    excuse me not giving enough details

    in viki file i enter this text

    Trying to Ctrl+Enter or '\vf' brings this message

    Error detected while processing function viki#MaybeFollowLink..<SNR>65_FollowLink..<SNR>65_OpenLink..VikiOpenSpecialProtocol..viki#ExecExternal:
    Line 2:
    E10: \ should be followed by /, ? or &
    Error detected while processing function viki#MaybeFollowLink..<SNR>65_FollowLink:
    Line 29:
    E171: Missing :endif
    Error detected while processing function viki#MaybeFollowLink:
    line 8:
    E171: Missing :endif

    Buffer isn't dirty, so it has nothing to do with g:vikiHide

    Sorry for not putting all info at first post.
    Don't known how to save :messages output, had to type it

  • Tom Link
    Tom Link

    Could you please post the output of:

          echo g:vikiOpenUrlWith_ANY
          function VikiOpenSpecialProtocol

    You don't have a variable g:vikiOpenUrlWith_http defined?

    It could also be interesting to see the output after redefining VikiOpenSpecialProtocol() and then typing \vf again:

        function! VikiOpenSpecialProtocol(url)
            echom a:url

    I assume though that the problem is the definition of g:vikiOpenUrlWith_ANY Which OS/desktop environment do you use?

  • Tom Link
    Tom Link

    You can redirect the output of messages to a variable with :redir or save the output to a file by temporarily setting 'verbosefile' (in the latter case I'd suggest to run the whole thing with verbose=12 and send me the whole thing via mail).

  • bybor

    1. exec 'silent !rundll32 url.dll,FileProtocolHandler '. shellescape('%{URL}')
    `   function VikiOpenSpecialProtocol(url)`
    `1          " TLogVAR a:url`
    `2          " TLogVAR a:url`
    `3          let proto = tolower(matchstr(a:url, '\c^\{-}\ze:'))`
    `4          let prot  = 'g:vikiOpenUrlWith_'. proto`
    `5          let protp = exists(prot)`
    `6          if !protp`
    `7              let prot  = 'g:vikiOpenUrlWith_ANY'`
    `8              let protp = exists(prot)`
    `9          endif`
    `10         if protp`
    `11             exec 'let openURL = '. prot`
    `12             " let url = shellescape(a:url)`
    `13             let url = a:url`
    `14             " TLogVAR url, a:url`
    `15             let openURL = viki#SubstituteArgs(openURL, 'URL', url)`
    `16             " TLogVAR openURL`
    `17             call viki#ExecExternal(openURL)`
    `18         else`
    `19             throw 'Viki: Please define g:vikiOpenUrlWith_'. proto .' or ``g:vikiOpenUrlWith_ANY!'`
    `20         endif`
    `   endfunction`
    After redefinition of function it just outputs url

    I'm on Windows 7, x64, gVim 7.2
    And version 3.11 of Viki works fine with this. Not sure if my setup causes problems

  • bybor

    Didn't notice you last post - if you need all that output using verbose file please let me know

  • Tom Link
    Tom Link

    Search for the function viki#ExecExternal(cmd) in autoload/viki.vim.

    Change the line

    exec escape(a:cmd, '!')


    exec a:cmd

    This change was introduced in 3.13 and causes this problem.

  • bybor

    Thanks for your help. Happy New Year.
    Wish you best luck!