summaryrefslogtreecommitdiff
path: root/core/edit.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/edit.zig')
-rw-r--r--core/edit.zig9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/edit.zig b/core/edit.zig
index ce13b5ed..e68f8d38 100644
--- a/core/edit.zig
+++ b/core/edit.zig
@@ -124,6 +124,11 @@ pub fn applyPaste(p: *Pardes, whole: []const u8) Error!void {
var said: pardes.Kind.Buf(96) = .{};
p.setMessage(.at(v.active), said.print("paste cut at its limit, {d} KiB: the rest left out", .{limit / 1024}));
}
+ // A text prompt in a tag takes it into its field (Prompt.zig).
+ if (v.tag_state.kind == .prompt) {
+ v.clip_pending = null;
+ return pardes.Prompt.paste(p, bytes);
+ }
// A prompt answering for a header takes the paste, as it takes keys.
const asking = if (p.panes[v.active]) |active| active.prompt != .none else false;
if (!asking) if (tagline.focusedHeader(p)) |t| {
@@ -146,7 +151,9 @@ pub fn applyPaste(p: *Pardes, whole: []const u8) Error!void {
n += 1;
};
if (n > 0) try insertKey(p.editor(), &pane.input, .{ .cp = line[0], .text = line[0..n] });
- if (normal.selRegexArmed(pane)) |a| if (panes.promptTarget(p, pane)) |t| normal.applySelRegex(p, pane, t, a.pat, a.mode);
+ if (normal.selRegexArmed(pane)) |a| if (panes.promptTarget(p, pane)) |t| {
+ _ = normal.applySelRegex(p, pane, t, a.pat, a.mode);
+ };
return;
}
if (pane.focus == .tag) return pasteInto(p, &pane.tag, bytes);