From 20e18d02b39cd44478537d8277c36ff8ead6ad5c Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 13 Sep 2018 20:49:51 -0400 Subject: [PATCH] select line shortcut now handles multiple lines --- tide.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tide.c b/tide.c index 040038c..d765281 100644 --- a/tide.c +++ b/tide.c @@ -102,9 +102,16 @@ void exec(char* cmd) { /* 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) { -- 2.49.0