Copy and paste using Primary selection in Linux systems
This question applies to all IDE's but since there is no generic forum, I choosed to post it here.
We can copy a piece of code, and paste it in other file, and the IDE takes care of adding the necessary import statements. That is good! (I don't know exactly it is implemented under the hood, it must add some meta information to the copied data)
But there is a small problem for Linux users (that otherwise Jetbrains supports very well, thankyou!).
We have the main Clipboard, and also the Primary Selection, that allows to copy and paste easily using only the mouse, in any application.
The problem is that the above functionality doesn't work here! In the mentioned case, the user would have to add the import statements after pasting.
Please fix that!
请先登录再写评论。
It is possibly because the Primary selection is not recognised as an explicit copy/paste operation to trigger auto import in Settings | Editor | General | Auto Import.
As pointed out here(https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer) primary selection is not common for window style application operations.
----
• PRIMARY selection is typically used by e.g. terminals when selecting text and pasting it by pressing middle mouse button. As in selected text is in Primary Clipboard without any explicit copy action taking place. Quick-Copy is a good name for it. (Not limited to terminal emulators, but as an example.)
• CLIPBOARD is primarily used in connection with MS Windows-style clipboard operations. Select+Copy. The data resides in the buffer.
----
As per the Arch wiki (https://wiki.archlinux.org/title/Clipboard#Selections) you can use Clipboard manager to better synchronize the selections and not have to compromise based on the type of selection you want to use.
----
Note: Clipboard managers (https://wiki.archlinux.org/title/Clipboard#Managers) can significantly change the user experience, for example they might synchronize the PRIMARY and CLIPBOARD selections to emulate a single-clipboard system.
----