diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-12-04 03:15:24 +0100 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-12-04 03:15:24 +0100 |
| commit | 457fe1498d5fe88e0447ddecd617281f7afd3304 (patch) | |
| tree | 15f1d8a3c4c6c20e678a5eef2559b7ad2a8e91ab /search.h | |
| parent | aca9517b3d90180581570596cb5ac768ef8c127e (diff) | |
search and replace command (FS)
* makes use of Scintilla selections, so their usage has been improved
* search commands preserve selection on termination (escape)
* selections are restored on rubout
* search-replace command makes use of the Insert command's state (may serve as a base class now)
but does not pop additional values from stack (like "I" does)
Diffstat (limited to 'search.h')
| -rw-r--r-- | search.h | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -7,7 +7,13 @@ #include "parser.h" #include "qbuffers.h" +/* + * "S" command state and base class for all other search/replace commands + */ class StateSearch : public StateExpectString { +public: + StateSearch(bool last = true) : StateExpectString(true, last) {} + protected: struct Parameters { gint dot; @@ -42,9 +48,24 @@ private: State *done(const gchar *str) throw (Error); }; +class StateReplace : public StateSearch { +public: + StateReplace() : StateSearch(false) {} + +private: + State *done(const gchar *str) throw (Error); +}; + +class StateReplace_insert : public StateInsert { +private: + void initial(void) throw (Error) {} +}; + namespace States { - extern StateSearch search; - extern StateSearchAll searchall; + extern StateSearch search; + extern StateSearchAll searchall; + extern StateReplace replace; + extern StateReplace_insert replace_insert; } #endif |
