Commit e7b7722
authored
Fix indentation parsing (#830)
Inline snapshot testing attempts to figure out the indentation width of
a file by finding the first line with whitespace and grabbing the prefix
of whitespace. While this works fine if you trim whitespace from
whitespace-only lines, it breaks if you do not, because a line of the
form:
```
" \n"
```
Will currently match in its entirety and incorporate the newline into
the indentation.
This PR fixes this by picking the first indented line that contains
non-whitespace characters, instead.1 parent 8e68404 commit e7b7722
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
392 | | - | |
| 391 | + | |
| 392 | + | |
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| |||
0 commit comments