summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-05-29 05:48:40 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-05-29 05:48:40 +0100
commit49ab0c101a1cef1a5c57e4e2dec3160309510d7a (patch)
tree880b5319351765cf6898574fea6346ee78508673 /src/normal.cc
parente1c9e42213750e16cafdd0deae9accf61633e5e5 (diff)
Use forward iteration on selections, and take advantage of it when updating
SelectionList::update now is optimized for the common case where changes are sorted, the algorithm is O(m*n) with m the number of sorted ranges in the changes. In the common case, m should be very small.
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 223d5075..cc7eaa88 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -463,6 +463,7 @@ void erase_selections(Context& context, int)
RegisterManager::instance()['"'] = context.selections_content();
ScopedEdition edition(context);
context.selections().erase();
+ context.selections().avoid_eol();
}
void cat_erase_selections(Context& context, int)
@@ -473,6 +474,7 @@ void cat_erase_selections(Context& context, int)
str += sel;
RegisterManager::instance()['"'] = memoryview<String>(str);
context.selections().erase();
+ context.selections().avoid_eol();
}