A simple implementation of move_text.

This should probably be replaced by a more efficient implementation in
the future, as this version will be slow and require large allocations
when moving large pieces of text.  But let's wait and see if it's a
problem in practice first.
This commit is contained in:
Nathan Vegdahl 2015-01-11 00:26:39 -08:00
parent 8a51a796ce
commit dfcf9fc6a5

View File

@ -143,8 +143,11 @@ impl Buffer {
} }
// All other cases // All other cases
else { else {
// TODO // TODO: a more efficient implementation that directly
return; // manipulates the node tree.
let s = self.string_from_range(pos_a, pos_b);
self.remove_text(pos_a, pos_b);
self.insert_text(s.as_slice(), pos_to);
} }
} }