revamp 'is cursor in mode?' utils