summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-06-06 19:39:53 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-06-06 19:44:08 +0200
commit2a74b0e9e23e927121908ef534393ffd1b80e8ca (patch)
tree5a7f99c72ff80ed959eb4264f58aaf451d39f7f0 /src/normal.cc
parentcf454ef904a93185c3e5318bc7b5c1d3d08fea39 (diff)
Buffer: insert and erase go back to taking iterators, and return iterators
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc
index a0fba585..fb5306e7 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -474,9 +474,9 @@ void join_select_spaces(Context& context)
SelectionList res = select_all_matches(buffer, sel, Regex{"(\n\\h*)+"});
// remove last end of line if selected
kak_assert(std::is_sorted(res.begin(), res.end(),
- [](const Selection& lhs, const Selection& rhs)
- { return lhs.min() < rhs.min(); }));
- if (not res.empty() and buffer.is_end(buffer.char_next(res.back().max())))
+ [](const Selection& lhs, const Selection& rhs)
+ { return lhs.min() < rhs.min(); }));
+ if (not res.empty() and res.back().max() == buffer.back_coord())
res.pop_back();
return res;
});
@@ -713,7 +713,7 @@ void align(Context& context)
for (auto& sel : selections)
{
CharCount padding = max_col - get_column(sel.last());
- buffer.insert(sel.last(), String{ ' ', padding });
+ buffer.insert(buffer.iterator_at(sel.last()), String{ ' ', padding });
}
}