evil-collection icon indicating copy to clipboard operation
evil-collection copied to clipboard

vterm: bypass line wraps in the prompt line

Open FrostyX opened this issue 2 years ago • 1 comments
trafficstars

When the command in the prompt line is so long that it wraps to multiple lines, movements such as h, l, ^, and $ IMHO behave unexpectedly. In normal terminal emulators outside of Emacs, a long prompt line contains only soft-wraps, i.e. being at the last character before a wrap and pressing <right> moves the cursor to the first character of the next line. This is also how vterm behaves without Evil. I am changing h and l to behave the same way.

While doing so, I am doing the same for ^ and $.

FrostyX avatar Mar 30 '23 01:03 FrostyX

Just to easily illustrate behavior. When I press l without this patch, it does nothing. With this patch, it moves the cursor to the next line.

Screenshot_2023-03-30_02-37-02

Similarly h goes to the previous line

Screenshot_2023-03-30_02-37-54

This works in the visual mode as well.

FrostyX avatar Mar 30 '23 01:03 FrostyX