From: Michael D. Lowis Date: Mon, 2 Apr 2018 13:05:53 +0000 (-0400) Subject: removed implicit mark X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=971ea169bd1d31abe773c0321846c3064ebe462b;p=projs%2Ftide.git removed implicit mark --- diff --git a/inc/edit.h b/inc/edit.h index 8f173a7..75632e9 100644 --- a/inc/edit.h +++ b/inc/edit.h @@ -105,7 +105,6 @@ typedef struct { typedef struct { Buf buffer; /* the buffer used to populate the view */ Sel selection; /* range of currently selected text */ - size_t prev_csr; /* previous cursor location */ size_t nrows; /* number of rows in the view */ size_t ncols; /* number of columns in the view */ Row** rows; /* array of row data structures */ @@ -157,7 +156,6 @@ void view_selextend(View* view, size_t row, size_t col); void view_selword(View* view, size_t row, size_t col); void view_select(View* view, size_t row, size_t col); void view_jumpto(View* view, bool extsel, size_t off); -void view_jumpback(View* view); void view_scrollto(View* view, size_t csr); Rune view_getrune(View* view); diff --git a/lib/view.c b/lib/view.c index e37dab3..f8127cd 100644 --- a/lib/view.c +++ b/lib/view.c @@ -33,7 +33,6 @@ void view_init(View* view, char* file) { view->selection = (Sel){ 0 }; view->sync_needed = true; view->sync_center = true; - view->prev_csr = 0; /* load the file and jump to the address returned from the load function */ buf_init(&(view->buffer)); if (file) { @@ -180,7 +179,6 @@ bool view_findstr(View* view, int dir, char* str) { view->selection = sel; view->sync_needed = true; view->sync_center = true; - if (found) view->prev_csr = prev; return found; } @@ -208,15 +206,9 @@ void view_delete(View* view, int dir, bool byword) { } void view_jumpto(View* view, bool extsel, size_t off) { - view->prev_csr = view->selection.end; move_to(view, extsel, off); } -void view_jumpback(View* view) { - view_jumpto(view, false, view->prev_csr); - view->sync_center = true; -} - void view_bol(View* view, bool extsel) { /* determine whether we are jumping to start of content or line */ Buf* buf = &(view->buffer); @@ -247,14 +239,12 @@ void view_setln(View* view, size_t line) { } void view_undo(View* view) { - view->prev_csr = view->selection.end; buf_undo(&(view->buffer), &(view->selection)); view->sync_needed = true; view->sync_center = !selection_visible(view); } void view_redo(View* view) { - view->prev_csr = view->selection.end; buf_redo(&(view->buffer), &(view->selection)); view->sync_needed = true; view->sync_center = !selection_visible(view); diff --git a/tide.c b/tide.c index a66f7a7..376f0ae 100644 --- a/tide.c +++ b/tide.c @@ -387,13 +387,9 @@ static void jump_to(char* arg) { } static void goto_ctag(char* arg) { - if (x11_keymodsset(ModShift)) { - view_jumpback(win_view(FOCUSED)); - } else { - char* str = view_getctx(win_view(FOCUSED)); - jump_to(str); - free(str); - } + char* str = view_getctx(win_view(FOCUSED)); + jump_to(str); + free(str); } static void tabs(char* arg) {