diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-07 20:18:49 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-09-07 20:18:49 +0300 |
commit | 5e556c4ebbecd8979ee1d7088d98da121971a9ea (patch) | |
tree | f42850f53a8c4a43cbe99bf47674a6d3157a85eb /src/history.c | |
parent | 594df27872dbcd72a5bd161260a04ca119928113 (diff) |
Lookup improvements for history content
Diffstat (limited to 'src/history.c')
-rw-r--r-- | src/history.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/history.c b/src/history.c index 57e556f7..bd77fe7d 100644 --- a/src/history.c +++ b/src/history.c | |||
@@ -268,14 +268,16 @@ const iStringArray *searchContents_History(const iHistory *d, const iRegExp *pat | |||
268 | iString entry; | 268 | iString entry; |
269 | init_String(&entry); | 269 | init_String(&entry); |
270 | iRangei cap = m.range; | 270 | iRangei cap = m.range; |
271 | cap.start = iMax(cap.start - 4, 0); | 271 | cap.start = iMax(cap.start - 15, 0); |
272 | cap.end = iMin(cap.end + 10, (int) size_Block(&resp->body)); | 272 | cap.end = iMin(cap.end + 15, (int) size_Block(&resp->body)); |
273 | iString content; | 273 | iString content; |
274 | initRange_String(&content, (iRangecc){ m.subject + cap.start, m.subject + cap.end }); | 274 | initRange_String(&content, (iRangecc){ m.subject + cap.start, m.subject + cap.end }); |
275 | /* This needs cleaning up; highlight the matched word. */ { | 275 | /* This needs cleaning up; highlight the matched word. */ |
276 | 276 | replace_Block(&content.chars, '\n', ' '); | |
277 | } | 277 | // insertData_Block(&content.chars, 10, uiTextStrong_ColorEscape, 2); |
278 | format_String(&entry, "match len:%zu str:%s", size_String(&content), cstr_String(&content)); | 278 | // insertData_Block(&content.chars, size_String(&content) - 10, uiText_ColorEscape, 2); |
279 | format_String( | ||
280 | &entry, "match len:%zu str:%s", size_String(&content), cstr_String(&content)); | ||
279 | deinit_String(&content); | 281 | deinit_String(&content); |
280 | //appendRange_String(&entry, ); | 282 | //appendRange_String(&entry, ); |
281 | appendFormat_String(&entry, " url:%s", cstr_String(&url->url)); | 283 | appendFormat_String(&entry, " url:%s", cstr_String(&url->url)); |