Skip to content

API for visible paragraphs works when contents have blank lines #790

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

Closed
wants to merge 2 commits into from

Conversation

lhttjdr
Copy link

@lhttjdr lhttjdr commented Dec 1, 2018

These test cases are for issue #777.

It shows that firstVisibleParToAllParIndex, lastVisibleParToAllParIndex and visibleParToAllParIndex will throw out "Unreachable code" errors when the contents have blank lines/paragraphs.

However, it not always behaves like that.

  • When the paragraphs list start and end with non-blank lines, visibleParToAllParIndex will works correctly even there are some blank lines.
  • When the edit area has scroll bar, its behavior has much more complicated pattern. For example, when visible region only contains blank lines, it will throw out errors. After scroll to some non-blank lines, it will work again.

What I know now is that getVisibleParagraphs returns wrong list corresponding to blank lines, so that all those 3 functions above won't work because it's impossible to find a same item in list returned from getParagraphs.

@Jugen
Copy link
Collaborator

Jugen commented Feb 20, 2019

Thanks, this was covered by the PR fix #795

@Jugen Jugen closed this Feb 20, 2019
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