Sublime Forum

Copy Edit - fix multiple selection copy/paste

#3

I guess I could try to get it to work in ST2ā€¦ lemme see.

0 Likes

#4

Fixed for ST2. Should work everywhere now.

0 Likes

#5

Thanks ! It works now.

0 Likes

#6

One more ST2 issue. The shortcut key for cutting isnā€™t working for some reason.

0 Likes

#7

ST2, youā€™re killing me! Fixed cut as well.
Also, if youā€™ve never used Sublimeā€™s console (ctrl+`) it is full of useful information about problems.

0 Likes

#8

Awesome, thank you.

0 Likes

#9

Looks cool. Thanks! I canā€™t tell you how many time ST has pissed me off in regards to copy/paste.

0 Likes

#10

Turns out the clipboard solution I was using doesnā€™t work for unicode charactersā€¦ I may have just lost some text. :confused: Iā€™ll try to figure something out soon.

0 Likes

#11

Turns out the clipboard solution works just fineā€¦ but Sublime Text sets the default encoding to ascii (!!!) so that the subprocess communication breaks when communicating with the clipboard helpers. Anyone know how to fix that?

0 Likes

#12

This is awful. Seriously, does anyone know why pyperclip would work just fine in the terminal and literally everywhere but in Sublime Text? ST, why do you have to mess with python so muchā€¦ it works just fine normallyā€¦

0 Likes

#13

Pester Jon to compile it to use unicode :smile:. Not sure if there is some other way. I plan on playing with your plugin this week. But while I say to pester Jon half jokinglyā€¦I am also half serious.

0 Likes

#14

Well as far as I can tell, everything works just fine as long as you donā€™t copy unicode, and the clipboard handler Iā€™m using works just fine with unicode as long as youā€™re not using Sublime Text. Just in case you want to take a look :smile:

0 Likes

#15

Perhaps use decode() on strings ?
effbot.org/zone/unicode-objects.htm

0 Likes

#16

Well, hereā€™s what happens, as far as I can tell. If I call string.encode(ā€˜utf-8ā€™) or whatever, then if I paste into a different application it comes out garbled - I guess the system clipboard isnā€™t utf-8? So somehow I need to be detecting what the system clipboardā€™s encoding is, or convince the clipboard to be utf-8, or I donā€™t know what.

But! If I use the same clipboard module from anywhere thatā€™s not Sublime, I donā€™t need to call string.encode at allā€”it just works (except in Sublime Text, where it flips out when I paste - ā€œcanā€™t decode to asciiā€ by default, or garbles it if I try to decode as utf-8).

A lot of Googling and messing around with the code and I have gotten no further.

0 Likes

#17

I did not reviewed *completely *the code of this package, but, there is two api functions to read and write to clipboard, not sure if there is a good reason to do it in python. If there is a good reason just ignore my post, if not why donā€™t use the sublime API calls?
Thanks for this plugin, is useful

0 Likes

#18

ā€¦Well Iā€™ll be.

0 Likes

#19

[quote=ā€œadzenithā€]

ā€¦Well Iā€™ll be.[/quote]

Thatā€™s funny, for some reason I didnā€™t even think about the API copy/pasteā€¦and I have used it in some of my pluginsā€¦if it were a snakeā€¦

0 Likes

#20

Pushed it real good.
Looks to be 100% now. I can copy and paste Unicode to my heartā€™s content.
Tito: you rock.

0 Likes

#21

Now that itā€™s fixed Iā€™ve pull-requested Package Control.

0 Likes

#22

Just tried your package.
Sadly, it does not behave like ST when copy&paste without selection. The copied line should be pasted on a seperate line, just like vim does with ā€œddpā€.
CopyEdit pastes the copied line at caret position, producing surprising results.

Is this behaviuor intended?

0 Likes