[Lazarus] Where can I switch OFF automatic copy in code editor?

Bo Berglund bo.berglund at gmail.com
Mon Jul 20 06:56:48 CEST 2020


On Sun, 19 Jul 2020 22:48:58 +0200, Martin Frb via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>On 19/07/2020 22:27, Bo Berglund via lazarus wrote:
>> I try to enter ifdef/endif blocks into my code and so I have this
>> copied to the clipboard:
>>
>> {$IFDEF USE_ANALYZER}
>> {$ENDIF}
>>
>> When I get to a block I want to condition I put the cursor at the
>> beginning of the block and paste these lines.
>> Then I select the second line I pasted and drag it to the end of the
>> block so it covers the whole block.
>>
>> Next I find the subsequent block to treat and I place the cursor at
>> the start and make a Ctrl-V to paste.
>> But now only the line
>> {$ENDIF}
>> is pasted!
>>
>> Where can I switch this strange behaviour OFF!
>> I am using Lazarus 2.0.8 with FPC 3.0.4 on Raspbian Linux.

>
>On Linux you should have 2 clipboards.
>One  is automatically assigned, if you select text. It is used for 
>pasting via middle mouse button. (it only reacts OnRequest)
>
>Afaik there isn't an option for that.
>This is the first time I hear that this replaces the other clipboard....
>
>See TCustomSynEdit.AquirePrimarySelection;
>
>
>Unless something happens during dragging... (I could not find anything 
>in the code from a cursory look)
>If you just select the text, and then do ctrl-v, do you get the original 
>clipboard, or the selection?
>

>> And I rearrange the code frequently by using mouse moves (dragging).

>If you use trunk, you can move lines (or selected lines, or even random 
>selection) up and down via keyboard.
>
>   ecMoveLineUp:          VK_UP,[XCtrl, ssShift, ssAlt]);  // or 
>selected lines
>   ecMoveLineDown:     VK_DOWN,[XCtrl, ssShift, ssAlt]); // or selected 
>lines
>   ecDuplicateLine:        VK_INSERT,[XCtrl, ssShift, ssAlt]); // or 
>selected lines
>
>   ecMoveSelectUp:      VK_NUMPAD8,[XCtrl, ssAlt]);
>   ecMoveSelectDown: VK_NUMPAD2,[XCtrl, ssAlt]);
>   ecMoveSelectLeft:     VK_NUMPAD4,[XCtrl, ssAlt]);
>   ecMoveSelectRight:  VK_NUMPAD6,[XCtrl, ssAlt]);
>   ecDuplicateSelection: VK_NUMPAD0,[XCtrl, ssAlt]);
>
>(You can also add to the clipboard, collecting content from diff places. )

I cannot find any of this in the Lazarus Tools/Options tree...
Are you referring to the source code of Lazarus itself?

But I made a test now and just selecting text does not put it into the
clipboard.

But when a line that is selected inside the code editor is moved using
the mouse, then it replaces whatever is in Clipboard.

If something in a line is selected and moved then what gets into the
clipboard is the first character of that selection!!!
What a strange functionality!

I have no clue about any secondary clipboard, I use Notepad++ on my
Windows laptop and that is where I copied the two lines.

Then inside the RaspberryPi VNC session where I run Lazarus I could
paste it into the code editor until such time as when I have dragged
something using the mouse in Lazarus. Following that the clipboard
contains the moved text instead.


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list