iconv: Ignore unrepresentable characters when transliterating

Certain characters where causing iconv() to fail, which resulted in
buggy rendering. By adding "//IGNORE" to the already existing
"//TRANSLIT" flag unrepresentable characters are automatically removed
from the resulting output.

    > echo "Nguyễn Thái Ngọc Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT
    Nguy
    iconv: (stdin):1:4: cannot convert
    > echo "Nguyễn Thái Ngọc Duy" | iconv -f UTF-8 -t ASCII//TRANSLIT//IGNORE
    Nguyn Th'ai Ngc Duy
iconv: Move draw_chars encoding code to IO module
iconv: Convert characters before trimming text before rendering

By first trimming and then transliterating, characters which need two
characters to represent would cause the rendered text to get out of
alignment. An example can be seen by running:

	$ LANG=C ./tig 2324d6120c5de58f63b32b876bd33e99d7375dbb

Fix the misalignment by reversing the operations so that text is trimmed
after it has been transliterated.

Fixes #86
iconv: Remove unnecessary length argument to encoding_iconv
iconv: Consolidate convert methods into one single backend
stash: Use main view infrastructure for the stash view

Change the output to use "--pretty=raw", which is compatible with the
main view. This simplifies the parsing of the 'stash{X}' ID by using the
emitted 'Reflog' line and displays the stash date for free.

The reference to the stash is stored as the commit->id for easy access
when updating the status line (view->ref).

Fixes #169
stash: Refactor ID drawing method

Simpify the main method (draw_id) and add custom method for more
advanced requirements.
stash: Ensure that the whole stash@{_} text is shown

Fixes #169
stash: Highlight the diffstat of combined diffs

Fixes #169
Add log_select function to find commit from context in log view

This commit introduces and uses the log_select function to find the
correct commit in the unsplit log view. In the log view, if one
scrolls down across a commit line, the current commit (as displayed in
the status bar) gets updated, but not so when scrolling upward across
a commit. The log_select function handles this scenario to do the
``right thing''. In addition, it introduces the log_state structure as
the private entry of the log view to hold a flag that decides whether
to re-evaluate the current commit based on scrolling.

Signed-off-by: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
Display correct diff the context in split log view

In the log view, when scrolling across a commit, the diff view should
automatically switch to the commit whose context the cursor is on in
the log view. This commit changes things to catch the REQ_ENTER in the
log view and handle recalculation of the commit and diff display from
log_request, rather than delegating it to pager_request. In addition,
it also gets rid of unexpected upward scrolling of the log view.

Fixes GH #155

Signed-Off-By: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
Revert "Scroll diff with arrow keys in log view"

This reverts commit 888611dd5d407775245d574a3dc5c01b5963a5ba. This is
because, in the re-engineered log view, scrolling the log with the
arrows now updates the diff in the diff view when the screen is
split. This resembles the earlier behaviour, and is also what users of
software like Mutt (which uses the pager view concept) would expect.

Signed-Off-By: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>

Conflicts:
	tig.c