Use the buffer changed event instead of keymap to trigger autoclose
Prevents event from triggering in other places e.g. find box