summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-26 17:02:49 -0400
committerQuentin Carbonneaux2014-08-26 17:02:49 -0400
commit2e3f55654853bdc6c9a48a9e3670461ebbb7237c (patch)
tree6292813ccc80bf083867730a4256939f98d243ea
parent12ac8baeecda34d67b343cd5880ccd4c01ddb36d (diff)
change behavior of New
-rw-r--r--exec.c22
-rw-r--r--win.h1
2 files changed, 13 insertions, 10 deletions
diff --git a/exec.c b/exec.c
index d7f1f82..b64690f 100644
--- a/exec.c
+++ b/exec.c
@@ -43,16 +43,6 @@ static ECmd etab[] = {
{ 0, run },
};
-static int
-new(W *w, EBuf *eb, unsigned pos)
-{
- extern W *curwin;
-
- (void)w; (void)eb; (void)pos;
- curwin = win_new(eb_new());
- return 1;
-}
-
/* ex_run - Execute a command in the current window at
* position [p0]. The command is first searched among
* the list of builtins, if not found, it is run in a shell.
@@ -327,6 +317,18 @@ look(W *w, EBuf *eb, unsigned p0)
return 1;
}
+static int
+new(W *w, EBuf *eb, unsigned pos)
+{
+ extern W *curwin;
+
+ (void)eb; (void)pos;
+ w = win_new(eb_new());
+ if (w)
+ curwin = win_tag_toggle(w);
+ return 0;
+}
+
typedef struct run Run;
struct run {
EBuf *eb; /* 0 if no more to read */
diff --git a/win.h b/win.h
index 915aabe..0de0dec 100644
--- a/win.h
+++ b/win.h
@@ -11,6 +11,7 @@ typedef struct w W;
#define TagInit \
"Look \n" \
"Get \n" \
+ "New\n" \
"|fmt\n"
enum {