From 7ea5a9bc6066c061881e06f121277bed0918a1e2 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sun, 1 Jan 2017 23:04:43 -0500 Subject: [PATCH] shift+click should extend the selection to the clicked location --- TODO.md | 1 - xedit.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 1197a05..ee8d344 100644 --- a/TODO.md +++ b/TODO.md @@ -17,7 +17,6 @@ The Rest: * Add a GoTo tag for ctags lookup and line number jump * Use select to check for error strings in exec.c * Add a tools dir to namespace utility scripts only useful inside the editor -* shift+click to extend selection * implement command diffing logic to optimize the undo/redo log * add command line flags to toggle options (Tabs, Indent, etc..) * backspace should delete indent if preceded by whitespace diff --git a/xedit.c b/xedit.c index 34146d3..265f236 100644 --- a/xedit.c +++ b/xedit.c @@ -738,12 +738,16 @@ static void exec(char* cmd) { /* Mouse Handling *****************************************************************************/ static void mouse_left(enum RegionId id, size_t count, size_t row, size_t col) { - if (count == 1) - view_setcursor(getview(id), row, col); - else if (count == 2) + if (count == 1) { + if (x11_keymodsset(ModShift)) + view_selext(getview(id), row, col); + else + view_setcursor(getview(id), row, col); + } else if (count == 2) { view_select(getview(id), row, col); - else if (count == 3) + } else if (count == 3) { view_selword(getview(id), row, col); + } } static void mouse_middle(enum RegionId id, size_t count, size_t row, size_t col) { -- 2.52.0