vrapper/vrapper — pull request #407 by albertdev (2014-04-05 11:28:05+00:00)
Title: Select last character of file in linewise mode.

Vim modifies the selected lines and includes the last newline of the
selection (except when the last line doesn't have any). It actually
highlights the newline character and places the cursor there.

Eclipse does things differently. To highlight the newline character, you
need to extend the selection to the start of the next line, but the
cursor will then also be drawn on that line. To mimic Vim, Vrapper
simply has two selections: an internal one, including the newline and
one for the UI which doesn't include it.

The problem was in the code calculating the UI selection: it's *always*
one character shorter without checking that we're on the last line of a
file without a newline character.

Fixes #39 and #254.