Skip to content

cursor misplaced on lines wrapped after a backslash on safari#1825

Closed
jdleesmiller wants to merge 1 commit intocodemirror:masterfrom
jdleesmiller:fix_safari_backslash_wrapping
Closed

cursor misplaced on lines wrapped after a backslash on safari#1825
jdleesmiller wants to merge 1 commit intocodemirror:masterfrom
jdleesmiller:fix_safari_backslash_wrapping

Conversation

@jdleesmiller
Copy link
Copy Markdown
Contributor

This is a suggested fix for the following issue:

Steps to reproduce:

  1. In Safari, go to http://codemirror.net/demo/btree.html
    and enter
type here, see a summary of the document b-tree below blah blah xxx \(1+2\) blah.

so that the line wraps between the "" and the "(".
2. Insert a character on the second line.

The inserted character does not appear in the expected position.

Reported on Safari 5.0.6 on OSX 10.5.8. Reproduced on Safari 6.0.5 on OSX 10.7.5. I couldn't reproduce it on any of the other browsers I tried -- works fine on Chrome 29 on Mac and Windows, FireFox 23 on Mac and Windows, and IE8.

Adding backslash to the final regular expression in spanAffectsWrapping for webkit appears to fix the issue on Safari 6. All tests still pass on Safari 6 & the non-Safari browsers listed above.

This won't help on Safari 5.0.6, which is matched by one of the earlier if-else conditions, but it looks that version is no longer officially supported (Safari 5.2+ only), so I'm not sure about making any other changes.

Note that unlike #1809 this appears to affect old and stable versions of Safari.

marijnh added a commit that referenced this pull request Sep 16, 2013
@marijnh
Copy link
Copy Markdown
Member

marijnh commented Sep 16, 2013

Thanks for figuring that out. In current Webkit builds the bug that necessitates this hack is fixed. But many people will be stuck with older Safaris for ages to come, so indeed this is good to fix. I've pushed a patch (attached) that also adds the backslash to the util script that was used to generate this regexp.

@marijnh marijnh closed this Sep 16, 2013
anaran pushed a commit to anaran/CodeMirror that referenced this pull request Feb 22, 2014
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