From 457fe1498d5fe88e0447ddecd617281f7afd3304 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 4 Dec 2012 03:15:24 +0100 Subject: 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) --- parser.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'parser.cpp') diff --git a/parser.cpp b/parser.cpp index cf938b0..b862973 100644 --- a/parser.cpp +++ b/parser.cpp @@ -22,7 +22,7 @@ gint macro_pc = 0; namespace States { StateStart start; StateControl control; - StateFlowCommand flowcommand; + StateFCommand fcommand; StateCondCommand condcommand; StateECommand ecommand; StateScintilla_symbols scintilla_symbols; @@ -446,7 +446,7 @@ StateStart::StateStart() : State() transitions['!'] = &States::label; transitions['O'] = &States::gotocmd; transitions['^'] = &States::control; - transitions['F'] = &States::flowcommand; + transitions['F'] = &States::fcommand; transitions['"'] = &States::condcommand; transitions['E'] = &States::ecommand; transitions['I'] = &States::insert; @@ -1012,13 +1012,14 @@ StateStart::custom(gchar chr) throw (Error) return this; } -StateFlowCommand::StateFlowCommand() : State() +StateFCommand::StateFCommand() : State() { transitions['\0'] = this; + transitions['S'] = &States::replace; } State * -StateFlowCommand::custom(gchar chr) throw (Error) +StateFCommand::custom(gchar chr) throw (Error) { switch (chr) { /* -- cgit v1.2.3