diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-12 11:29:28 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-12 11:29:28 +0200 |
| commit | 6df6386c3af1420d9b0d676d5b9da660ab6f99d4 (patch) | |
| tree | e9b717be17c69d090b9cd1d2fda6841620407819 /text.h | |
| parent | bc8ad2d9e83096685dac4a7af3b1080b012eb24d (diff) | |
| download | vis-6df6386c3af1420d9b0d676d5b9da660ab6f99d4.tar.gz vis-6df6386c3af1420d9b0d676d5b9da660ab6f99d4.tar.xz | |
Restore cursor position after an undo/redo
Diffstat (limited to 'text.h')
| -rw-r--r-- | text.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -33,8 +33,10 @@ bool text_insert(Text*, size_t pos, const char *data); bool text_insert_raw(Text*, size_t pos, const char *data, size_t len); bool text_delete(Text*, size_t pos, size_t len); void text_snapshot(Text*); -bool text_undo(Text*); -bool text_redo(Text*); +/* undo/redos to the last snapshoted state. returns the position where + * the change occured or (size_t)-1 if nothing could be undo/redo. */ +size_t text_undo(Text*); +size_t text_redo(Text*); size_t text_pos_by_lineno(Text*, size_t lineno); size_t text_lineno_by_pos(Text*, size_t pos); |
