Merge pull request #1376 from ngzhian/autofix

Add method to apply a multi-line replacement
This commit is contained in:
Vidar Holen 2018-12-17 17:24:59 -08:00 committed by GitHub
commit ecd61bfc68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 107 additions and 40 deletions

View file

@ -256,15 +256,13 @@ replaceStart id params n r =
repString = r
}
replaceEnd id params n r =
-- because of the way we count columns 1-based
-- we have to offset end columns by 1
let tp = tokenPositions params
(_, end) = tp Map.! id
new_start = end {
posColumn = posColumn end - n + 1
posColumn = posColumn end - n
}
new_end = end {
posColumn = posColumn end + 1
posColumn = posColumn end
}
in
newReplacement {