Skip to content

Indent code past the widest line number #26540

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 2 commits into from
Jul 1, 2015
Merged

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 24, 2015

closes #25037
closes #11715

r? @nrc

@tbelaire
Copy link
Contributor

Yay, thanks for finishing this for me! I started a summer job and got busy. Glad this is landing.

@nrc
Copy link
Member

nrc commented Jul 1, 2015

@bors: r+

@bors
Copy link
Collaborator

bors commented Jul 1, 2015

📌 Commit c5dfd34 has been approved by nrc

@bors
Copy link
Collaborator

bors commented Jul 1, 2015

⌛ Testing commit c5dfd34 with merge a9e26b5...

bors added a commit that referenced this pull request Jul 1, 2015
@nrc
Copy link
Member

nrc commented Jul 1, 2015

@oli-obk sorry, this slipped off my radar, test sounds fine

@bors bors merged commit c5dfd34 into rust-lang:master Jul 1, 2015
dummy.txt:10 \n\
dummy.txt:11 \n\
dummy.txt:12 \n".as_bytes());
}
Copy link
Member

Choose a reason for hiding this comment

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

@oli-obk this test is giving me trouble after making some changes to codemap, the output I get is

dummy.txt: 8         line8
dummy.txt: 9         line9
dummy.txt:10         line10
dummy.txt:11         e-lä-vän
dummy.txt:12         tolv

Which is what I expect from looking at the test. Why does the test not expect the content in vec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because hilight_lines only prints the dummy.txt:line prefix, I couldn't figure out where the actual text gets appended

Copy link
Member

Choose a reason for hiding this comment

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

I figured out what is going on here, new_line declares the start of a line, but the code here finds the end of a line. get_line is a weird function and goes not to the next registered line but to the next \n, therefore, each line you get from the codemap is the zero length string from the end of the previous line. This is fixed in my PR.

@oli-obk oli-obk deleted the issue11715 branch July 3, 2015 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diagnostic doesn't align properly in span where line number increases by one digit
4 participants