removeRange
, replaceRangeBy
with negative range duplicates that range
#163
Labels
removeRange
, replaceRangeBy
with negative range duplicates that range
#163
Describe the bug
When the
start
Location
is later in the document thanend
,removeRange
duplicates the source code in the range with start and end invertedremove
range:test remove test
→test removeremove test
replaceRangeBy ... "A"
is likeremoveRange
with "A"` directly between the duplicated sourcesreplace
range:test replace test
→test replaceAreplace test
SSCCE (Short Self-Contained Correct Example)
https://github.com/lue-bird/elm-review-sscce-negative-range
Expected behavior
On the one hand it's good that you will notice that you've switched up
start
andend
by having it duplicated; this exact behavior seems unintentional, though.Possible alternatives are
start
Location
is later in the document thanend
"Additional context
Found this bug by accidentally messing up
start
andend
locations.The text was updated successfully, but these errors were encountered: