diff: fix and improve detection of filename
There were a few badly displayed filenames in the diff view:
in case of adding a new empty file, deleting, or copying a file,
the status line displays:
Diff of '(null)'
This is because there is no diff for a copy or a new empty file,
and because the destination for a deletion is shown as /dev/null.
The code used to get the filename corresponding to the displayed changes
is extracted in its own function. It now retrieves the filename from the
diff header line, which is always present and a more reliable data.
This commit also adds the "deleted mode" line type for better coloring.
Signed-off-by: Vivien Didelot <vivien@didelot.org>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>