diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-04 17:39:19 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-04 17:39:19 +0300 |
commit | 5c23b5805a25b815458809eab74e47776c3f47ce (patch) | |
tree | e56a7561ad61c7753faffd9cbd82cf88bdc12326 /src | |
parent | f6bbed48aac2f5497d81b33b3444226b8af1b2d3 (diff) | |
parent | b1621ee3fbd80f386c32e932ba6eb7f10bc3c822 (diff) |
Merge branch 'dev' into work/v1.7
# Conflicts:
# CMakeLists.txt
# res/about/version.gmi
Diffstat (limited to 'src')
-rw-r--r-- | src/gmutil.c | 2 | ||||
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/ui/text_simple.c | 11 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/gmutil.c b/src/gmutil.c index d547d27d..d87de8f6 100644 --- a/src/gmutil.c +++ b/src/gmutil.c | |||
@@ -620,7 +620,7 @@ const iString *canonicalUrl_String(const iString *d) { | |||
620 | - all non-reserved characters decoded (i.e., it's an IRI) | 620 | - all non-reserved characters decoded (i.e., it's an IRI) |
621 | - expect for spaces, which are always `%20` | 621 | - expect for spaces, which are always `%20` |
622 | This means a canonical URL can be used on a gemtext link line without modifications. */ | 622 | This means a canonical URL can be used on a gemtext link line without modifications. */ |
623 | iString *canon = maybeUrlDecodeExclude_String(d, "/?:;#&= "); | 623 | iString *canon = maybeUrlDecodeExclude_String(d, "%/?:;#&= "); |
624 | /* `canon` may now be NULL if nothing was decoded. */ | 624 | /* `canon` may now be NULL if nothing was decoded. */ |
625 | if (indexOfCStr_String(canon ? canon : d, " ") != iInvalidPos || | 625 | if (indexOfCStr_String(canon ? canon : d, " ") != iInvalidPos || |
626 | indexOfCStr_String(canon ? canon : d, "\n") != iInvalidPos) { | 626 | indexOfCStr_String(canon ? canon : d, "\n") != iInvalidPos) { |
@@ -68,6 +68,7 @@ int main(int argc, char **argv) { | |||
68 | "DHE-RSA-AES256-GCM-SHA384"); | 68 | "DHE-RSA-AES256-GCM-SHA384"); |
69 | SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); | 69 | SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); |
70 | SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1"); | 70 | SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1"); |
71 | SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); | ||
71 | if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) { | 72 | if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) { |
72 | fprintf(stderr, "[SDL] init failed: %s\n", SDL_GetError()); | 73 | fprintf(stderr, "[SDL] init failed: %s\n", SDL_GetError()); |
73 | return -1; | 74 | return -1; |
diff --git a/src/ui/text_simple.c b/src/ui/text_simple.c index 3afc631a..e88b09a8 100644 --- a/src/ui/text_simple.c +++ b/src/ui/text_simple.c | |||
@@ -169,6 +169,7 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { | |||
169 | if (!notify_WrapText_(wrap, chPos, 0, iMax(xpos, xposExtend) - orig.x, iFalse)) { | 169 | if (!notify_WrapText_(wrap, chPos, 0, iMax(xpos, xposExtend) - orig.x, iFalse)) { |
170 | break; | 170 | break; |
171 | } | 171 | } |
172 | lastWordEnd = NULL; | ||
172 | xpos = xposExtend = orig.x; | 173 | xpos = xposExtend = orig.x; |
173 | ypos += d->height; | 174 | ypos += d->height; |
174 | prevCh = ch; | 175 | prevCh = ch; |
@@ -240,21 +241,19 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { | |||
240 | iAssert(wrap); | 241 | iAssert(wrap); |
241 | const char *wrapPos = currentPos; | 242 | const char *wrapPos = currentPos; |
242 | int advance = x1 - orig.x; | 243 | int advance = x1 - orig.x; |
243 | if (lastWordEnd != args->text.start && wrap->mode == word_WrapTextMode) { | 244 | if (lastWordEnd && wrap->mode == word_WrapTextMode) { |
244 | wrapPos = skipSpace_CStr(lastWordEnd); | 245 | wrapPos = skipSpace_CStr(lastWordEnd); /* go back */ |
245 | wrapPos = iMin(wrapPos, args->text.end); | 246 | wrapPos = iMin(wrapPos, args->text.end); |
246 | advance = wrapAdvance; | 247 | advance = wrapAdvance; |
247 | } | 248 | } |
248 | // if (args->continueFrom_out) { | ||
249 | // *args->continueFrom_out = wrapPos; | ||
250 | // } | ||
251 | if (!notify_WrapText_(wrap, wrapPos, 0, advance, iFalse)) { | 249 | if (!notify_WrapText_(wrap, wrapPos, 0, advance, iFalse)) { |
252 | break; | 250 | break; |
253 | } | 251 | } |
252 | lastWordEnd = NULL; | ||
254 | xpos = xposExtend = orig.x; | 253 | xpos = xposExtend = orig.x; |
255 | ypos += d->height; | 254 | ypos += d->height; |
256 | prevCh = 0; | 255 | prevCh = 0; |
257 | chPos = wrapPos; /* go back */ | 256 | chPos = wrapPos; |
258 | continue; | 257 | continue; |
259 | } | 258 | } |
260 | const int yLineMax = ypos + d->height; | 259 | const int yLineMax = ypos + d->height; |