]> git.mdlowis.com Git - projs/tide.git/commitdiff
Escape now clears the selection if one already exists. Otherwise it will select the...
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 22 Dec 2016 14:07:34 +0000 (09:07 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 22 Dec 2016 14:07:34 +0000 (09:07 -0500)
TODO.md
libedit/view.c

diff --git a/TODO.md b/TODO.md
index 5fa84341a1c861fbe4bb1a64697589f6e69c284a..7a7c9a71f549bc4aabeca8001d1465cc8db2baab 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -13,6 +13,7 @@ Up Next:
 
 The Rest: 
 
+* Auto-save on focus change or quit
 * Implement EWMH hooks to prevent window manager killing client with modifications
 * Implement X Selection protocol for handling clipboard and primary selections
 * add a distinct state for pointer move versus drag
index 0c43c0781e738e36124df12cdac47ec26e3365b2..f25822dcb9ed635c86881f6285af1109014f3b1c 100644 (file)
@@ -345,10 +345,14 @@ void view_selword(View* view, size_t row, size_t col) {
 }
 
 void view_selprev(View* view) {
-    buf_loglock(&(view->buffer));
-    Sel sel = view->selection;
-    buf_lastins(&(view->buffer), &sel.beg, &sel.end);
-    view->selection = sel;
+    if (!num_selected(view->selection)) {
+        buf_loglock(&(view->buffer));
+        Sel sel = view->selection;
+        buf_lastins(&(view->buffer), &sel.beg, &sel.end);
+        view->selection = sel;
+    } else {
+        view->selection.beg = view->selection.end;
+    }
 }
 
 void view_select(View* view, size_t row, size_t col) {