File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6161- Force using braces if the block is within a ` Binary ` within the predicate of a loop or conditional.
6262- Make sure ` StringLiteral ` and ` StringEmbExpr ` know that they can be extended by heredocs.
6363- Ensure ` Int ` nodes with preceding unary ` + ` get formatted properly.
64+ - Properly handle byte-order mark column offsets at the beginnings of files.
6465
6566### Removed
6667
Original file line number Diff line number Diff line change @@ -48,8 +48,11 @@ def initialize(start, line)
4848 end
4949 end
5050
51+ # Technically it's possible for the column index to be a negative value if
52+ # there's a BOM at the beginning of the file, which is the reason we need to
53+ # compare it to 0 here.
5154 def []( byteindex )
52- @indices [ byteindex ]
55+ @indices [ byteindex < 0 ? 0 : byteindex ]
5356 end
5457 end
5558
You can’t perform that action at this time.
0 commit comments