aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sam.c b/sam.c
index 3ddd146..af95c14 100644
--- a/sam.c
+++ b/sam.c
@@ -155,7 +155,7 @@ static const CommandDef cmds[] = {
"p", "Create selection covering range",
CMD_NONE, NULL, cmd_print
}, {
- "s", "Substitute text for regexp in range",
+ "s", "Substitute: use x/pattern/ c/replacement/ instead",
CMD_SHELL|CMD_ADDRESS_LINE, NULL, cmd_substitute
}, {
"v", "If range does not contain regexp, run command",
@@ -1391,13 +1391,8 @@ static bool cmd_files(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs
}
static bool cmd_substitute(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor *cur, Filerange *range) {
- Buffer buf;
- buffer_init(&buf);
- bool ret = false;
- if (buffer_put0(&buf, "s") && buffer_append0(&buf, argv[1]))
- ret = cmd_filter(vis, win, cmd, (const char*[]){ argv[0], "sed", buffer_move(&buf), NULL }, cur, range);
- buffer_release(&buf);
- return ret;
+ vis_info_show(vis, "Use :x/pattern/ c/replacement/ instead");
+ return false;
}
static bool cmd_write(Vis *vis, Win *win, Command *cmd, const char *argv[], Cursor *cur, Filerange *r) {