wait for ajax after typing in codemirror