summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-03-16 13:59:30 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-03-16 13:59:30 +0000
commit131b0a8298b09eac744e6a2cbe8843d2691c3f68 (patch)
tree1b4ccd7e08632dc6de8d24c3152bdf41a4b4c6c7 /src/normal.cc
parentad5da15cfaa2e4b85db9726238ec5ed0c112d1f9 (diff)
Use ByteCoords directly for buffer insert/erase/replace
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 0cfd48ad..c967559e 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -1244,7 +1244,7 @@ void align(Context& context, NormalParams)
auto spaces = targetcol - (tabs ? (tabcol + tabs * tabstop) : inscol);
padstr = String{ '\t', tabs } + String{ ' ', spaces };
}
- buffer.insert(buffer.iterator_at(insert_coord), std::move(padstr));
+ buffer.insert(insert_coord, std::move(padstr));
}
selections.update();
}
@@ -1283,8 +1283,7 @@ void copy_indent(Context& context, NormalParams params)
ByteCount i = 0;
while (i < line.length() and is_horizontal_blank(line[i]))
++i;
- buffer.erase(buffer.iterator_at(l), buffer.iterator_at({l, i}));
- buffer.insert(buffer.iterator_at(l), indent);
+ buffer.replace(l, {l, i}, indent);
}
}