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 */
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);
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) {
view->selection = sel;
view->sync_needed = true;
view->sync_center = true;
- if (found) view->prev_csr = prev;
return found;
}
}
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);
}
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);
}
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) {