From 6a5969e14ac36bcd544b4e4757f3452a8c8b4162 Mon Sep 17 00:00:00 2001 From: Eyal Erez Date: Tue, 22 Jan 2013 15:30:01 -0500 Subject: [PATCH] Adding support for using mc/edit-lines without transient mark mode. --- features/edit-lines.feature | 13 +++++++++++++ mc-edit-lines.el | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/features/edit-lines.feature b/features/edit-lines.feature index 69c40a6..814f784 100644 --- a/features/edit-lines.feature +++ b/features/edit-lines.feature @@ -42,3 +42,16 @@ Feature: Switching from a multiline region to multiple cursors And I go to the front of the word "long" And I press "C-S-c C-S-c" Then I should have 2 cursors + + Scenario: Edit without using transient mark mode + Given I turn off transient-mark-mode + And I insert: + """ + hello + there + """ + And I go to the front of the word "hello" + And I set the mark + And I go to the front of the word "there" + And I press "C-S-c C-S-c" + Then I should have 2 cursors diff --git a/mc-edit-lines.el b/mc-edit-lines.el index 76452cc..d185a2c 100644 --- a/mc-edit-lines.el +++ b/mc-edit-lines.el @@ -35,7 +35,7 @@ Starts from mark and moves in straight down or up towards the line point is on." (interactive) - (when (not (use-region-p)) + (when (not (and mark-active (/= (point) (mark)))) (error "Mark a set of lines first.")) (mc/remove-fake-cursors) (let* ((col (current-column))