copy / paste of one line will produce one extra <new line> #598

Closed
soliton4 opened this Issue Jun 25, 2012 · 6 comments

Projects

None yet

2 participants

@soliton4
Contributor
  • go to http://codemirror.net/demo/complete.html
  • klick in the editor to activate it
  • press home as long as it takes to be at first position of a line.
  • press shift + down to select the complete line
  • press ctrl + c to copy it
  • press ctrl + v to paste it once - > ok
  • press ctrl + v again. -> get a extra new line

this is a usual attempt to duplicate a line. but in addition you will get a new line
this happened first somewhen in the 2.2. line. but also in the actual 2.3

thanks for fixing it.
love your project
matthias

@marijnh
Member
marijnh commented Jun 25, 2012

This is a duplicate of #474 which, unfortunately, is a Webkit bug, and not something I can fix on the side of CodeMirror. If you know any Webkit devs, feel free to point their attention towards this bug.

@marijnh marijnh closed this Jun 25, 2012
@soliton4
Contributor

thanks for the info, but i am almost certain with early 2.x versions it was
working correctly.

i am not to sure about how you handle copy and paste, am i right to assume
the marked content is in the textarea and marked, so that when you press
ctrl+c it is copying correctly?
the copy seems to work fine.

paste works the other way arround?
when i copy a line from notepad++ i get the bug.
maybe you could do a workarround on webkit: i just tested what happens when
you indeed insert a line with a extra . codemirror makes 2 so you could change the behaviour in webkit.

and unfortunately i dont know any webkit developers

matthias

On Mon, Jun 25, 2012 at 8:32 PM, Marijn Haverbeke <
reply@reply.github.com

wrote:

This is a duplicate of #747 which, unfortunately, is a Webkit bug, and not
something I can fix on the side of CodeMirror. If you know any Webkit devs,
feel free to point their attention towards this bug.


Reply to this email directly or view it on GitHub:
https://github.com/marijnh/CodeMirror2/issues/598#issuecomment-6555759

@marijnh
Member
marijnh commented Jun 25, 2012

It is indeed probably possible to work around this by adding dummy characters to the textarea. CodeMirror v1 was full of such tricks, and it got to be a major maintenance burden to make sure they didn't interact with each other in problematic ways, so I'm really trying to have as few of them as possible in v2.

That being said, it doesn't seem that the Webkit people are taking any action on this, so maybe a kludge is the only option. Will think about it a bit more.

@marijnh marijnh reopened this Jun 25, 2012
@marijnh
Member
marijnh commented Jun 27, 2012

Update: there's a webkit patch that will hopefully make it into master soon. https://bugs.webkit.org/show_bug.cgi?id=49288

@soliton4
Contributor

cool ;-)
i am using codemirror with dojo and made a widget that makes it easy to use
cm in dojo environment.
would you by any chance interested in that code?

On Wed, Jun 27, 2012 at 11:34 AM, Marijn Haverbeke <
reply@reply.github.com

wrote:

Update: there's a webkit patch that will hopefully make it into master
soon. https://bugs.webkit.org/show_bug.cgi?id=49288


Reply to this email directly or view it on GitHub:
https://github.com/marijnh/CodeMirror2/issues/598#issuecomment-6598878

@marijnh
Member
marijnh commented Jun 27, 2012

Not me, but someone else surely. Put it on github, if you haven't already, with a name or description that'll make it easy to find when people search for 'codemirror dojo'.

@marijnh marijnh closed this Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment