933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
|
# File 'lib/textbringer/buffer.rb', line 933
def delete_region(s = @point, e = mark)
check_read_only_flag
old_pos = @point
s, e = Buffer.region_boundaries(s, e)
update_line_and_column(old_pos, s)
save_point do
str = substring(s, e)
@point = s
adjust_gap
len = e - s
@contents[@gap_end, len] = "\0" * len
@gap_end += len
@marks.each do |m|
if m.location > e
m.location -= len
elsif m.location > s
m.location = s
end
end
push_undo(DeleteAction.new(self, old_pos, s, str))
self.modified = true
end
end
|