summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2007-03-29 17:37:16 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2007-03-29 17:37:16 +0000
commitb5d9aaf8a613761b8f3667112d45352d733a8839 (patch)
tree6aab265301539f9ad7b37803254a6acbf974a911 /usr.bin/mg
parentfa2715c09493ddc55152ad2d5f20e43b3930192f (diff)
Indicate when macro recording is in progress on the modeline.
(This should eventually move to becoming a "real" mode.) Don't print end macro message unless the macro is being recorded. ok cloder@. looks fine art@
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/display.c8
-rw-r--r--usr.bin/mg/macro.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/mg/display.c b/usr.bin/mg/display.c
index 4956ee168ed..3ac9a52a313 100644
--- a/usr.bin/mg/display.c
+++ b/usr.bin/mg/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.33 2006/12/24 01:07:59 kjell Exp $ */
+/* $OpenBSD: display.c,v 1.34 2007/03/29 17:37:15 kjell Exp $ */
/* This file is in the public domain. */
@@ -106,6 +106,9 @@ struct score *score; /* [NROW * NROW] */
#endif /* !LINENOMODE */
static int linenos = LINENOMODE;
+/* Is macro recording enabled? */
+extern int macrodef;
+
/*
* Since we don't have variables (we probably should) this is a command
* processor for changing the value of the line number mode flag.
@@ -823,6 +826,9 @@ modeline(struct mgwin *wp)
vtputc('-');
++n;
}
+ /* XXX This should eventually move to a real mode */
+ if (macrodef == TRUE)
+ n += vtputs("-def");
vtputc(')');
++n;
diff --git a/usr.bin/mg/macro.c b/usr.bin/mg/macro.c
index 74e888bd785..754586e51c2 100644
--- a/usr.bin/mg/macro.c
+++ b/usr.bin/mg/macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macro.c,v 1.11 2005/12/20 06:17:36 kjell Exp $ */
+/* $OpenBSD: macro.c,v 1.12 2007/03/29 17:37:15 kjell Exp $ */
/* This file is in the public domain. */
@@ -54,9 +54,12 @@ definemacro(int f, int n)
int
finishmacro(int f, int n)
{
- macrodef = FALSE;
- ewprintf("End Keyboard Macro Definition");
- return (TRUE);
+ if (macrodef == TRUE) {
+ macrodef = FALSE;
+ ewprintf("End Keyboard Macro Definition");
+ return (TRUE);
+ }
+ return (FALSE);
}
/* ARGSUSED */