From 28638c73d10fece0a3d5277ee9c23685a0e43bc9 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 17 May 2017 15:30:28 -0400 Subject: [PATCH] Ctrl+X now cuts the current line if there is no current selection --- xedit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); } -- 2.54.0