From 2a74b0e9e23e927121908ef534393ffd1b80e8ca Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 6 Jun 2013 19:39:53 +0200 Subject: Buffer: insert and erase go back to taking iterators, and return iterators --- src/normal.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/normal.cc') 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 }); } } -- cgit v1.2.3