GNOME Bugzilla – Bug 785959
Full Text Search: update how the snippet is showed
Last modified: 2017-08-08 10:36:07 UTC
See patch.
Created attachment 357136 [details] [review] list-view: display snippet next to filename Instead of showing the snippet under the filename, show it next to the filename.
Created attachment 357137 [details] [review] list-view: fix snippet newline removal Removing only \n from the snippet is not enough, as there are also other newline characters. Use a GRegex to match those new line chars and remove them.
Created attachment 357139 [details] [review] list-view: fix snippet newline removal Removing only \n from the snippet is not enough, as there are also other newline characters. Use a GRegex to match those new line chars and remove them.
Created attachment 357141 [details] [review] list-view: display snippet next to filename Instead of showing the snippet under the filename, show it next to the filename.
Review of attachment 357139 [details] [review]: The approach seems correct, but I think there's a couple minor things to fix :). ::: src/nautilus-list-view.c @@ +1615,3 @@ if (snippet) { + GRegex *regex = g_regex_new ("\\R", 0, G_REGEX_MATCH_NEWLINE_ANY, NULL); I would prefer that the regex were compiled once for the whole view (eg. keep as private data), so just g_regex_replace() happens here. Compiling a regex is IMO expensive enough that we want to take it out of such an often called function. @@ +1621,3 @@ + -1, + 0, + "", It would probably be better to replace newlines with an space character so "this\ntext" doesn't look like "thistext"
Comment on attachment 357141 [details] [review] list-view: display snippet next to filename Looks good!
Created attachment 357178 [details] [review] list-view: fix snippet newline removal Removing only \n from the snippet is not enough, as there are also other newline characters. Use a GRegex to match those new line chars and remove them.
Comment on attachment 357178 [details] [review] list-view: fix snippet newline removal Looks good!
Attachment 357141 [details] pushed as c0b9039 - list-view: display snippet next to filename Attachment 357178 [details] pushed as 85c28ff - list-view: fix snippet newline removal