From: Michael D. Lowis Date: Wed, 17 May 2017 19:30:28 +0000 (-0400) Subject: Ctrl+X now cuts the current line if there is no current selection X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=28638c73d10fece0a3d5277ee9c23685a0e43bc9;p=projs%2Ftide.git Ctrl+X now cuts the current line if there is no current selection --- diff --git a/xedit.c b/xedit.c index 82e3195..25701fd 100644 --- a/xedit.c +++ b/xedit.c @@ -115,7 +115,14 @@ static void onpaste(char* text) { } static void cut(void) { - char* str = view_getstr(win_view(FOCUSED), NULL); + View* view = win_view(FOCUSED); + /* select the current line if no selection */ + if (!view_selsize(view)) { + view_eol(view, false); + view_selctx(view); + } + /* now perform the cut */ + char* str = view_getstr(view, NULL); x11_sel_set(CLIPBOARD, str); if (str && *str) delete(); }