mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 05:21:34 -07:00
Smarter sorting and application of fix to handle multiple replacements
This commit is contained in:
parent
d5ba41035b
commit
3471ad45b1
3 changed files with 57 additions and 39 deletions
|
@ -255,15 +255,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