make in-editor work as close as possible to java version