aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-08-29 00:38:19 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-09 19:24:18 +0200
commitbed2f368f06f8e4cd535d24b56d00714e5de8424 (patch)
treeef8f3dee1619081d8fd53381c1483e1d0040cbc5 /src
parenta7d28d3fed7748dcaedbcac8902cb9e1339cb078 (diff)
downloadsciteco-bed2f368f06f8e4cd535d24b56d00714e5de8424.tar.gz
<f,tXq>: fixed for very large character ranges
* use SCI_GETTEXTRANGEFULL instead of deprecated SCI_GETTEXTRANGE
Diffstat (limited to 'src')
-rw-r--r--src/qreg-commands.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qreg-commands.c b/src/qreg-commands.c
index 12bea81..f248ced 100644
--- a/src/qreg-commands.c
+++ b/src/qreg-commands.c
@@ -760,13 +760,17 @@ teco_state_copytoqreg_got_register(teco_machine_main_t *ctx, teco_qreg_t *qreg,
}
}
+ /*
+ * NOTE: This does not use SCI_GETRANGEPOINTER+SCI_GETGAPPOSITION
+ * since it may not be safe when copying from register to register.
+ */
g_autofree gchar *str = g_malloc(len + 1);
- struct Sci_TextRange text_range = {
- .chrg = {.cpMin = from, .cpMax = from + len},
+ struct Sci_TextRangeFull range = {
+ .chrg = {from, from + len},
.lpstrText = str
};
- teco_interface_ssm(SCI_GETTEXTRANGE, 0, (sptr_t)&text_range);
+ teco_interface_ssm(SCI_GETTEXTRANGEFULL, 0, (sptr_t)&range);
if (teco_machine_main_eval_colon(ctx)) {
if (!qreg->vtable->undo_append_string(qreg, error) ||