Skip to content
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

trailing newline is lost after paste, in webkit #1474

Closed
jdleesmiller opened this issue Apr 26, 2013 · 1 comment
Closed

trailing newline is lost after paste, in webkit #1474

jdleesmiller opened this issue Apr 26, 2013 · 1 comment

Comments

@jdleesmiller
Copy link
Contributor

One of our users at writelatex reported this:

Example: 'Hello[newline][newline]There'
Copy the Hello and the blank line after it.
Paste at the same point in the document.
The expected result is 'Hello[newline][newline]There'.
The observed result is 'Hello[newline]There'. The blank line disappeared.

It seems to affect both CM 2.38 (which we still use) and CM 3.12 (on the demo pages).

I can reproduce it in Safari 6.0.4 and Chrome 26 stable (Linux & Win XP). It does not occur on FF (WinXP) and IE 8. So, it looks like a webkit issue. I found #598, but that looks like the opposite problem -- extra newline added on paste.

Also, perhaps interestingly, if you copy 'Hello[newline][newline]' from Notepad and paste it into CM, the second newline is lost. However, if you copy 'Hello[newline][newline]' from CM into Notepad, the trailing newline is preserved.

I'm afraid I haven't yet had time to look into why this might be happening, but I figured I'd report it now. Thanks again for your work on this awesome project. :)

@marijnh
Copy link
Member

marijnh commented Apr 29, 2013

I found an already open Webkit bug on this at https://bugs.webkit.org/show_bug.cgi?id=90206 , with a comment from someone who is apparently looking into it.

I did not find a workaround (beyond always attaching a trailing bogus character to the input, which is a bit more invasive than I'd like).

aslushnikov pushed a commit to aslushnikov/CodeMirror that referenced this issue Jul 18, 2013
@marijnh marijnh closed this as completed Jul 25, 2013
@marijnh marijnh reopened this Jul 26, 2013
aslushnikov pushed a commit to aslushnikov/CodeMirror that referenced this issue Jul 29, 2013
marijnh pushed a commit that referenced this issue Jul 29, 2013
@marijnh marijnh closed this as completed Jul 29, 2013
anaran pushed a commit to anaran/CodeMirror that referenced this issue Feb 22, 2014
anaran pushed a commit to anaran/CodeMirror that referenced this issue Feb 22, 2014
anaran pushed a commit to anaran/CodeMirror that referenced this issue Feb 22, 2014
marijnh added a commit that referenced this issue Mar 18, 2014
Issue #1474 was the cause of this hack
Issue #2384 was apparently caused by it

Recent Webkit-ish browsers seem to no longer have the problem that
it was working around.
marijnh added a commit that referenced this issue Mar 18, 2014
Issue #1474 was the cause of this hack
Issue #2384 was apparently caused by it

Recent Webkit-ish browsers seem to no longer have the problem that
it was working around.
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

No branches or pull requests

2 participants