-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search window and search results improvements #37
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm surprised that the compiler can't tell that relative_path is initialized in every one of the three branches below. Oh well, just give it a default value.
htmlSAXParseDoc() is deprecated and replaced by passing a HTML SAX parser context to htmlCtxtReadDoc(). Pass flags (no network access) and free the document tree afterwards, which should have been done previously.
Apparently at some point they contained a space, but no longer do. Use sscanf() to be less sensitive to this and write the code more robustly.
Referencing email conversation about "Type" being an odd name for this column.
The doc pages give a sort string, which we parsed but didn't use. Add a GtkTreeModelSort which sorts the results as intended.
The anchor and example title pointers were copied over and freed twice. Just don't use g_slice_dup(), it's too confusing about how the fields of the struct are filled in and we need to overwrite most of them anyway.
In the search results window, a lot of visual space was taken up by consecutive whitespace. Collapse it in html_to_ascii(). With this, we also no longer need to append spaces after <br> and <p> elements.
Previously, the old search results wouldn't be cleared, and the new results would appear among them.
A CellArea with two CellRendererText does not actually do what we want here, because the renderers form their own columns within the cell.
These don't display any differently in the search results window, but they should take you to the correct anchor when clicked. For this we need to revisit our previous assumption that subsections are not nested, and give Ctxt a stack of outer doctexts and contents, instead of just one.
I suspect that this is already the default behaviour if we don't provide a callback.
Without this, you'll get an error (and a blank row) if you search for a term with an ampersand, or there is an ampersand around the term that you search for.
Grabbing a certain number of bytes before and after the search term to display will mostly work for English text. But not always! We might end up chopping a multibyte character in half. Detect if this happens and shorten the string not to include the invalid character.
56175d1
to
1300365
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.