-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Infinite loop in countColumn
with tab indentation
#1502
Comments
Attached patch should solve this. |
Thank you for looking into this! With a slightly modified document, the infinite loop still happens:
As before, the infinite loop occurs in In the above screenshot, the input string has length |
FIX: `countColumn` no longer loops infinitely when given a `to` that's higher than the input string's length. Issue codemirror/dev#1502
Indeed, there are multiple call like the one I fixed. I've gone ahead and made |
Describe the issue
Summary
An infinite loop occurs in some cases during list completion in a Markdown editor with tab indentation.
Reproduction steps
To reproduce:
* * * * * a
as the first line (try-it link):At this point, an infinite loop occurs.
Debugging
Pausing script execution soon after the start of the loop, Chrome's developer tools suggest that the issue is in
@codemirror/state
'scountColumn
:Above,
countColumn
has the following input:string
is "\t\t*
".tabSize
is 4.to
is 6.Browser and platform
Chromium Version 131.0.6778.139 (Official Build) snap (64-bit) on Ubuntu 24.04
Reproduction link
https://codemirror.net/try/#c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge21hcmtkb3dufSBmcm9tICJAY29kZW1pcnJvci9sYW5nLW1hcmtkb3duIgppbXBvcnQge2luZGVudFVuaXR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmd1YWdlIgoKbGV0IHZpZXcgPSBuZXcgRWRpdG9yVmlldyh7CiAgZG9jOiAiKiAqICogKiAqIGEiLAogIGV4dGVuc2lvbnM6IFsKICAgIGJhc2ljU2V0dXAsCiAgICBpbmRlbnRVbml0Lm9mKCdcdCcpLAogICAgbWFya2Rvd24oKQogIF0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5Cn0pCg==
The text was updated successfully, but these errors were encountered: