Skip to content

Missing 'range' in function definition #3

Description

@mcepl

Hi,

I thing that at least for vim 7.3 you need to add "range" when creating function at this line:
https://bitbucket.org/agr/ropevim/src/4bd40366d3aee3447b6baeb069f345d61e793f97/ropevim.py?at=default#cl-272

It should look like:

#!python

    def _add_function(self, name, callback, prefix=False):
        globals()[name] = callback
        arg = 'None' if prefix else ''
        vim.command('function! %s() range\n' % _vim_name(name) +
                    'python ropevim.%s(%s)\n' % (name, arg) +
                    'endfunction\n')

Without that when for example you select several lines and use key combination C-c r m (ExtractMethod) then it will be run for every line.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions