Closed theoriginalbit closed 11 years ago
I fixed the duplication issue, how do you suppose I detect a copy and paste from a user input?
well I'm not too sure because I haven't read your code thoroughly but I'm assuming when you have user input you pass it to a function that deals with duplicating the appropriate symbols? If so then just have the paste bypass that and just do a straight concat?
Yeah, but how do I detect a paste? :P How do I tell the difference between the user typing something, and CC typing something as a paste?
EDIT: hang on, were you talking about pasting lines, or when control+v is pressed?
You can detect pasting with ctrl+v or when the char event gets multiple chars inside the string
o.O so that's why the edit program does x = x+char:len() instead of x = x+1...
But if that's the case, then this shouldn't cause problems (I think). I'll look into it.
I've had a look and I can't see it... where do you actually handle the paste?
BIT: I don't handle pastes. CC just converts every letter of the paste into a char event.
superaxander: a paste isn't treated as a single char event. I just tested it. http://i.imgur.com/aXsOwpF.png
So basically there's no way for me to differentiate between the user pressing a key and CC pasting something in, so I can't actually do this BIT :( (that is, the part about stopping pasting from triggering the double "") Also, this won't happen when using the built in paste line function.
Ok. But I still recommend using the length cause I know many auto-typers that use multiples letters in one char event and it makes it easier for my os to copy paste into your program :+1:
Added that and fixed the first part of BIT's post.
Your code completion is causing duplication issues. ideally when you press ' and there is a ' after the cursor it should just move the position and not actually add in another '.
When copy/pasting text in all the auto added characters are added, you should not do this to pasted text example