Centralize finding the visual cursor in a global function.