This commit adds markup support for code blocks, styling them in a
conservative manner, similar to blockquotes, solely indenting them.
Partially fixes#90
Code-wise, this means marking up around the cursor becomes exponentially
more complex, as a change in one line can affect multiple lines. Solving
it is non-trivial, so the whole document is always marked up.
Marking up the whole document is irrelevant for small to medium
documents, but can incur in a performance penalty for
very large documents (empirical testing: 1M characters takes ~0.15s).
To alleviate this, GLib.idle_add is used to ensure that markup is only
parsed and applied when the UI is idle. Again, small to medium-sized
documents see no difference. For very large documents, markup will be
slightly delayed to allow for a fluid typing experience.
It's important to note that the previous flows frequently used full
document markup: paste, focus mode, and search and replace.
In some extreme cases, doubly parsing (eg. paste + text change).
For very large documents, doing any of these actions would freeze the UI
unconditionally, so in more ways than one this is an upgrade.
Lastly, it's a little overzealous: with over 1M characters the UI itself
struggles more than parsing.
In sum:
* Markup is always applied to the whole document
* The code is simpler
* There is never double work
* Markup is applied when the UI is idle, for a more smooth experience
* Multi-line formatting is now possible to do reliably
Changes include:
* Much better encapsulation of textview/textbuffer, with each isolated
responsibility living independently on its own class/file.
* Less code overall
* Various small fixes around the components involved, such as:
* Indentation of nested lists (fixes#120)
* Unwanted scroll on select all (ctrl+a)
* Removal of unused code around the components involved
* Fixes for scrollbar location, now at the edge of the window