When looking for a way to make xah-select-line work with visual lines, I found that there's no forward-visual-line; instead, I discovered that end-of-visual-line can take an optional parameter. The default behavior equals (end-of-visual-line 1), but when you pass 2, it goes to the end of the next visual line.
Then I found that it was odd that the key binding does always go down 1 line first when a region is active, even if point is in the middle of a line.K Instead, I wanted to go to the end of the line first, even with a region active, and then advance to the next line. I added a new branching path for that.
I left the old code untouched; but if you like that behavior, I can extend the non-visual variant to go to end-of-line first, and if it's already there, advance to the next line.
When looking for a way to make
xah-select-line
work with visual lines, I found that there's noforward-visual-line
; instead, I discovered thatend-of-visual-line
can take an optional parameter. The default behavior equals(end-of-visual-line 1)
, but when you pass2
, it goes to the end of the next visual line.Then I found that it was odd that the key binding does always go down 1 line first when a region is active, even if point is in the middle of a line.K Instead, I wanted to go to the end of the line first, even with a region active, and then advance to the next line. I added a new branching path for that.
I left the old code untouched; but if you like that behavior, I can extend the non-visual variant to go to end-of-line first, and if it's already there, advance to the next line.
Can also remove the comments of course.
Demonstration of the "end of line first" behavior