mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-27 23:46:56 +08:00
Smarter sorting and application of fix to handle multiple replacements
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user