Use the notification events instead of an interval

Also fix the preview not working when a dot is the final character (taken from the main template).