mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Fix Source::Corrector#remove_{leading,trailing}
methods
This commit is contained in:
parent
09aea3da32
commit
e54e5d0534
1 changed files with 2 additions and 2 deletions
|
@ -57,14 +57,14 @@ class Ameba::Source
|
||||||
# If *size* is greater than the size of the range, the removed region can
|
# If *size* is greater than the size of the range, the removed region can
|
||||||
# overrun the end of the range.
|
# overrun the end of the range.
|
||||||
def remove_leading(location, end_location, size)
|
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
|
end
|
||||||
|
|
||||||
# Removes *size* characters from the end of the given range.
|
# Removes *size* characters from the end of the given range.
|
||||||
# If *size* is greater than the size of the range, the removed region can
|
# If *size* is greater than the size of the range, the removed region can
|
||||||
# overrun the beginning of the range.
|
# overrun the beginning of the range.
|
||||||
def remove_trailing(location, end_location, size)
|
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
|
end
|
||||||
|
|
||||||
private def loc_to_pos(location : Crystal::Location | {Int32, Int32})
|
private def loc_to_pos(location : Crystal::Location | {Int32, Int32})
|
||||||
|
|
Loading…
Reference in a new issue