danr / kakoune-easymotion

kakoune plugin for navigating like the easymotion vim mode
The Unlicense
53 stars 13 forks source link

Avoid replacing newlines to prevent text from reflowing #31

Open tomKPZ opened 2 years ago

tomKPZ commented 2 years ago

Fixes https://github.com/danr/kakoune-easymotion/issues/27

The strategy is to select the newlines in addition to the targets so that we can keep track of line lengths. Then if a range would have replaced a newline, the replaced string is clamped to the last character of the line.