diff options
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -77,7 +77,7 @@ teco_doc_edit(teco_doc_t *ctx, guint default_cp) (sptr_t)teco_doc_get_scintilla(ctx)); teco_view_ssm(teco_qreg_view, SCI_SETFIRSTVISIBLELINE, ctx->first_line, 0); teco_view_ssm(teco_qreg_view, SCI_SETXOFFSET, ctx->xoffset, 0); - teco_view_ssm(teco_qreg_view, SCI_SETSEL, ctx->anchor, (sptr_t)ctx->dot); + teco_view_ssm(teco_qreg_view, SCI_SETSEL, ctx->anchor, (sptr_t)ctx->pos); /* * NOTE: Thanks to a custom Scintilla patch, representations @@ -124,7 +124,7 @@ teco_doc_undo_edit(teco_doc_t *ctx) */ //undo__teco_view_set_representations(teco_qreg_view); - undo__teco_view_ssm(teco_qreg_view, SCI_SETSEL, ctx->anchor, (sptr_t)ctx->dot); + undo__teco_view_ssm(teco_qreg_view, SCI_SETSEL, ctx->anchor, (sptr_t)ctx->pos); undo__teco_view_ssm(teco_qreg_view, SCI_SETXOFFSET, ctx->xoffset, 0); undo__teco_view_ssm(teco_qreg_view, SCI_SETFIRSTVISIBLELINE, ctx->first_line, 0); undo__teco_view_ssm(teco_qreg_view, SCI_SETDOCPOINTER, 0, @@ -222,9 +222,11 @@ void teco_doc_update_from_view(teco_doc_t *ctx, teco_view_t *from) { ctx->anchor = teco_view_ssm(from, SCI_GETANCHOR, 0, 0); - ctx->dot = teco_view_ssm(from, SCI_GETCURRENTPOS, 0, 0); + ctx->pos = teco_view_ssm(from, SCI_GETCURRENTPOS, 0, 0); ctx->first_line = teco_view_ssm(from, SCI_GETFIRSTVISIBLELINE, 0, 0); ctx->xoffset = teco_view_ssm(from, SCI_GETXOFFSET, 0, 0); + + ctx->dot = teco_view_bytes2glyphs_rel(from, 0, 0, ctx->pos); } /** @memberof teco_doc_t */ @@ -232,9 +234,11 @@ void teco_doc_update_from_doc(teco_doc_t *ctx, const teco_doc_t *from) { ctx->anchor = from->anchor; - ctx->dot = from->dot; + ctx->pos = from->pos; ctx->first_line = from->first_line; ctx->xoffset = from->xoffset; + + ctx->dot = from->dot; } /** @@ -252,7 +256,6 @@ teco_doc_exchange(teco_doc_t *ctx, teco_doc_t *other) memcpy(other, &temp, sizeof(*other)); } -/** @memberof teco_doc_t */ void teco_doc_clear(teco_doc_t *ctx) { |
