vim-hoogle icon indicating copy to clipboard operation
vim-hoogle copied to clipboard

Use searchpos to get the full enclosed word instead of expanding <cword>

Open resolritter opened this issue 7 years ago • 0 comments

When you use :Hoogle without passing any parameters, it uses expand("<cword>") to get the underlying word under the cursor.

For fully qualified module names, like Graphics.Gloss.Data.ViewPort, it would only get the word between the dots around your cursor position.

By using searchpos instead, it matches with the surrounding spaces either side and/or the newline characters, resulting in capturing the full text object (even operators like '<$>').

resolritter avatar Oct 31 '18 10:10 resolritter