Extra newline when pasting "abc\n"

Showing 1-10 of 10 messages
Extra newline when pasting "abc\n" Bobby 2/3/12 6:35 PM
Looks like a recently introduced bug. When pasting text ending with a
newline, an extra newline is introduced.

Pasting "abc\n" three times yields "abc\n\nabc\n\nabc\n". It works as
expected if pasting is interleaved with mouse clicks. Perhaps the
cursor position is not being set correctly after pasting?

Bobby
Re: [CodeMirror] Extra newline when pasting "abc\n" Peter Kroon 2/4/12 1:30 AM
I just tried to reproduce this at: http://codemirror.net/mode/clike/index.html 
Pasting abc\n on line 2 does not create a newline for me.
When pressing enter after abc\n I get a newline with indention.
Not sure if this is standard behaviour.

2012/2/4 Bobby <bobby...@gmail.com>

Bobby

--
You are receiving this because you are currently a member of the CodeMirror Google group. To send something to list, use codem...@googlegroups.com, to unsubscribe, send a message to codemirror-...@googlegroups.com.

Re: [CodeMirror] Extra newline when pasting "abc\n" Marijn Haverbeke 2/6/12 2:35 AM
This appears to be a Webkit bug that's been open for over a year [1].
CodeMirror uses a textarea to read input, so bugs in the underlying
textarea implementation will shine through. A workaround with adding
extra bogus characters to the end of the textarea would be possible,
but I think this isn't a major enough problem to justify such an
invasive hack, which is likely to cause new issues. So I guess putting
pressure on the Webkit people to fix this is your best option.

[1]: https://bugs.webkit.org/show_bug.cgi?id=49288

Best,
Marijn

Re: [CodeMirror] Extra newline when pasting "abc\n" Peter Kroon 2/6/12 3:42 AM
Sorry, I don't get it.
When pasting abc\n in a textarea in a WebKit browser(Canary, Safari tested W7)  doesn't give me a new line at all.
Only 1 newline when pressing enter.

2012/2/6 Marijn Haverbeke <mar...@gmail.com>

--
You are receiving this because you are currently a member of the CodeMirror Google group. To send something to list, use codem...@googlegroups.com, to unsubscribe, send a message to codemirror-...@googlegroups.com.

Re: [CodeMirror] Extra newline when pasting "abc\n" Marijn Haverbeke 2/6/12 3:44 AM
You have to paste it multiple times in a row, as described in the
original report.
Re: [CodeMirror] Extra newline when pasting "abc\n" Peter Kroon 2/6/12 3:46 AM
I did, same result on my machine here..

2012/2/6 Marijn Haverbeke <mar...@gmail.com>
You have to paste it multiple times in a row, as described in the
original report.

--
You are receiving this because you are currently a member of the CodeMirror Google group. To send something to list, use codem...@googlegroups.com, to unsubscribe, send a message to codemirror-...@googlegroups.com.

Re: [CodeMirror] Extra newline when pasting "abc\n" Ken Demarest 9/10/12 4:26 PM
I am seeing this on Chrome in Linux.  I think I could make a fix if I could detect when a paste has just occurred.

Marijn, is there a non-hacky way to detect a paste?

Ken
Re: [CodeMirror] Extra newline when pasting "abc\n" Marijn Haverbeke 9/11/12 4:45 AM
There's the 'paste' event, which fires right *before* a paste, but is
not entirely reliable.

This bug has been fixed in Webkit. I guess, but haven't tested that
Chrome's dev channel already contains the fix. So my plan is to just
ride it out, since Chrome users upgrade quickly.
Re: [CodeMirror] Extra newline when pasting "abc\n" Michaël de Groot 7/14/13 2:04 PM
I'm still experiencing this bug (not on CodeMirror but on another project..), is it fixed in CodeMirror by now? 

Op dinsdag 11 september 2012 13:45:57 UTC+2 schreef Marijn Haverbeke het volgende:
Re: [CodeMirror] Extra newline when pasting "abc\n" Marijn Haverbeke 7/24/13 11:07 PM
I can't reproduce this on Chrome 29 anymore, so I believe it is really fixed.
> --
> --
> You are receiving this because you are currently a member of the CodeMirror
> Google group. To send something to list, use codem...@googlegroups.com, to
> unsubscribe, send a message to codemirror-...@googlegroups.com.
> ---
> You received this message because you are subscribed to the Google Groups
> "CodeMirror" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to codemirror+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>