Use existential operator instead of conditionally adding subscriptions
Check for null or undefined `subscription`

Instead of null or undefined method `dispose` on it.
Add test for non text editors
Merge branch 'refactor-events'