Close documents if open is canceled.

Implements a TODO. While I feel this change is pretty safe, I'm not quite sure
it has correct behavior in every circumstance. Still beats the TODO, though.
Add EOF invisible

I thought this was nice just because, in the very specific case that
a file ends without a newline and invisiblesMap is set to not show
spaces, you couldn't tell whether or not the file ends with spaces.