martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.25k stars 258 forks source link

Remove restriction that f,t character motion are line-based #915

Closed moesasji closed 3 years ago

moesasji commented 3 years ago

This pull request makes the char motions f,F and t,T work more powerful by removing the restriction that they work on lines.

This behavior is implemented by many plugins for vim and is the default behavior for Kakoune. In my opinion removing this restriction fits better with the sam concept that operations should not be line-based without affecting the vim grammar.

This pull-request would close #735

btw) this change breaks some of the motion-based tests. I can look at fixing those if this would be acceptable.

martanne commented 3 years ago

The reason for the current behavior is that with multiple selections it is often convenient to only adjust selections which actually have a match on the current line. The multiline behavior seems somewhat redundant with ? and /, albeit without the need to quote special characters.

Anyway, adf65e1dca8d3c0381133be8446eebddf412d772 introduces the multiline functionality which can be enabled by overriding the various mappings.