summaryrefslogtreecommitdiffstats
path: root/lib/Language/TECO/Buffer.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Language/TECO/Buffer.pm')
-rw-r--r--lib/Language/TECO/Buffer.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Language/TECO/Buffer.pm b/lib/Language/TECO/Buffer.pm
index 65c0e93..ace2e86 100644
--- a/lib/Language/TECO/Buffer.pm
+++ b/lib/Language/TECO/Buffer.pm
@@ -31,7 +31,16 @@ sub insert {
sub delete {
my $self = shift;
- my $length = shift;
+ my $length;
+ if (@_ > 1) {
+ my $pos = shift;
+ $self->set($pos);
+ $length = shift() - $pos;
+ }
+ else {
+ $length = shift;
+ }
+
if ($length < 0) {
$length = -$length;
$self->offset(-$length);