diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-08-28 20:52:03 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-09 18:17:03 +0200 |
commit | c71ed30cf0c554d288edfe87842082cc9ec393a7 (patch) | |
tree | 8ae23bf7786793ad3450942f96055ff853d448ac /src/interface.h | |
parent | f79a6f65acde9753ea65887e0e0d4bc7f76ff52b (diff) | |
download | sciteco-c71ed30cf0c554d288edfe87842082cc9ec393a7.tar.gz |
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<R>
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.
Diffstat (limited to 'src/interface.h')
-rw-r--r-- | src/interface.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 |