Re: [Lazarus] I say a little prayer (for the Lazarus editor)
I'm not the coder, nor have any answer or thought on the matter,
but I would like to point out that if you select text (any text)
and then use a multi-cursor (pressing Alt+Shift+Down Arrow several
times) and then Ctrl-V to paste, you get such a multi-row paste
very easily.
Whether the mentioned IDE thing gets fixed or not, I find this
the easier way.
Cheers!
Ryan
On 2021/02/20 12:06, duilio foschi via
lazarus wrote:
If the coder in charge of the editor reads
this, I have a prayer for him:
shows the result I wanted from the start. I can get it only by several
uneeded clicks on the arrows keys...
5.
my point is: in Lazarus edit the act of inserting a text which is column-selected has the same
result that the act of inserting a text which is row-selected. It would be nice to
differentiate the results (as it was in Delhi editor) so to satisfy different
needs of the coder.
Thank you
Duilio
On Sat, Feb 20, 2021 at 11:58 AM R.Smith via lazarus <[hidden email]> wrote:
I'm not the coder, nor have any answer or thought on the matter,
but I would like to point out that if you select text (any text)
and then use a multi-cursor (pressing Alt+Shift+Down Arrow several
times) and then Ctrl-V to paste, you get such a multi-row paste
very easily.
Whether the mentioned IDE thing gets fixed or not, I find this
the easier way.
Cheers!
Ryan
On 2021/02/20 12:06, duilio foschi via
lazarus wrote:
If the coder in charge of the editor reads
this, I have a prayer for him:
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
In reply to this post by Free Pascal - Lazarus mailing list
On 20/02/2021 11:06, duilio foschi via lazarus wrote:
>
> So in the Lazarus editor there is no difference in copying a text
> row-selected
> and a text column-selected.
Well there is no diff with regards to caret placement.
If you do column select over more than one line, and paste it, it will
insert each "cell" as column mode dictates. But then also place the
caret at the very end of the last cell.
>
> But if the text is column-selected, Delphi sets the cursor at point
> (x,y+1),
> in the row below.
I thought I had seen that once (I used to once have D5) but I could
neither remember where, nor how it was triggered....
Please report this as a feature request.
---------------------
If multi caret does not solve this, you can always use macros
Record macro / IIRC shift ctrl R
Set Bookmark 1
Paste
Go to Bookmark1
Go Down one line
END Record macro / IIRC shift ctrl R
Now Play the macro with IIRC shift ctrl P
as often as you need.
Skip line if needed as you like.
Using Pascal script macro, you can skip the bookmark.
Or recording the macro for a specific text to pase, where you know the
length you can use cursor-left as to go back the correct amount.
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
On 20/02/2021 15:03, Martin Frb via lazarus wrote:
>
>>
>> But if the text is column-selected, Delphi sets the cursor at point
>> (x,y+1),
>> in the row below.
> I thought I had seen that once (I used to once have D5) but I could
> neither remember where, nor how it was triggered....
Here is the Pascal script you need:
var x: Integer;
begin
x := Caller.CaretX;
ecPaste;
Caller.CaretX := x;
end.
Open the editor MAcro window : ctrl-shift L
- Record a new macro. You need to record something, e.g. move caret up,
while recording. End recording.
- Select the recorded macro in the list => EDIT
- Copy above script into the macro, replacing its content.
- Save (ctrl S)
Then rename the macro.
Assign a key to it.
Below the list of macros (in the macro window) is a "move to:" Project IDE
*** Move it to "IDE" ***
You can get to it again using the tabs above the list.
"Recorded" macros, are deleted when you close the IDE
"Project" macros are kept but only avail for the one project.
"IDE" are global and kept.
---
Now you have a key to paste (column or normal selection) into the editor
and keep the X.
If you want you can add an
ecDown
before the "end."
Then instead of pasting once for each line, press Shift Alt down to set
cursors on each line
Do one single paste.
If I count correctly, one keystroke more (assuming that Delphi includes
cursor down, in the paste).
If in Delphi you do paste,down,paste,down,... Then in Lazarus its less
keystrokes
However, multi caret works only when there are no lines to skip (well
you can set carets individually, but thats more work)
> 5.
>
> my point is: in Lazarus edit the act of inserting a text which is
> column-selected has the same
> result that the act of inserting a text which is row-selected. It
> would be nice to
> differentiate the results (as it was in Delhi editor) so to satisfy
> different
> needs of the coder.
>
See my other reply:
- Yes it should be added. (as build in)
- You can (in 2.0.10) add a macro that does it....
Then instead of pasting once for each line, press Shift Alt down to set
cursors on each line
Do one single paste.
If I count correctly, one keystroke more (assuming that Delphi includes
cursor down, in the paste).
If in Delphi you do paste,down,paste,down,... Then in Lazarus its less
keystrokes
However, multi caret works only when there are no lines to skip (well
you can set carets individually, but thats more work)
> 5.
>
> my point is: in Lazarus edit the act of inserting a text which is
> column-selected has the same
> result that the act of inserting a text which is row-selected. It
> would be nice to
> differentiate the results (as it was in Delhi editor) so to satisfy
> different
> needs of the coder.
>
See my other reply:
- Yes it should be added. (as build in)
- You can (in 2.0.10) add a macro that does it....
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
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?
>
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 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
--
_______________________________________________
lazarus mailing list
[hidden email] https://lists.lazarus-ide.org/listinfo/lazarus
On Sun, Feb 21, 2021 at 12:30 PM Martin Frb <[hidden email]> 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?
>
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 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
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, Feb 21, 2021 at 1:30 PM Martin Frb via lazarus <[hidden email]> wrote:
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.
This particular feature should not have an option IMO.
Now it can be considered a missing feature or even a bug.
When a user presses Alt-key when selecting, he clearly wants something special to happen with Ctrl-C.
Now nothing special happens which is a semi-bug.
I am sure everybody will be happy when this feature gets implemented. I can remember many situations where it would have been useful.
IMO there are too many options already.
If I accidentally change something during my tests, it takes a long time to figure out what changed and how to revert it.
Re: [Lazarus] I say a little prayer (for the Lazarus editor)
On 21/02/2021 16:53, Juha Manninen via
lazarus wrote:
On Sun, Feb 21, 2021 at 1:30 PM Martin Frb
via lazarus <[hidden email]>
wrote:
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.
This particular feature should not have an option
IMO.
Now it can be considered a missing feature or even a
bug.
When a user presses Alt-key when selecting, he
clearly wants something special to happen with Ctrl-C.
Well, if the user selects a column selection of a single line, then
yes (probably).
But if the user selects column over several lines, then pasting
already acts different than it would for a normal selection.
(Select 3 full lines (start to end) using column selection =>
paste will be different than the same 3 lines in normal selection)
And users who grew up without the feature may not like it.
Now nothing special happens which is a semi-bug.
I am sure everybody will be happy when this feature
gets implemented. I can remember many situations where
it would have been useful.
I don't have an example at hand, but I am sure I have more than a
few times made the experience that small, seemingly really useful
changes got someone coming up wanting the old behaviour back.
IMO there are too many options already.
That is true, or rather they are badly organized. They need break
down into basic, and expert (like the mouse options have)
If I accidentally change something during my tests,
it takes a long time to figure out what changed and how
to revert it.
Take a copy of your ___Options.xml files.
You can restore or diff them.
Please add more options only when really needed.
What I really would want to do, is include config in the keymap.
You could add new commands to the keymap.
So you would assign ctrl-v to
paste(true)
or
paste(ColumnAdvanceLine)
ecPaste(ColumnAdvanceLine, IndentToContext, TabsToSpaces)
They look like pascal script, but they would not require
pascalscript. (PascalScript does not work on all platforms, so it
can not be used here)
They would always be a single command, with hardcoded options.
This is like in some browser, you can do config in css, JavaScript
or similar.