Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when RHS contains a pipe #2

Open
RageYL opened this issue Aug 2, 2017 · 2 comments
Open

Crash when RHS contains a pipe #2

RageYL opened this issue Aug 2, 2017 · 2 comments

Comments

@RageYL
Copy link

RageYL commented Aug 2, 2017

Hi !

Thanks for that incredibly useful plugin !

The plugin 'crash' when the rhs contains a |.

n  [m          *@:call <SNR>59_Python_jump('n', '\v^\s*(class|def|async def)>', 'Wb')<CR>
n  [[          *@:call <SNR>59_Python_jump('n', '\v^(class|def|async def)>', 'Wb')<CR>
n  ]m          *@:call <SNR>59_Python_jump('n', '\v%$|^\s*(class|def|async def)>', 'W')<CR>
n  ]]          *@:call <SNR>59_Python_jump('n', '\v%$|^(class|def|async def)>', 'W')<CR>

The following

let mappings = savemap#save_map('n')

produce:

Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line   11:
E492: Not an editor command: def|async def)>', 'Wb')<cr>
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line   11:
E492: Not an editor command: def|async def)>', 'Wb')<cr>
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line   11:
E492: Not an editor command: ^\s*(class|def|async def)>', 'W')<cr>
Error detected while processing function SubmodesLoaded[39]..savemap#save_map[1]..<SNR>77_save_map[12]..<SNR>77_make_ma
p_info[15]..<SNR>77_restore_map_info:
line   11:
E492: Not an editor command: ^(class|def|async def)>', 'W')<cr>

I fixed the error by duplicating the code that replace | with <bar> for the rhs. (it was a quick and dirty patch, i don't even know if that is the way to solve the issue)

function! s:maparg(...) "{{{
    let info = call('maparg', a:000)
    if has_key(info, 'lhs')
        let info.lhs = substitute(info.lhs, '|', '<Bar>', 'g')
    endif
    if has_key(info, 'rhs')
        let info.rhs = substitute(info.rhs, '|', '<Bar>', 'g')
    endif
    return info
endfunction "}}}

But now the mappings output (even though i didn't clear or restore the mappings)

E117: Unknown function: <SNR>77_Python_jump
@tyru
Copy link
Owner

tyru commented Aug 26, 2017

sorry, this library is merged into https://github.com/vim-jp/vital.vim/ (Mapping module).
So now I'm not maintaining this repository.

@tyru
Copy link
Owner

tyru commented Aug 26, 2017

ah sorry, I got wrong (vital.vim's Mapping module is another library).
I'll support this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants