Up Next:
* ctrl+d with no selection does word selection instead of context
-* add config option to change default tab style
* get rid of edit wrapper script
* move by words is inconsistent. Example:
var infoId = 'readerinfo'+reader.id;
* Make Fn keys execute nth command in the tags buffers
* Add a way to CD using a builtin
* Ctrl+PageUp/Dn to move cursor by screenfuls
-* Ctrl+Shift+g to jump to undo a goto line action
* Ctrl+\ Shortcut to warp cursor to middle of current screen.
* Find shortcut should select previous word if current char is newline
* diagnostic messages can stack up if deselected and not resolved
the current file. Otherwise, a new instance of `xedit` will be launched with
the target file and the cursor set to the line containing the definition.
+* `Ctrl+Shift+g`:
+ Jump to the previous cursor location.
+
* `Ctrl+n`:
Open a new instance of `xedit` with no filename.
Row** rows; /* array of row data structures */
Buf buffer; /* the buffer used to populate the view */
Sel selection; /* range of currently selected text */
+ size_t prev_csr; /* previous cursor location */
} View;
enum {
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);
}
void view_jumpto(View* view, bool extsel, size_t off) {
- view->selection.end = off;
+ Buf* buf = &(view->buffer);
+ view->prev_csr = view->selection.end;
+ view->selection.end = (off > buf_end(buf) ? buf_end(buf) : off);
if (!extsel)
view->selection.beg = view->selection.end;
view->selection.col = buf_getcol(&(view->buffer), view->selection.end);
view->sync_needed = true;
}
+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);
}
static void goto_ctag(void) {
- char* str = view_getctx(win_view(FOCUSED));
- jump_to(str);
- free(str);
+ if (x11_keymodsset(ModShift)) {
+ view_jumpback(win_view(FOCUSED));
+ } else {
+ char* str = view_getctx(win_view(FOCUSED));
+ jump_to(str);
+ free(str);
+ }
}
static void tabs(void) {
{ ModCtrl, 'o', open_file },
{ ModCtrl, 'p', pick_ctag },
{ ModCtrl, 'g', goto_ctag },
+ { ModCtrl|ModShift, 'g', goto_ctag },
{ ModCtrl, 'n', new_win },
{ ModCtrl, '\n', newline },
{ ModCtrl|ModShift, '\n', newline },