Implements bartaz' suggestions in
ihttps://github.com/zedapp/zed/commit/4c178f38275d7e6076f7363656fd1c7fd6abfc58