Skip to content
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

Implemented better indent control in TextRendererBase #838

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Melodi17
Copy link

  • Added method for clearing all indents
  • Added logic in PopIndent for when indents are below 1 (TODO mentioned implementing this)

@@ -174,10 +174,12 @@ public void PushIndent(string[] lineSpecific)

public void PopIndent()
{
// TODO: Check
indents.RemoveAt(indents.Count - 1);
if (this.indents.Count > 0)
Copy link
Owner

Choose a reason for hiding this comment

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

This is not better, because it hides the fact that there are more PopIndent than push, which is a bug, so this PR hides bugs. The TODO: Check was to say "provide a better error message" instead of failing with list removal.

Copy link
Author

Choose a reason for hiding this comment

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

Ah, my bad sorry. I've added an exception to be thrown when it is empty.

Copy link
Author

Choose a reason for hiding this comment

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

(Sorry for the late response)

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.

2 participants