summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 483dc983..11b92e63 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -887,17 +887,22 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
887 : "Not trusted")); 887 : "Not trusted"));
888 return iTrue; 888 return iTrue;
889 } 889 }
890 else if (equal_Command(cmd, "copy")) { 890 else if (equal_Command(cmd, "copy") && document_App() == d) {
891 iString *copied;
891 if (d->selectMark.start) { 892 if (d->selectMark.start) {
892 iRangecc mark = d->selectMark; 893 iRangecc mark = d->selectMark;
893 if (mark.start > mark.end) { 894 if (mark.start > mark.end) {
894 iSwap(const char *, mark.start, mark.end); 895 iSwap(const char *, mark.start, mark.end);
895 } 896 }
896 iString *copied = newRange_String(mark); 897 copied = newRange_String(mark);
897 SDL_SetClipboardText(cstr_String(copied)); 898 }
898 delete_String(copied); 899 else {
899 return iTrue; 900 /* Full document. */
901 copied = copy_String(source_GmDocument(d->doc));
900 } 902 }
903 SDL_SetClipboardText(cstr_String(copied));
904 delete_String(copied);
905 return iTrue;
901 } 906 }
902 else if (equalWidget_Command(cmd, w, "document.copylink")) { 907 else if (equalWidget_Command(cmd, w, "document.copylink")) {
903 if (d->hoverLink) { 908 if (d->hoverLink) {