summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/about/version.gmi1
-rw-r--r--src/gmutil.c6
-rw-r--r--src/gmutil.h1
-rw-r--r--src/ui/documentwidget.c6
-rw-r--r--src/ui/inputwidget.c6
-rw-r--r--src/ui/sidebarwidget.c4
6 files changed, 17 insertions, 7 deletions
diff --git a/res/about/version.gmi b/res/about/version.gmi
index 387cdc1e..2731a489 100644
--- a/res/about/version.gmi
+++ b/res/about/version.gmi
@@ -19,6 +19,7 @@
19## 1.0.3 19## 1.0.3
20* Improved font glyph caching: only rasterize glyphs when drawing text, and retry after failure. This makes initial document layout faster and avoids issues with permanently lost glyphs. 20* Improved font glyph caching: only rasterize glyphs when drawing text, and retry after failure. This makes initial document layout faster and avoids issues with permanently lost glyphs.
21* Fixed parts of text disappearing when the glyph cache fills up. The cache also uses less memory now. 21* Fixed parts of text disappearing when the glyph cache fills up. The cache also uses less memory now.
22* Fixed percent-encoding of spaces when copying URLs to clipboard.
22* Fixed feed entry context menu showing the wrong menu item for Mark as Read/Unread. 23* Fixed feed entry context menu showing the wrong menu item for Mark as Read/Unread.
23* Fixed parentheses and brackets being trimmed from feed entry titles. 24* Fixed parentheses and brackets being trimmed from feed entry titles.
24* Fixed quotes appearing continuous even when there are empty lines in between. 25* Fixed quotes appearing continuous even when there are empty lines in between.
diff --git a/src/gmutil.c b/src/gmutil.c
index ab9a8eea..69fa6d9f 100644
--- a/src/gmutil.c
+++ b/src/gmutil.c
@@ -327,6 +327,12 @@ void urlEncodeSpaces_String(iString *d) {
327 } 327 }
328} 328}
329 329
330const iString *withSpacesEncoded_String(const iString *d) {
331 iString *enc = copy_String(d);
332 urlEncodeSpaces_String(enc);
333 return collect_String(enc);
334}
335
330const iString *feedEntryOpenCommand_String(const iString *url, int newTab) { 336const iString *feedEntryOpenCommand_String(const iString *url, int newTab) {
331 if (!isEmpty_String(url)) { 337 if (!isEmpty_String(url)) {
332 iString *cmd = collectNew_String(); 338 iString *cmd = collectNew_String();
diff --git a/src/gmutil.h b/src/gmutil.h
index 947ff56b..7227a072 100644
--- a/src/gmutil.h
+++ b/src/gmutil.h
@@ -110,5 +110,6 @@ void urlEncodePath_String (iString *);
110iString * makeFileUrl_String (const iString *localFilePath); 110iString * makeFileUrl_String (const iString *localFilePath);
111const char * makeFileUrl_CStr (const char *localFilePath); 111const char * makeFileUrl_CStr (const char *localFilePath);
112void urlEncodeSpaces_String (iString *); 112void urlEncodeSpaces_String (iString *);
113const iString * withSpacesEncoded_String(const iString *);
113 114
114const iString * feedEntryOpenCommand_String (const iString *url, int newTab); /* checks fragment */ 115const iString * feedEntryOpenCommand_String (const iString *url, int newTab); /* checks fragment */
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) {
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);
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 }