]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed bug in tag completion shortcut
authorMichael D. Lowis <mike@mdlowis.com>
Sun, 2 Apr 2017 01:25:04 +0000 (21:25 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sun, 2 Apr 2017 01:25:04 +0000 (21:25 -0400)
TODO.md
xedit.c

diff --git a/TODO.md b/TODO.md
index bc696bef66bcd03611e5eb94a1c80786c0f450dd..3bd142a3ea5d7b1783fd9a3fd35dba2e92dcb492 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -2,6 +2,7 @@
 
 Up Next:
 
+* Status line should omit characters from beginning of path to make file path fit
 * clipboard does not persist after exit
 * Run commands in the background and don't block the main thread.
 * Make Fn keys execute nth command in the tags buffer
@@ -18,10 +19,9 @@ Up Next:
 
 Straight-up Bugs:
 
-* ctrl+space selects too large of a word in some cases (function names followed by paren)
+* tab inserts dont coalesce like one would expect
 * off by one error on scrolling up with wrapped lines
 * Ctrl+u with a selection clears to bol *before* selected text
-* tab inserts dont coalesce like one would expect
 
 The Future:
 
diff --git a/xedit.c b/xedit.c
index 762ce9e3b3fac18dffcbf53b0d8996b0dc2e1253..c471b0206868390954da9a54cd1a01347be41ecf 100644 (file)
--- a/xedit.c
+++ b/xedit.c
@@ -360,7 +360,8 @@ static void pick_ctag(void) {
 
 static void complete(void) {
     View* view = win_view(FOCUSED);
-    view_selword(view, SIZE_MAX, SIZE_MAX);
+    buf_getword(&(view->buffer), risword, &(view->selection));
+    view->selection.end = buf_byrune(&(view->buffer), view->selection.end, RIGHT);
     PickTagCmd[1] = "print";
     PickTagCmd[3] = view_getstr(view, NULL);
     char* pick = cmdread(PickTagCmd, NULL);
@@ -522,6 +523,8 @@ void onupdate(void) {
     size_t remlen = sizeof(status_bytes) - strlen(status_bytes) - 1;
     strncat(status, path, remlen);
     win_settext(STATUS, status_bytes);
+    win_view(STATUS)->selection = (Sel){0,0,0};
+
     
     /* calculate and update scroll region */
     View* view = win_view(EDIT);