Skip to content

Commit

Permalink
feat: Enter now always copies the current clip, even if its the stack…
Browse files Browse the repository at this point in the history
… that has active focus.

close #75
  • Loading branch information
cablehead committed Jun 13, 2024
1 parent 4c5b7f1 commit 909de51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 1 addition & 12 deletions src/modals/mainMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,13 @@ export default {
let ret = [];

ret.push({
name: "Copy",
name: "Copy clip",
keys: [<Icon name="IconReturnKey" />],
onMouseDown: () => {
stack.triggerCopy();
},
});

let action = actions.find((action) => action.name === "Copy entire stack");
if (action && action.canApply && action.canApply(stack)) {
ret.push({
name: action.name,
keys: action.keys,
onMouseDown: () => {
if (action && action.trigger) action.trigger(stack);
},
} as HotKey);
}

ret.push({
name: "Actions",
keys: [<Icon name="IconCommandKey" />, "K"],
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class Stack {
}

async triggerCopy() {
const item = this.selected();
const item = this.selected_item();
if (!item) return;
await invoke("store_copy_to_clipboard", {
sourceId: item.id,
Expand Down

0 comments on commit 909de51

Please sign in to comment.