From c71ed30cf0c554d288edfe87842082cc9ec393a7 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 28 Aug 2024 20:52:03 +0200 Subject: implemented Unicode support for rubin/rubout and a number of commands (WIP) (refs #5) certain test cases are still way too slow: 10000<@I/X^J/> 20000 or 10000<@I/X^J/> 20000<%a-1J> SCI_ALLOCATELINECHARACTERINDEX does not help much here. It probably speeds up only SCI_LINEFROMINDEXPOSITION and SCI_INDEXPOSITIONFROMLINE. --- src/interface.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/interface.h') diff --git a/src/interface.h b/src/interface.h index ddca0b3..b6c015b 100644 --- a/src/interface.h +++ b/src/interface.h @@ -160,10 +160,11 @@ void teco_interface_cleanup(void); * since sciteco.h should not depend on interface.h. */ +// FIXME: Should probably return the byte offset static inline gboolean teco_validate_pos(teco_int_t n) { - return 0 <= n && n <= teco_interface_ssm(SCI_GETLENGTH, 0, 0); + return !n || (n > 0 && teco_interface_ssm(SCI_POSITIONRELATIVE, 0, n) > 0); } static inline gboolean -- cgit v1.2.3