When typing fast the webview would jump to the top, which was super annoying. This is an attempt to fix the symptom but it doesn't really address the real cause. Thanks to "moebiuseye" for the patch.
Add a plugin-specific .gitignore file containing `markdown_parser.c` and the built `leg` binary. Add an include directory for compiling the generated .c file with Waf. (I guess) because it's now using the built file in `_build_` dir instead of the `markdown_parser.c` that was checked-in.
…g the build process
Instead of triggering an exception if Discount can not be found, expect it might not be available.
It makes no attempt to use the built-in peg-markdown library or add the configure option like Autotools has to enable using it. I have no idea how to do this in Waf.
Default is to try and use system's Discount library and if not available or configured with --enable-peg-markdown, use the bundled peg-markdown library.
Remove Discount due to stupid licensing issues. Apparently Discount's style of BSD license cannot be linked into a GPL software. Now using the much simpler but also much slower peg-markdown library. TODO: update Waf build system
Mostly noisy but still makes it easier to see the changes made.
* Make MarkdownViewer a GObject, and a subclass of WebKitWebView * A MarkdownViewer "has a" MarkdownConfig property * Optimize (somewhat) string handling/duplication also using changes to Discount code. * Main plugin code manages the scrolled window holding the MarkdownViewer and monitors the MarkdownViewer's MarkdownConfig for property changes to know when to move the scrolled window between the sidebar and message window notebooks. * Various other cleanups and changes
This avoids the caller having to duplicate the internal string and works for the simple case of the Markdown plugin. Adds function `mkd_compile_document()` which simply compiles a const string to a newly-allocated string, hiding the little bit of extra code needed normally to do this. There's tons of noise in the commit because I had trailing whitespace stripping enabled and I re-indented some of the code to make it more readable (to me).