summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-01-24 10:33:22 +1100
committerMaxime Coste <mawww@kakoune.org>2018-01-24 10:33:22 +1100
commit220be30f02c8085258bd0e5e26fafe5ac88fad89 (patch)
tree90f8f7e4bec72fddeb9006e5eb49dde69a838179 /src/normal.cc
parentb677797b923dc9edd16161ee59f607ff94c748b6 (diff)
Support multiline selections in C/<a-C>
Fixes #1725
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 6208d01b..bcee1b63 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -1287,9 +1287,10 @@ void copy_selections_on_next_lines(Context& context, NormalParams params)
if (is_main)
main_index = result.size();
result.push_back(std::move(sel));
+ const LineCount height = std::max(anchor.line, cursor.line) - std::min(anchor.line, cursor.line) + 1;
for (int i = 0; i < std::max(params.count, 1); ++i)
{
- LineCount offset = (direction == Forward ? 1 : -1) * (i + 1);
+ LineCount offset = (direction == Forward ? 1 : -1) * (i + 1) * height;
const LineCount anchor_line = anchor.line + offset;
const LineCount cursor_line = cursor.line + offset;