Skip to content

Bad parsing of identifiers #50

Closed
memeplex opened this Issue Jan 27, 2013 · 2 comments

2 participants

@memeplex

<Leader>d over decode in this line:

secret_decoder = lambda a,b: format(a)+decode(msg)%str(b)[:-1]

parses "+decode" so that an error:

'+decode' not found

is shown.

The + is not part of the identifier. For example:

:echo expand("<cWORD>") => "decode"

I'm not sure why you use here:

def get_doc_buffer(level=0):
    # empty string in case vim.eval return None
    word = vim.eval('expand("<cfile>")') or ''
@memeplex

I think you use in order to parse ident.ident.ident.

This will do the trick (and avoid the problems):

 try
    let isk_save = &isk
    let &isk = '@,48-57,_,192-255,.'
    let ident = expand('<cword>')
 finally
    let &isk = isk_save
 endtry
@ivanov ivanov added a commit that closed this issue Mar 26, 2013
@ivanov use <cword> to grab identifier closes #50
thanks for both the bug report and fix by @memeplex
185f0ca
@ivanov ivanov closed this in 185f0ca Mar 26, 2013
@ivanov
Owner
ivanov commented Mar 26, 2013

thanks for the report and suggested fix, applied a variant of it to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.