From 99b5675c4eb06c5f7ffa1235783dd99e5aafccf1 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 11 Mar 2014 20:42:42 -0600 Subject: [PATCH] Ensure position is a Point in Selection::selectToPosition Fixes #1750 --- src/selection.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/selection.coffee b/src/selection.coffee index 58492d6f3..13a949c51 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -1,4 +1,4 @@ -{Range} = require 'text-buffer' +{Point, Range} = require 'text-buffer' {Emitter} = require 'emissary' {pick} = require 'underscore-plus' @@ -141,6 +141,8 @@ class Selection # # position - An instance of {Point}, with a given `row` and `column`. selectToScreenPosition: (position) -> + position = Point.fromObject(position) + @modifySelection => if @initialScreenRange if position.isLessThan(@initialScreenRange.start)