From f356d76752c59bef8e4034e759226ab36c8a1a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 4 Jan 2015 21:11:06 +0100 Subject: Change window_cursor_getxy API --- window.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'window.h') diff --git a/window.h b/window.h index eae7b17..eb403c8 100644 --- a/window.h +++ b/window.h @@ -8,6 +8,11 @@ typedef struct Win Win; +typedef struct { + size_t line; + size_t col; +} CursorPos; + Win *window_new(Text*); /* change associated text displayed in this window */ void window_reload(Win*, Text*); @@ -50,7 +55,7 @@ size_t window_line_goto(Win*, int n); /* get cursor position in bytes from start of the file */ size_t window_cursor_get(Win*); /* get cursor position in terms of screen coordinates */ -void window_cursor_getxy(Win*, size_t *lineno, size_t *col); +CursorPos window_cursor_getpos(Win*); /* moves window viewport in direction until pos is visible. should only be * used for short distances between current cursor position and destination */ void window_scroll_to(Win*, size_t pos); -- cgit v1.2.3