diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-22 06:09:07 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-22 06:09:07 +0200 |
| commit | 637b1adbdda1af761518b90b52fb6ae7798584bc (patch) | |
| tree | 01c10bf0b2c573ce65806e80e4a2ddb0daecd66e /editor.c | |
| parent | ddd80ea3ca108858ebd053339871c6fa251f9a8d (diff) | |
| download | vis-637b1adbdda1af761518b90b52fb6ae7798584bc.tar.gz vis-637b1adbdda1af761518b90b52fb6ae7798584bc.tar.xz | |
Add support for the '<', '>' marks
Diffstat (limited to 'editor.c')
| -rw-r--r-- | editor.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -55,8 +55,14 @@ static void editor_window_statusbar_draw(EditorWin *win) { win->editor->statusbar(win); } -static void editor_window_cursor_moved(Win *win, void *data) { - editor_window_statusbar_draw(data); +static void editor_window_cursor_moved(Win *winwin, void *data) { + EditorWin *win = data; + Filerange sel = window_selection_get(winwin); + if (text_range_valid(&sel) && sel.start != sel.end) { + text_mark_set(win->text, MARK_SELECTION_START, sel.start); + text_mark_set(win->text, MARK_SELECTION_END, sel.end); + } + editor_window_statusbar_draw(win); } void editor_statusbar_set(Editor *ed, void (*statusbar)(EditorWin*)) { |
