1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 18:30:15 -04:00

yank_name now implemented

This commit is contained in:
nova
2025-09-29 21:10:34 +02:00
parent 8dcf88baea
commit 4d9dc46691
3 changed files with 26 additions and 0 deletions

View File

@@ -703,6 +703,27 @@ void cmd_on_selected(int passes, int index){
free(file_str);
}
}
void yank_text(int passes, int index){
(void)passes;
char *cmd;
if (strncmp((char*)key_binding[index].black_magic, "path", 4) == 0) {
char *path=getcwd(NULL, 0);
cmd = concat("echo \"", path);
cmd = concat(cmd, "/");
cmd = concat(cmd, mid_content[selected_file_current].file_name);
cmd = concat(cmd, "\" | ");
cmd = concat(cmd, clipboard_cmd);
free(path);
} else {
cmd = concat("echo \"", mid_content[selected_file_current].file_name);
cmd = concat(cmd, "\" | ");
cmd = concat(cmd, clipboard_cmd);
}
if (system(cmd) == -1) {
/*do nothing*/
}
free(cmd);
}
void yank_file(int passes, int index){
(void)passes;