diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/documentwidget.c | 6 | ||||
-rw-r--r-- | src/ui/inputwidget.c | 6 | ||||
-rw-r--r-- | src/ui/sidebarwidget.c | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 8f2fc437..1ee83a85 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -1653,11 +1653,11 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
1653 | } | 1653 | } |
1654 | else if (equal_Command(cmd, "document.copylink") && document_App() == d) { | 1654 | else if (equal_Command(cmd, "document.copylink") && document_App() == d) { |
1655 | if (d->contextLink) { | 1655 | if (d->contextLink) { |
1656 | SDL_SetClipboardText(cstr_String( | 1656 | SDL_SetClipboardText(cstr_String(withSpacesEncoded_String(absoluteUrl_String( |
1657 | absoluteUrl_String(d->mod.url, linkUrl_GmDocument(d->doc, d->contextLink->linkId)))); | 1657 | d->mod.url, linkUrl_GmDocument(d->doc, d->contextLink->linkId))))); |
1658 | } | 1658 | } |
1659 | else { | 1659 | else { |
1660 | SDL_SetClipboardText(cstr_String(d->mod.url)); | 1660 | SDL_SetClipboardText(cstr_String(withSpacesEncoded_String(d->mod.url))); |
1661 | } | 1661 | } |
1662 | return iTrue; | 1662 | return iTrue; |
1663 | } | 1663 | } |
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 85bd8b8b..6992bbec 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -514,8 +514,10 @@ static size_t coordIndex_InputWidget_(const iInputWidget *d, iInt2 coord) { | |||
514 | static iBool copy_InputWidget_(iInputWidget *d, iBool doCut) { | 514 | static iBool copy_InputWidget_(iInputWidget *d, iBool doCut) { |
515 | if (!isEmpty_Range(&d->mark)) { | 515 | if (!isEmpty_Range(&d->mark)) { |
516 | const iRanges m = mark_InputWidget_(d); | 516 | const iRanges m = mark_InputWidget_(d); |
517 | SDL_SetClipboardText(cstrCollect_String( | 517 | iString *str = collect_String(newUnicodeN_String(constAt_Array(&d->text, m.start), |
518 | newUnicodeN_String(constAt_Array(&d->text, m.start), size_Range(&m)))); | 518 | size_Range(&m))); |
519 | SDL_SetClipboardText( | ||
520 | cstr_String(d->inFlags & isUrl_InputWidgetFlag ? withSpacesEncoded_String(str) : str)); | ||
519 | if (doCut) { | 521 | if (doCut) { |
520 | pushUndo_InputWidget_(d); | 522 | pushUndo_InputWidget_(d); |
521 | deleteMarked_InputWidget_(d); | 523 | deleteMarked_InputWidget_(d); |
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index cde95892..c31e157c 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -753,7 +753,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
753 | else if (isCommand_Widget(w, ev, "bookmark.copy")) { | 753 | else if (isCommand_Widget(w, ev, "bookmark.copy")) { |
754 | const iSidebarItem *item = d->contextItem; | 754 | const iSidebarItem *item = d->contextItem; |
755 | if (d->mode == bookmarks_SidebarMode && item) { | 755 | if (d->mode == bookmarks_SidebarMode && item) { |
756 | SDL_SetClipboardText(cstr_String(&item->url)); | 756 | SDL_SetClipboardText(cstr_String(withSpacesEncoded_String(&item->url))); |
757 | } | 757 | } |
758 | return iTrue; | 758 | return iTrue; |
759 | } | 759 | } |
@@ -974,7 +974,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
974 | else if (isCommand_Widget(w, ev, "history.copy")) { | 974 | else if (isCommand_Widget(w, ev, "history.copy")) { |
975 | const iSidebarItem *item = d->contextItem; | 975 | const iSidebarItem *item = d->contextItem; |
976 | if (item && !isEmpty_String(&item->url)) { | 976 | if (item && !isEmpty_String(&item->url)) { |
977 | SDL_SetClipboardText(cstr_String(&item->url)); | 977 | SDL_SetClipboardText(cstr_String(withSpacesEncoded_String(&item->url))); |
978 | } | 978 | } |
979 | return iTrue; | 979 | return iTrue; |
980 | } | 980 | } |