diff options
Diffstat (limited to 'src/view.h')
-rw-r--r-- | src/view.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2023 Robin Haberkorn + * Copyright (C) 2012-2024 Robin Haberkorn * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,3 +70,16 @@ gboolean teco_view_save_to_file(teco_view_t *ctx, const gchar *filename, GError /** @pure @memberof teco_view_t */ void teco_view_free(teco_view_t *ctx); + +static inline guint +teco_view_get_codepage(teco_view_t *ctx) +{ + return teco_view_ssm(ctx, SCI_GETCODEPAGE, 0, 0) + ? : teco_view_ssm(ctx, SCI_STYLEGETCHARACTERSET, STYLE_DEFAULT, 0); +} + +gssize teco_view_glyphs2bytes(teco_view_t *ctx, teco_int_t pos); +teco_int_t teco_view_bytes2glyphs(teco_view_t *ctx, gsize pos); +gssize teco_view_glyphs2bytes_relative(teco_view_t *ctx, gsize pos, teco_int_t n); + +teco_int_t teco_view_get_character(teco_view_t *ctx, gsize pos, gsize len); |