From 637b1adbdda1af761518b90b52fb6ae7798584bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 22 Sep 2014 06:09:07 +0200 Subject: Add support for the '<', '>' marks --- editor.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'editor.c') diff --git a/editor.c b/editor.c index 367c40b..4128ffa 100644 --- a/editor.c +++ b/editor.c @@ -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*)) { -- cgit v1.2.3