From e54e5d053421d7ea444ff6979ceff1ae066272ca Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Sun, 30 Oct 2022 19:50:25 +0100 Subject: [PATCH] Fix `Source::Corrector#remove_{leading,trailing}` methods --- src/ameba/source/corrector.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ameba/source/corrector.cr b/src/ameba/source/corrector.cr index 97c46e24..646594be 100644 --- a/src/ameba/source/corrector.cr +++ b/src/ameba/source/corrector.cr @@ -57,14 +57,14 @@ class Ameba::Source # If *size* is greater than the size of the range, the removed region can # overrun the end of the range. def remove_leading(location, end_location, size) - remove(loc_to_pos(location), loc_to_pos(location) + size) + @rewriter.remove(loc_to_pos(location), loc_to_pos(location) + size) end # Removes *size* characters from the end of the given range. # If *size* is greater than the size of the range, the removed region can # overrun the beginning of the range. def remove_trailing(location, end_location, size) - remove(loc_to_pos(end_location) + 1 - size, loc_to_pos(end_location) + 1) + @rewriter.remove(loc_to_pos(end_location) + 1 - size, loc_to_pos(end_location) + 1) end private def loc_to_pos(location : Crystal::Location | {Int32, Int32})