We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Text.iterLines
Iterating lines doesn't seem to work correctly when the last line is empty.
Reproduction is based on the original unit test.
No response
https://codemirror.net/try/?c=aW1wb3J0IHsgVGV4dCB9IGZyb20gJ0Bjb2RlbWlycm9yL3N0YXRlJwoKbGV0IGRvYyA9IFRleHQub2YoWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIiwgIiIsICJnIl0pCgpmdW5jdGlvbiBnZXQoZnJvbSwgdG8pIHsKICBsZXQgcmVzdWx0ID0gW10KICBmb3IgKGxldCBpID0gZG9jLml0ZXJMaW5lcyhmcm9tLCB0byk7ICFpLm5leHQoKS5kb25lOykgcmVzdWx0LnB1c2goaS52YWx1ZSkKICByZXR1cm4gcmVzdWx0Cn0KCmZvciAobGV0IGkgPSAxOyBpIDw9IGRvYy5saW5lcyArIDE7IGkrKykgY29uc29sZS5sb2coZ2V0KDEsIGkpKQoKLyogRXhwZWN0ZWQKW10KWyJhYiJdClsiYWIiLCAiY2RlIl0KWyJhYiIsICJjZGUiLCAiIl0KWyJhYiIsICJjZGUiLCAiIiwgIiJdClsiYWIiLCAiY2RlIiwgIiIsICIiLCAiZiJdClsiYWIiLCAiY2RlIiwgIiIsICIiLCAiZiIsICIiXQpbImFiIiwgImNkZSIsICIiLCAiIiwgImYiLCAiIiwgImciXQoqLwoKLyogQWN0dWFsCltdClsiYWIiXQpbImFiIiwgImNkZSJdClsiYWIiLCAiY2RlIl0KWyJhYiIsICJjZGUiLCAiIl0KWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIl0KWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIl0KWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIiwgIiIsICJnIl0KKi8=
The text was updated successfully, but these errors were encountered:
codemirror/state@0f61d04
Thanks for spotting that. Attached patch should help.
Sorry, something went wrong.
No branches or pull requests
Describe the issue
Iterating lines doesn't seem to work correctly when the last line is empty.
Reproduction is based on the original unit test.
Browser and platform
No response
Reproduction link
https://codemirror.net/try/?c=aW1wb3J0IHsgVGV4dCB9IGZyb20gJ0Bjb2RlbWlycm9yL3N0YXRlJwoKbGV0IGRvYyA9IFRleHQub2YoWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIiwgIiIsICJnIl0pCgpmdW5jdGlvbiBnZXQoZnJvbSwgdG8pIHsKICBsZXQgcmVzdWx0ID0gW10KICBmb3IgKGxldCBpID0gZG9jLml0ZXJMaW5lcyhmcm9tLCB0byk7ICFpLm5leHQoKS5kb25lOykgcmVzdWx0LnB1c2goaS52YWx1ZSkKICByZXR1cm4gcmVzdWx0Cn0KCmZvciAobGV0IGkgPSAxOyBpIDw9IGRvYy5saW5lcyArIDE7IGkrKykgY29uc29sZS5sb2coZ2V0KDEsIGkpKQoKLyogRXhwZWN0ZWQKW10KWyJhYiJdClsiYWIiLCAiY2RlIl0KWyJhYiIsICJjZGUiLCAiIl0KWyJhYiIsICJjZGUiLCAiIiwgIiJdClsiYWIiLCAiY2RlIiwgIiIsICIiLCAiZiJdClsiYWIiLCAiY2RlIiwgIiIsICIiLCAiZiIsICIiXQpbImFiIiwgImNkZSIsICIiLCAiIiwgImYiLCAiIiwgImciXQoqLwoKLyogQWN0dWFsCltdClsiYWIiXQpbImFiIiwgImNkZSJdClsiYWIiLCAiY2RlIl0KWyJhYiIsICJjZGUiLCAiIl0KWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIl0KWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIl0KWyJhYiIsICJjZGUiLCAiIiwgIiIsICJmIiwgIiIsICJnIl0KKi8=
The text was updated successfully, but these errors were encountered: