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

Support extending the current selection by repeating a custom text object

Open kana opened this issue 11 years ago • 1 comments

Several built-in text objects can be repeated to extend the current selection. For example, vawawawaw... and vabababab.... It's not trivial how to extend the current selection for each custom text object, so that vim-textobj-user can't support this behavior by default. It have to be implemented by each custom text object.

To implement this behavior, it's necessary to know

  • Whether a text object is used in Visual mode, and
  • The current selection.

Perhaps the correct information cannot be retrieved with built in functions, so it might be necessary to add or extend API to provide these information.

kana avatar Apr 24 '14 22:04 kana

Since a process to extend the current selection is orthogonal to a process to select a text object, it might be better to add another property like extend to specify how to extend the current selection (by a user-defined function). Extending processes for custom text objects sometimes are the same as ones for built in text objects such as aw, ip and others. So that it would be better to provide functions for the processes by vim-textobj-user.

kana avatar Apr 24 '14 23:04 kana