From d019da3591ac91dbd6e213312f5847636cbb3360 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sat, 1 Apr 2017 21:25:04 -0400 Subject: [PATCH] fixed bug in tag completion shortcut --- TODO.md | 4 ++-- xedit.c | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index bc696be..3bd142a 100644 --- 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 762ce9e..c471b02 100644 --- 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); -- 2.49.0