mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 21:11:35 -07:00
Merge pull request #1376 from ngzhian/autofix
Add method to apply a multi-line replacement
This commit is contained in:
commit
ecd61bfc68
4 changed files with 107 additions and 40 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue