summaryrefslogtreecommitdiff
path: root/src/ui/inputwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-12 12:18:57 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-12 12:20:32 +0200
commit1abe34f7a061932f4bf433c3e99b804588272536 (patch)
treeef7ab6b1bc288b8487a1c5af4fa2b5c4479be0bb /src/ui/inputwidget.c
parent341519487778bf7d006c2c896aadde1faa3f905b (diff)
Fixed: Percent-encode spaces when copying
IssueID #112
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r--src/ui/inputwidget.c6
1 files changed, 4 insertions, 2 deletions
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) {
514static iBool copy_InputWidget_(iInputWidget *d, iBool doCut) { 514static 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);