Closed petRUShka closed 7 years ago
This happens because we currently only split function calls on parentheses, ignoring OOP dot notation. :neckbeard:
To support OOP dot notation, the "dot" might be language-specific :fearful: so I'm thinking of doing this in a language-agnostic way using Vim's iskeyword
setting to tell me which characters are safe to split on. :camel:
iskeyword
is probably the solution. But honestly I always thought that VimL has its own built-in function for word under cursor
, hasn't it?
Yes, we already use Vim's built-in <cword>
facility for this purpose. :+1: And here is the root cause:
nnoremap <silent> <Leader>K :call Dasht([expand('<cWORD>'), expand('<cword>')])<Return>
The mapping searches for cWORD first and then falls back to searching cword, which is the opposite of what you want. :face_with_head_bandage: I don't remember why I chose this particular order, but it feels counter-intuitive now.
This issue can be solved by changing the order of cwords in the above mapping to this:
nnoremap <silent> <Leader>K :call Dasht([expand('<cword>'), expand('<cWORD>')])<Return>
README has been updated accordingly. :books: Thanks for reporting this issue. :+1: Closing.
Suppose I have following code in Ruby:
I place my cursor in the middle of the word
rotate
:where
<|>
is the position of cursor. And then I press<Leader> K
configured as in your README.After pressing the key I see documentation on
rand
and not onrotate!
which I expected.