diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-02 23:29:09 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2024-09-09 18:22:21 +0200 |
commit | a747cff2b6027d5e013aa84c1db0159c51983a79 (patch) | |
tree | 6868c2f03df801b25c12851ccc6c5e51c496bbd8 /src | |
parent | 4dadac8a15b5fa17679db9ef64b437919399f226 (diff) | |
download | sciteco-a747cff2b6027d5e013aa84c1db0159c51983a79.tar.gz |
conditionals now check for Unicode codepoints (refs #5)
* This will naturally work with both ASCII characters and various
non-English scripts.
* Unfortunately, it cannot work with the other non-ANSI single-byte codepages.
* If we'd like to support scripts working with all sorts of codepoints,
we'd have to introduce a new command for translating individual codepoints
from the current codepage (as reported by EE) to Unicode.
Diffstat (limited to 'src')
-rw-r--r-- | src/core-commands.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core-commands.c b/src/core-commands.c index edd7e35..1d060b0 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -1552,20 +1552,20 @@ teco_state_condcommand_input(teco_machine_main_t *ctx, gchar chr, GError **error break; case 'A': if (ctx->mode == TECO_MODE_NORMAL) - result = g_ascii_isalpha((gchar)value); + result = g_unichar_isalpha(value); break; case 'C': if (ctx->mode == TECO_MODE_NORMAL) - result = g_ascii_isalnum((gchar)value) || + result = g_unichar_isalnum(value) || value == '.' || value == '$' || value == '_'; break; case 'D': if (ctx->mode == TECO_MODE_NORMAL) - result = g_ascii_isdigit((gchar)value); + result = g_unichar_isdigit(value); break; case 'I': if (ctx->mode == TECO_MODE_NORMAL) - result = G_IS_DIR_SEPARATOR((gchar)value); + result = G_IS_DIR_SEPARATOR(value); break; case 'S': case 'T': @@ -1598,15 +1598,15 @@ teco_state_condcommand_input(teco_machine_main_t *ctx, gchar chr, GError **error break; case 'R': if (ctx->mode == TECO_MODE_NORMAL) - result = g_ascii_isalnum((gchar)value); + result = g_unichar_isalnum(value); break; case 'V': if (ctx->mode == TECO_MODE_NORMAL) - result = g_ascii_islower((gchar)value); + result = g_unichar_islower(value); break; case 'W': if (ctx->mode == TECO_MODE_NORMAL) - result = g_ascii_isupper((gchar)value); + result = g_unichar_isupper(value); break; default: g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED, |