diff options
Diffstat (limited to 'src/help.c')
| -rw-r--r-- | src/help.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -38,7 +38,7 @@ #include "rb3str.h" #include "help.h" -static void teco_help_set(const gchar *topic_name, const gchar *filename, teco_int_t pos); +static void teco_help_set(const gchar *topic_name, const gchar *filename, gsize pos); static GStringChunk *teco_help_chunk = NULL; @@ -46,13 +46,14 @@ static GStringChunk *teco_help_chunk = NULL; typedef struct { teco_rb3str_head_t head; - teco_int_t pos; + /** position of topic in filename (in bytes) */ + gsize pos; gchar filename[]; } teco_help_topic_t; /** @static @memberof teco_help_topic_t */ static teco_help_topic_t * -teco_help_topic_new(const gchar *topic_name, const gchar *filename, teco_int_t pos) +teco_help_topic_new(const gchar *topic_name, const gchar *filename, gsize pos) { /* * Topics are inserted only once into the RB tree, so we can store @@ -157,7 +158,7 @@ teco_help_init(GError **error) do { gchar *endptr; - teco_int_t pos = strtoul(topic, &endptr, 10); + gsize pos = strtoul(topic, &endptr, 10); /* * This also breaks at the last line of the @@ -196,7 +197,7 @@ teco_help_find(const gchar *topic_name) } static void -teco_help_set(const gchar *topic_name, const gchar *filename, teco_int_t pos) +teco_help_set(const gchar *topic_name, const gchar *filename, gsize pos) { teco_help_topic_t *topic; teco_help_topic_t *existing = teco_help_find(topic_name); @@ -298,6 +299,8 @@ teco_state_help_done(teco_machine_main_t *ctx, teco_string_t str, GError **error !teco_ring_edit(topic->filename, error)) return NULL; + teco_current_doc_set_dot(teco_interface_bytes2glyphs_absdot(topic->pos)); + /* * Make sure the topic is visible. * We do need undo tokens for this (even though |
