aboutsummaryrefslogtreecommitdiffhomepage
path: root/search.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'search.cpp')
-rw-r--r--search.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/search.cpp b/search.cpp
index ea0613a..f27e744 100644
--- a/search.cpp
+++ b/search.cpp
@@ -13,6 +13,7 @@
namespace States {
StateSearch search;
StateSearchAll searchall;
+ StateSearchKill searchkill;
StateSearchDelete searchdelete;
StateReplace replace;
StateReplace_insert replace_insert;
@@ -495,6 +496,30 @@ StateSearchAll::done(const gchar *str) throw (Error)
}
State *
+StateSearchKill::done(const gchar *str) throw (Error)
+{
+ gint anchor;
+
+ BEGIN_EXEC(&States::start);
+
+ StateSearch::done(str);
+
+ undo.push_msg(SCI_GOTOPOS, interface.ssm(SCI_GETCURRENTPOS));
+ anchor = interface.ssm(SCI_GETANCHOR);
+ interface.ssm(SCI_GOTOPOS, anchor);
+
+ interface.ssm(SCI_BEGINUNDOACTION);
+ interface.ssm(SCI_DELETERANGE,
+ parameters.dot, anchor - parameters.dot);
+ interface.ssm(SCI_ENDUNDOACTION);
+ ring.dirtify();
+
+ undo.push_msg(SCI_UNDO);
+
+ return &States::start;
+}
+
+State *
StateSearchDelete::done(const gchar *str) throw (Error)
{
BEGIN_EXEC(&States::start);