From 49196eba130b3ab4f0939f13d071aef3d0a70eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 10 Sep 2014 12:44:25 +0200 Subject: Simplify drawing of the window statusbar --- editor.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'editor.c') diff --git a/editor.c b/editor.c index 1371812..c2aa585 100644 --- a/editor.c +++ b/editor.c @@ -47,19 +47,15 @@ static void editor_window_move(EditorWin *win, int x, int y) { } static void editor_window_statusbar_draw(EditorWin *win) { - size_t line, col; - if (win->statuswin && win->editor->statusbar) { - window_cursor_getxy(win->win, &line, &col); - win->editor->statusbar(win->statuswin, win->editor->win == win, - text_filename(win->text), line, col); - } + if (win->statuswin && win->editor->statusbar) + win->editor->statusbar(win); } static void editor_window_cursor_moved(Win *win, void *data) { editor_window_statusbar_draw(data); } -void editor_statusbar_set(Editor *ed, editor_statusbar_t statusbar) { +void editor_statusbar_set(Editor *ed, void (*statusbar)(EditorWin*)) { ed->statusbar = statusbar; } -- cgit v1.2.3