From: Michael D. Lowis Date: Fri, 14 Sep 2018 00:49:51 +0000 (-0400) Subject: select line shortcut now handles multiple lines X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=20e18d02b39cd44478537d8277c36ff8ead6ad5c;p=projs%2Ftide.git select line shortcut now handles multiple lines --- 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) {