8000 pad results with whitespace - re #190 by indirectlylit · Pull Request #230 · vuejs/vue-loader · GitHub
[go: up one dir, main page]

Skip to content

pad results with whitespace - re #190 #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 25, 2016
Merged
Changes from 1 commit
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
Next Next commit
pad results with whitespace - re #190
  • Loading branch information
indirectlylit committed May 17, 2016
commit 1ebf9483d46397d4548f5d614adb28956b37a23e
5 changes: 4 additions & 1 deletion lib/parser.js
A182
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ module.exports = function (content, filename, needMap) {
} else {
lineOffset = content.slice(0, start).split(splitRE).length - 1
result = deindent(content.slice(start, end))

// pad whith whitespace so that error messages are correct
result = Array(lineOffset+1).join("\n") + result;
}

if (needMap) {
Expand All @@ -128,7 +131,7 @@ module.exports = function (content, filename, needMap) {
map.addMapping({
source: filenameWithHash,
original: {
line: index + 1 + lineOffset,
line: index + 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems after this change, lineOffset is only needed for the padding calculation, so it should be declared directly in the else block above.

column: 0
},
generated: {
Expand Down
0