Questions tagged [copy-paste]

For issues relating to cut, copy, and paste operations.

The term "copy-and-paste" refers to the popular, simple method of reproducing text or other data from a source to a destination. It differs from cut and paste in that the original source text or data does not get deleted or removed. The popularity of this method stems from its simplicity and the ease with which users can move data between various applications visually – without resorting to permanent storage.

Source: Wikipedia

3477 questions
28
votes
4 answers

Copying to global clipboard does not work with Java in Ubuntu

The following code from a standalone application works in ubuntu: import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import…
Karussell
  • 17,085
  • 16
  • 97
  • 197
27
votes
5 answers

Copy syntax-coloured code block as rtf in intelliji IDEA?

Is there a simple way to copy syntax-coloured code block as rtf in intellij IDEA?
qwazer
  • 7,174
  • 7
  • 44
  • 69
26
votes
9 answers

Copy-paste into Python interactive interpreter and indentation

This piece of code, file test.py, if 1: print "foo" print "bar" can be successfully executed with execfile("test.py") or python test.py, but when one tries to copy-paste it into a Python interpreter: File "", line 3 print "bar" …
pms
  • 4,508
  • 4
  • 25
  • 30
26
votes
4 answers

SwiftUI - how to copy text to clipboard?

How does one copy the contents of a Text field to the iOS clipboard? I have the following code & want to replace the "print(..)" statement with a statement that copies the content of the text field to the iOS…
Gerard
  • 1,807
  • 4
  • 13
  • 20
26
votes
4 answers

Do tools exist which automatically find copy-and-paste code?

Are there tools out there which could automatically find copy-and-paste code among a set of files? I was thinking of writing a script for this, which would just search for equal strings, but such script would find mostly irrelevant equalities. (Such…
25
votes
3 answers

MS Excel adds line break when copying a cell

MS Excel 2010 or 2007 or any version for that matter when you copy a cell(not selecting text from the cell) and pasting to any editor adds a line break and sends the cursor to next line. Its annoying to move up the cursor back to last line. It…
Srujan Kumar Gulla
  • 5,721
  • 9
  • 48
  • 78
25
votes
2 answers

Javascript OnPaste

I have this right now: This does infact work, except, it returns a blank alert window. I don't get any value. Help?
Jake
  • 1,469
  • 4
  • 19
  • 40
24
votes
5 answers

Why does copying multi-row text from Google Sheets to the Instagram caption box add a quote mark at the beginning and end of the text?

This may be the most niche question ever but let's try it anyway. I have a Google Sheets spreadsheet that contains cells with multiple lines of text. Each line of text is separated by a soft break. As shown below, when I copy the contents of a cell…
zgall1
  • 2,865
  • 5
  • 23
  • 39
24
votes
6 answers

JavaScript copy to clipboard not working

I have a function in my script that gives me an error. The function purpose is to copy text from static panel(not textbox or input) with onClick event. Uncaught TypeError: copyText.select is not a function The thing i want is to make the user able…
user7570296
23
votes
2 answers

Get text from clipboard using GetText - avoid error on empty clipboard

I'm using code like this to get text from off the Clipboard. Dim DataObj As New MSForms.DataObject DataObj.GetFromClipboard myString = DataObj.GetText I use error handling to get the past the case where the Clipboard is empty, and everything is…
Roy
  • 653
  • 2
  • 11
  • 20
23
votes
4 answers

Can't paste (Command+V) into an NSTextField

For some reason, an NSTextField isn't allowing me to paste anything into it using Command+V, though I can paste into it if I right-click and click 'Paste'. Why is this happening and how do I fix it?
Chetan
  • 46,743
  • 31
  • 106
  • 145
23
votes
2 answers

Turn Off Whole Line Copy in Visual Studio

There is a setting in Visual Studio 2010 to turn off copy and cut commands when the cursor is on a blank line and there is no selection. However, when the cursor is not on a blank line and you press ctrl+C, it always copies the entire line to the…
James L.
  • 9,384
  • 5
  • 38
  • 77
22
votes
5 answers

selecting in visual mode to paste outside vim window

I need to paste some selected block in visual mode to outside of vim. Currently I need to select this block manually from mouse to paste outside of vim. As selecting texts in visual mode is easier ,it would be efficient to select some text for…
shampa
  • 1,350
  • 3
  • 13
  • 22
22
votes
4 answers

Copying stuff from vim running in putty

I am running Vim 6.3 through putty and putty connection manager. I have the mouse option set (set mouse = a). I am able to paste things from the (windows) clipboard to vim by but selecting text in vim isn't copying anything to the clipboard. Does…
Pulkit Sinha
  • 2,654
  • 4
  • 19
  • 20
22
votes
2 answers

Visual Studio 2010: While debugging, how can I copy string values containing carriage returns out of variables?

When I am stepping through code in c# (not sure if it's an issue in VB.NET) and looking at SQL stored in a string variable, sometimes I like to copy it and paste it into Notepad or my SQL program. If it contains carriage returns, though, it…
oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206