Skip to content

Commit

Permalink
lib: clear clipboard on paste (#297)
Browse files Browse the repository at this point in the history
* lib: clear clipboard on paste

* lib: only clear clipboard if cut op
  • Loading branch information
ArcaTech committed Aug 15, 2023
1 parent daf1980 commit f5ee361
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ export async function setup(document: Document, target: HTMLElement, backend: Ba
const p = ctx.path.clone();
p.pop();
workbench.focus(p.append(workbench.clipboard.node));
if (workbench.clipboard.op === "cut") {
workbench.clipboard = undefined;
}
}
});
workbench.keybindings.registerBinding({ command: "paste", key: "meta+v" });
Expand Down

0 comments on commit f5ee361

Please sign in to comment.