CodeMirror>5.16 & Safari 10: Strange behavior with spaces
See original GitHub issueAfter upgrading CodeMirror to 5.21 (from 5.8) in jupyter/notebook, users started encountering a strange bug on Safari 10. I did some investigating and found that this bug starting affecting notebook when upgrading from CodeMirror 5.16 to 5.17.
Demo:
One of the users determined that code cells (Python syntax, etc.) exhibit this behavior:
- Immediately after any delimiter
- e.g.
=
,,
,.
,(
,)
,[
,]
,{
,}
,"
,'
, etc.
- e.g.
- Not within closed delimiters
- Not within compound statement if closed by
:
- e.g. it will occur here
if x =={cursor}
, but not hereif x =={cursor}:
- e.g. it will occur here
Markdown cells (Markdown syntax) exhibit this behavior when typing a single space:
- Unless cursor is at start of a new line
- Unless cursor is placed immediately after closed markup delimiter (e.g.
*text*{cursor}
) - Unless within markup delimiters (e.g.
*text{cursor}*
)
Here is a list commits included in 5.17: https://github.com/codemirror/CodeMirror/commits/master?after=Y3Vyc29yOjiTKo4zLKAvc9OV%2BJnP36dpIuEyKzIwOQ%3D%3D
I have a feeling that this commit might be the culprit although I haven’t been able to resolve this by simply reversing the changes in this commit: https://github.com/codemirror/CodeMirror/commit/2c913e5d2914fdc64df80031544a384940006feb
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
5.22.1 doesn’t appear to exist, but 5.22.2 is on bower now, the first release produced by the automated bower packaging.
I was able to isolate this bug to this commit: https://github.com/codemirror/CodeMirror/commit/e60f4b7dd88b71e227f79200932c028ca047d78e
@marijnh Any idea why this commit would cause the insertion of single spaces to not move the cursor (and then the cursor jumps to the proper position on a subsequent space)?