/* Keyboard and Tag Handlers
******************************************************************************/
static void select_line(char* arg) {
- View* view = win_view(FOCUSED);
- view_eol(view, false);
- view_selctx(view);
+ Buf* buf = win_buf(FOCUSED);
+ if (buf->selection.beg <= buf->selection.end) {
+ buf->selection.beg = buf_bol(buf, buf->selection.beg);
+ buf->selection.end = buf_eol(buf, buf->selection.end);
+ buf->selection.end = buf_byrune(buf, buf->selection.end, RIGHT);
+ } else {
+ buf->selection.beg = buf_eol(buf, buf->selection.beg);
+ buf->selection.beg = buf_byrune(buf, buf->selection.beg, RIGHT);
+ buf->selection.end = buf_bol(buf, buf->selection.end);
+ }
}
static void join_lines(char* arg) {