Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
**Master**

- Apply source map section columns only to their first line. [Oskar Eichler](https://github.com/OskarEichler)

Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprockets/blob/master/UPGRADING.md

# 4.4.1
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,5 @@ Please see the [CHANGELOG](https://github.com/rails/sprockets/tree/master/CHANGE

## License
Sprockets is released under the [MIT License](MIT-LICENSE).

Index source map column offsets apply only to the first generated line of each section, while line offsets apply to all lines.
2 changes: 1 addition & 1 deletion lib/sprockets/source_map_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def decode_source_map(map)
if map["sections"]
map["sections"].each do |s|
mappings += decode_source_map(s["map"])[:mappings].each do |m|
m[:generated][1] += s["offset"]["column"] if m[:generated][0] == 1
m[:generated][0] += s["offset"]["line"]
m[:generated][1] += s["offset"]["column"]
end
sources |= s["map"]["sources"]
names |= s["map"]["names"]
Expand Down