Replies: 1 comment 5 replies
-
Textobject interacts with How textobject behaves in consecutive selection depends on In your case this pattern doesn't seem to match two words separated by whitespace (like I am honestly not sure how to make it better using Lua patterns. One other approach might be to use function which returns array of regions, but it might be computationally expensive and not trivial. |
Beta Was this translation helpful? Give feedback.
-
Contributing guidelines
Module(s)
mini.ai
Description
Hi, following on from #261 I have been attempting to create text objects for
w
,W
andp
. I have made some headway withw
, it currently looks like this (updated: 20230316):The problem is when I input
2yiw
for example, it seems to want to yank only the second "word". Default vim behaviour would be to select both the current "word" and the next one. I'm guessing this is to do with the wayv:count
is implemented for text objects?I don't know whether this is a bug or a feature, for example I know with bracket-type text objects, the behaviour of v:count with a count of 2 would be to select the brackets surrounding the ones you're in. (i.e. to expand outwards). But I think for things like
word
s andWORD
s it makes sense to expand forwards.I'm wondering if it makes sense for text objects to be able to specify how they interact with
v:count
?Beta Was this translation helpful? Give feedback.
All reactions