Getting the snapshot and restoring the editor with the contents (instead...

... of relying on the snapshot event) when the char/word limit is reached

This is to fix the character/word limit enforcement. The snapshot event mechanism seems to be a bit laggy, so instead of relying on firing those events, a snapshot is saved (if the editor content is within the limits) and restored when the limits are exceeded.