From 07b52f78680858683acb4e40b158f8926285cae4 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 19 Nov 2024 14:33:30 +0300 Subject: implemented search mode flag (^X): allow case-sensitive searches (closes #17) * Usually you will only want -^X for enabling case sensitive searches and 0^X for case-insensitive searches (which is also the default). * An open question is what happens if the user sets -^X and then calls a macro. The search mode flag should probably be stacked away along with the search-string. This means we'd need a ^X special Q-Reg as well, so you can write [^X[_ 0^X S...$ ]_]^X. Alternatively, the search mode flag should be a property of the macro frame, along with the radix. --- src/core-commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core-commands.c') diff --git a/src/core-commands.c b/src/core-commands.c index 27f5c64..ca0245b 100644 --- a/src/core-commands.c +++ b/src/core-commands.c @@ -1835,7 +1835,8 @@ teco_state_control_input(teco_machine_main_t *ctx, gunichar chr, GError **error) ['O'] = {&teco_state_start, teco_state_control_octal}, ['D'] = {&teco_state_start, teco_state_control_decimal}, ['R'] = {&teco_state_start, teco_state_control_radix}, - ['E'] = {&teco_state_start, teco_state_control_glyphs2bytes} + ['E'] = {&teco_state_start, teco_state_control_glyphs2bytes}, + ['X'] = {&teco_state_start, teco_state_control_search_mode} }; /* -- cgit v1.2.3