From cd8d158a004df01efa47923fae1177ffa1e0a385 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 17 Jul 2015 13:16:12 -0700 Subject: [PATCH] When splitting selection into lines, destroy original selection last This avoids an assertion failure due to destroying the last selection, so we can reduce the noise and find code paths that destroy it incorrectly. --- src/text-editor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 5677742b6..e5c4cd749 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -976,13 +976,13 @@ class TextEditor extends Model range = selection.getBufferRange() continue if range.isSingleLine() - selection.destroy() {start, end} = range @addSelectionForBufferRange([start, [start.row, Infinity]]) {row} = start while ++row < end.row @addSelectionForBufferRange([[row, 0], [row, Infinity]]) @addSelectionForBufferRange([[end.row, 0], [end.row, end.column]]) unless end.column is 0 + selection.destroy() return # Extended: For each selection, transpose the selected text.