Handle idle event
Rename getSelectedBuffer to selectedBuffer