Add support for overriding `showInvisibles`

Refactors existing code to pass around an `EditorView` instance instead of
`Editor`. Made the code slightly less beautiful, but it will change soon anyway.