Closed
Conversation
Owner
|
I think it's better to fix iterate_formatting then patch usage if it, I kind of fixed the issue with this snippet: it fixed the issue but break tests because it create empty string for normal cases, will try to fix the issue or just use |
jcubic
added a commit
that referenced
this pull request
Mar 4, 2018
Owner
|
ok, I've fixed the empty string issue, I've just removed |
Contributor
Author
|
Thank you for the better bugfix, hopefully the PR saved you some time debugging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In situations where a line break is at the beginning inside a formatter like [[;;]\n] the line before the break gets ignored. For example A[[;;]\n]B becomes B without any sign of A.
The pull requests adds some tests to detect the problem an tries to correct it by adding/removing a char if necessary.
The problem is that $.terminal.iterate_formatting won't trigger an callback after the last bracket of a line when there is no character following. There are cases where it is correct (just remove 'array[i + 1][0] !== "["' to see the relevant cases fail with an empty line extra, but in our case it leads to ignoring a line.
By adding a char (for example " ") in some situations* we get the necessary callback. By removing the char and marking it as the last_iteraction it adds the line correctly.
There is probably a better way to fix it, but at least the origin of the bug is visible. If the fix isn`t working in all cases or a better way found, i will reduce the pull request to the tests only.
*