summaryrefslogtreecommitdiff
path: root/core/Prompt.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Prompt.zig')
-rw-r--r--core/Prompt.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/Prompt.zig b/core/Prompt.zig
index 0dfe79ea..20c393bb 100644
--- a/core/Prompt.zig
+++ b/core/Prompt.zig
@@ -831,7 +831,7 @@ fn plainWord(w: *std.Io.Writer, op: Op, line: []const u8) !?[]const u8 {
.pipe => try w.print("Edit |{s}", .{line}),
.pipe_to => try w.print("Edit >{s}", .{line}),
.insert, .append, .keep_pipe => return null,
- .command => return Command.plainWord(w, line),
+ .command => return null, // Command.plainWord, which reads the rows
}
return if (op == .search or op == .search_back) "Look" else "Exec";
}
@@ -1017,7 +1017,8 @@ pub fn head(p: *Pardes, arena: std.mem.Allocator, pane: *Pane) !TagState.Head {
if (line.len > 0) {
var buf: [Field.max + 16]u8 = undefined;
var w: std.Io.Writer = .fixed(&buf);
- if (plainWord(&w, pr.op, line) catch null) |verb| {
+ const said = if (pr.op == .command) Command.plainWord(p, &w, line) else plainWord(&w, pr.op, line) catch null;
+ if (said) |verb| {
try styled(arena, &text, &spans, try std.fmt.allocPrint(arena, " = {s}", .{verb}), .dim);
try text.print(arena, " {s}", .{w.buffered()});
}