]> git.mdlowis.com Git - projs/tide.git/commitdiff
shift+click should extend the selection to the clicked location
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 2 Jan 2017 04:04:43 +0000 (23:04 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 2 Jan 2017 04:04:43 +0000 (23:04 -0500)
TODO.md
xedit.c

diff --git a/TODO.md b/TODO.md
index 1197a0521af23dca41b5366af271976987d54968..ee8d344d2e2c984705c8aeb70da660884048a3df 100644 (file)
--- 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 34146d3db2928aadb7bb1beb60070fc5b77cb3d6..265f23688c2aeb2b762a7cbdb3af95cc1b3a8d7a 100644 (file)
--- 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) {