aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-08-07 13:38:57 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-08-07 13:38:57 +0200
commitbf08e4e2b69a391e72edc57735a5095af621f92c (patch)
tree5af1727f12f50ae604a9d0ae835f41554b570101 /editor.h
parent53ef4487f58f706f363f7db37e5a894dd98e23e6 (diff)
downloadvis-bf08e4e2b69a391e72edc57735a5095af621f92c.tar.gz
vis-bf08e4e2b69a391e72edc57735a5095af621f92c.tar.xz
Add function to query line-numer <-> byte offset mapping
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor.h b/editor.h
index e8d5a44..71829b3 100644
--- a/editor.h
+++ b/editor.h
@@ -17,6 +17,7 @@ typedef struct {
editor_iterator_next(&it))
Editor *editor_load(const char *file);
+const char *editor_filename(Editor*);
bool editor_insert(Editor*, size_t pos, const char *data);
bool editor_insert_raw(Editor*, size_t pos, const char *data, size_t len);
bool editor_delete(Editor*, size_t pos, size_t len);
@@ -26,6 +27,9 @@ void editor_snapshot(Editor*);
bool editor_undo(Editor*);
bool editor_redo(Editor*);
+size_t editor_pos_by_lineno(Editor*, size_t lineno);
+size_t editor_lineno_by_pos(Editor*, size_t pos);
+
size_t editor_bytes_get(Editor*, size_t pos, size_t len, char *buf);
Iterator editor_iterator_get(Editor*, size_t pos);