diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-06-12 21:58:34 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2008-06-12 21:58:34 +0000 |
commit | 6e0916070c4aae814e7231cea600a88491aee6bf (patch) | |
tree | 311e6b24bd44afb36a69733d3b524af8bdd4ffad | |
parent | 2751b8076b810be48a1ef9b2fc5f9aea0075735f (diff) |
incremental search isn't allowed in macros, so if your fingers
automatically go there during a macro def, the macro recording
is CANCELED. This sucks rocks.
This fixes the incremental searches to
automagically invoke the non-incremental varieties during
macro recording and playback.
ok art
-rw-r--r-- | usr.bin/mg/search.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c index af209a68156..ecd91426797 100644 --- a/usr.bin/mg/search.c +++ b/usr.bin/mg/search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: search.c,v 1.35 2007/02/13 17:50:26 kjell Exp $ */ +/* $OpenBSD: search.c,v 1.36 2008/06/12 21:58:33 kjell Exp $ */ /* This file is in the public domain. */ @@ -127,7 +127,11 @@ searchagain(int f, int n) int forwisearch(int f, int n) { - return (isearch(SRCH_FORW)); + if (macrodef || inmacro) + /* We can't isearch in macro. Use search instead */ + return (forwsearch(f,n)); + else + return (isearch(SRCH_FORW)); } /* @@ -138,7 +142,11 @@ forwisearch(int f, int n) int backisearch(int f, int n) { - return (isearch(SRCH_BACK)); + if (macrodef || inmacro) + /* We can't isearch in macro. Use search instead */ + return (backsearch(f,n)); + else + return (isearch(SRCH_BACK)); } /* |