Improve scoping
Dont notify plugins if buffer is open