Port of https://github.com/jaredpar/EditorUtils to F#