diff options
-rw-r--r-- | src/search.cpp | 7 | ||||
-rw-r--r-- | src/search.h | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/search.cpp b/src/search.cpp index 525cb2a..de16b4f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -217,10 +217,10 @@ StateSearch::class2regexp(MatchState &state, const gchar *&pattern, break; case STATE_ANYQ: - /* FIXME: Q-Register spec might get more complicated */ - reg = QRegisters::globals[g_ascii_toupper(*pattern)]; + reg = qreg_machine.input(*pattern); if (!reg) - return NULL; + break; + qreg_machine.reset(); temp = reg->get_string(); temp2 = g_regex_escape_string(temp, -1); @@ -427,6 +427,7 @@ StateSearch::process(const gchar *str, /* NOTE: pattern2regexp() modifies str pointer */ re_pattern = pattern2regexp(str); + qreg_machine.reset(); #ifdef DEBUG g_printf("REGEXP: %s\n", re_pattern); #endif diff --git a/src/search.h b/src/search.h index 4506d7c..f5fd29e 100644 --- a/src/search.h +++ b/src/search.h @@ -23,6 +23,7 @@ #include "sciteco.h" #include "parser.h" #include "ring.h" +#include "qregisters.h" /* * "S" command state and base class for all other search/replace commands @@ -40,6 +41,8 @@ protected: Buffer *from_buffer, *to_buffer; } parameters; + QRegSpecMachine qreg_machine; + enum MatchState { STATE_START, STATE_NOT, |