vim-textobj-functioncall icon indicating copy to clipboard operation
vim-textobj-functioncall copied to clipboard

Doesn't work with Module.Function(a,b)

Open raphaklaus opened this issue 3 years ago • 2 comments

Hello!

Great work with the plugin! Thanks for sharing.

I've been testing it and noticed that it only works for the function call itself, but if the function is part of a class or module it doesn't. Like MyClass.my_function(a, b)

Are you willing to include it as well in this plugin? If so I could help with writing a PR for this.

raphaklaus avatar Jun 17 '22 11:06 raphaklaus

Hi, sorry for my late response.

Let me make sure, just in case.

  1. It should work for the whole body of MyClass.my_function(a, b) when the cursor is on somewhere on it.
  2. It should work for my_function(a, b) even when the cursor is on MyClass. Which do you want (or other)?

machakann avatar Jun 23 '22 10:06 machakann

FYI, you can customize "what is a function" via textobj_functioncall_patterns.

let g:textobj_functioncall_patterns = [
\   {
\     'header' : '\<\%(\h\k*\.\)*\h\k*',
\     'bra'    : '(',
\     'ket'    : ')',
\     'footer' : '',
\   },
\ ]

machakann avatar Jul 03 '22 09:07 machakann