Skip to content

Inconstant List Indentation - #616

Open
progmem wants to merge 4 commits into
vmg:masterfrom
progmem:615-inconstant-list-indentation
Open

Inconstant List Indentation#616
progmem wants to merge 4 commits into
vmg:masterfrom
progmem:615-inconstant-list-indentation

Conversation

@progmem

@progmem progmem commented May 20, 2017

Copy link
Copy Markdown

Pull request for issue #615

Jason DeLeon added 3 commits May 20, 2017 01:29
…ation

By observing the data available at work->data, an interesting observation was noted that causes the tracking of indentation to be improperly handled. Specifically, the indentation on Item 3 appears to be handled incorrectly, which causes issues when scanning on the next iteration, from Item 2 downward.

To correct this, indentation is first handled as normal, checking up to four characters. We do this by initializing pre to our starting value, 4, then perform the indentation check using pre instead of the fixed value. Since pre is being updated constantly, this allows us to take the current indent and use it to properly crawl the list.

An interesting note is that the test for this issue will fail if you add a sixth-level item. This is due to max_nesting and how nesting is tracked on lists. On a linear list, a max_nesting of (1 + 2 + ... + n) is required, with n being the furthest nesting level. By default, max_nesting is 16, and a list 5 deep works, hitting a nesting of 15. However, with 6 levels, we need a max_nesting of 21 or greater.
@Stargator

Copy link
Copy Markdown

@progmem Can you rebase or resolve the conflict in the branch?

@progmem

progmem commented Sep 2, 2017

Copy link
Copy Markdown
Author

@Stargator Should be good now!

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