usagi-flow / evil-helix

Bringing the Helix editor to the evil side
https://github.com/usagi-flow/helix
Mozilla Public License 2.0
316 stars 9 forks source link

Constrain cursor to line in normal mode #36

Open diocletiann opened 3 months ago

diocletiann commented 3 months ago

Vim doesn't wrap the cursor in normal mode, I think it would be helpful if it behaved the same way in evil-helix. Thanks for the fork!

usagi-flow commented 3 months ago

Great suggestion. Seems like the current behavior is baked in Helix and not configurable. I might have to adjust nth_next_grapheme_boundary() / nth_prev_grapheme_boundary() for this, although a better solution would be welcome.

diocletiann commented 3 months ago

Actually, Vim also doesn't do it in insert or visual mode.

When I tried making a toy editor with ropey my naive implementation was to check for caret.column == 0 when moving left and rope.char(caret.column + 1) == '/n' when moving right.