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

Martin Frb lazarus at mfriebe.de
Sun Jul 19 22:48:58 CEST 2020


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. )


More information about the lazarus mailing list