nvim-various-textobjs
nvim-various-textobjs copied to clipboard
[Bug]: incorrect key for c++
Bug Description
In line
std::string c = "afaf";
vik
command selects only string c
, ignoring std::
.
I am using defaut configuration of plugin from README.
neovim version
0.9.5
This is expected. The key
object matches one word in front of :
or =
.
See https://github.com/chrisgrieser/nvim-various-textobjs/blob/3ab25fe20f8f9c2035425d0cf5c9634a063cb98e/lua/various-textobjs/charwise-textobjs.lua#L302-L306
Indeed, the behavior is expected. I don't know any C, so I am not familiar with how the pattern has to be adapted to make it work correctly there - any PRs welcome.
C and C++ don't have the key/value syntax. The ::
in that snippet is a scope resolution operator, and std::string s = "abc";
is a copy initialization of the variable s
. This is not a key/value pair. Should close.