]> git.mdlowis.com Git - projs/tide.git/commitdiff
reprioritized selection logic so that blocks will be selected when the brace is the...
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 17 Mar 2017 16:26:50 +0000 (12:26 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 17 Mar 2017 16:26:50 +0000 (12:26 -0400)
lib/view.c

index 3c62e97bd9bb5ae4bda40cfc7bd69477d7fc8b08..a816b221dfb4886b88a68c56d71093f330ffffa7 100644 (file)
@@ -298,17 +298,17 @@ static void selcontext(View* view, Sel* sel) {
     Buf* buf = &(view->buffer);
     size_t bol = buf_bol(buf, sel->end);
     Rune r = buf_get(buf, sel->end);
-    if (sel->end == bol || r == '\n' || r == RUNE_CRLF) {
-        sel->beg = bol;
-        sel->end = buf_eol(buf, sel->end);
-    } else if (risword(r)) {
-        buf_getword(buf, risword, sel);
-    } else if (r == '(' || r == ')') {
+    if (r == '(' || r == ')') {
         buf_getblock(buf, '(', ')', sel);
     } else if (r == '[' || r == ']') {
         buf_getblock(buf, '[', ']', sel);
     } else if (r == '{' || r == '}') {
         buf_getblock(buf, '{', '}', sel);
+    } else if (sel->end == bol || r == '\n' || r == RUNE_CRLF) {
+        sel->beg = bol;
+        sel->end = buf_eol(buf, sel->end);
+    } else if (risword(r)) {
+        buf_getword(buf, risword, sel);
     } else {
         buf_getword(buf, risbigword, sel);
     }