Is there a way to disable smart paste that is injecting original class names into pasted code?
Answered
Hi! Here is an example:
class A {
class C { }
C c;
}
class B {
class C {}
}
Now, if I copy-paste the line "C c;" into class B, it will actually paste "A.C c;" which is undesired behaviour (expected result: "C c;"). Is there a way to disable this? I couldn't find any option. I don't want to disable format on paste either.
Please sign in to leave a comment.
Hi Stanislav,
There's an option to paste the copied text as plain text without formatting.If you right-click anywhere in the Editor after having copied a piece of code, you will see the 'Paste without Formatting' option in the context menu (shortcut: Ctrl+Shift+Alt+V). It should do the trick.
Alternatively, in the File | Settings | Editor | General | Auto Import dialog, you can configure IDEA to either ask you every time whether you want to insert imports on paste (option 'Ask') or not to paste any imports at all (option 'None').