[Lazarus] I say a little prayer (for the Lazarus editor)

duilio foschi octopushole at gmail.com
Sun Feb 21 13:02:03 CET 2021


Hi Martin,

thank you for the detailled instructions.

Re your question

>does the Caret go to the start of the insert, or does it
automatically move one line down too?

in Delphi/column mode, the caret moves one line down at each insert.

1. starting from this status

https://i.ibb.co/jL30yFx/1.jpg

I click ctrl+O+C for column mode

2. I select the text 'peppe'+blank then ctrl-c to save the text into memory

https://i.ibb.co/99DH4gc/2.jpg

3. using the arrow keys, I move the caret 2 lines down...

https://i.ibb.co/ZHGqZx3/3.jpg

4. after I press ctrl-v, the caret moves 1 line down. This is exactly what
I miss in Lazarus :)

https://i.ibb.co/ZT6LJdD/4.jpg

I will try to fix the point.

Thank you

Duilio


On Sun, Feb 21, 2021 at 12:30 PM Martin Frb <lazarus at mfriebe.de> wrote:

> On 21/02/2021 10:02, duilio foschi wrote:
> > Hi Martin,
> >
> > I am too lazy to learn how to use editor scripts.
> >
> > Probably it will be more productive to spend some time to correct the
> > editor code.
> >
> > After all, the Jedi editor - written in Delphi and available in source
> > code - behaves like old Delphi editor in column mode.
> >
> > How can I try to fix the problem?
> >
> > Where is the Lazarus repository with the original code of the Lazarus
> > editor?
> >
>
> Official: https://svn.freepascal.org/svn/lazarus/
> For bugs and patches:
> https://bugs.freepascal.org/set_project.php?project_id=1
>
> I am running a mirror at https://github.com/User4martin/lazarus/
> For most SynEdit and Debugger issues, I can accept pull requests (those
> go to me only, no one else in the team, therefore limited to work I will
> deal with)
>
> SynEdit is in Components/SynEdit
>
> If you are looking for the Search/Replace dialog, afaik its in the
> folder ide/ . Best to start looking from the file ide/SourceEditor.pp .
> But probably you want SynEdit.
>
> SynEdit.pp
> You probably want to look at function TCustomSynEdit.PasteFromClipboardEx
>
> You should know about the caret pos
>
> https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position
>
> You can get/set the caret pas on FCaret.
> Also you will look for   PMode: TSynSelectionMode;
>
> This actually sets the text: FInternalBlockSelection.SetSelTextPrimitive
>
> So then you only need restore the CaretX
>
> ----
> Now this is important, you will see it works on CaretBytePos (logical)
> But you will need CharPos.
>
> Imagine you copy columns from 2 or more lines.
> Then (I guess) you want to set the caret to the start of the column in
> the *last* line to which was inserted..
>
> If there is a tab at the first line you insert, then you may be at
> PhysX=4 and LogX=2 (behind the tab)
> If there is no tab in the last line, and you set LogX =2 , well that is
> not what you want.
>
>
> ---------------------
>
> Remind me, does the Caret go to the start of the insert, or does it
> automatically move one line down too?
>
> And one more thing, if you plan to submit a patch, please add an option
> to SynEdit.Options2
> Many people are used to the current behaviour, I do not plan to upset them.
>
> The option will then be controlled from the IDE. So the patch will
> either wait till I get to do that.
> Or if you volunteer ide/EditorOptions.pas  (search Options2 or )
> ide/frames/editor_misc_options
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210221/afaa7f0a/attachment.html>


More information about the lazarus mailing list