Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-11

IDE, indentation after inserting from clipboard

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jürgen Hestermann

In the editor of the IDE, when I put the cursor somewhere and paste multiple lines from the clipboard then only the first line is indented (starts where the cursor is) but all following lines are not indented (start from column 0).
For example, if I have this code snippet in the clipboard:

case X of
1 :
else
end; { of case }

and paste it at column 4 then I get

    case X of
    1:

else
end; { of case }

instead of

    case X of
       1 :
    else
       end; { of case }

so I have to indent lines 2-4 manually each time I paste it. Is that how it should be?
I would like to have the whole block indented in the same way as the first column.

Reply by email

Mattias Gaertner
to Jürgen Hestermann
Show quoted text 27 lines
In the editor of the IDE, when I put the cursor somewhere and paste multiple lines from the clipboard then only the first line is indented (starts where the cursor is) but all following lines are not indented (start from column 0). For example, if I have this code snippet in the clipboard: case X of 1 : else end; { of case } and paste it at column 4 then I get case X of 1: else end; { of case } instead of case X of 1 : else end; { of case } so I have to indent lines 2-4 manually each time I paste it. Is that how it should be? I would like to have the whole block indented in the same way as the first column.

Not yet implemented.
At the moment pasting at Col>1 pastes the text without reformatting. When you paste at Col 1, and you have option 'Codetools/General/On paste from clipboard' enabled the IDE will auto indent/unindent the pasted text, each line the same amount.
Otherwise it pastes without reformatting the text.

Mattias

Reply by email

Jürgen Hestermann
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Mon, 28 Nov 2016 13:38:11 +0100 Jürgen Hestermann via Lazarus wrote: > In the editor of the IDE, when I put the cursor somewhere and paste multiple lines from the clipboard > then only the first line is indented (starts where the cursor is) but all following lines are not indented > (start from column 0). > For example, if I have this code snippet in the clipboard: > case X of > 1 : > else > end; { of case } > and paste it at column 4 then I get > case X of > 1: > else > end; { of case } > instead of > case X of > 1 : > else > end; { of case } > so I have to indent lines 2-4 manually each time I paste it. > Is that how it should be? > I would like to have the whole block indented in the same way as the first column. Not yet implemented.

Okay. I was not sure whether it can be enabled by some option.

At the moment pasting at Col>1 pastes the text without reformatting. When you paste at Col 1, and you have option 'Codetools/General/On paste from clipboard' enabled the IDE will auto indent/unindent the pasted text, each line the same amount.

This would not help much as I want to specify the indentation of the whole block by positioning the cursor somewhere.
I would not have to change the indentation after pasting then.

Thanks for the explanation.

Reply by email