View Issue Details

IDProjectCategoryView StatusLast Update
0037054LazarusIDEpublic2020-05-12 15:53
ReporterJonathan Annett Assigned ToBart Broersma  
Status resolvedResolutionno change required 
Summary0037054: Suggestion: Automatic indent on paste
Descriptiona feature to auto indent when pasting a code block in the editor.

Steps To Reproducen/a
Additional Informationbasically, reindent the pasted text to match the current cursor indent

this feature is implemented in the ZED editor ( which is a browser based editor based on the ACE editor.
see uploaded video


- reident text to be pasted to zero chars indent (keeping relative indents on each line)
- take current column index, call it c
- add c spaces to start of each line to be pasted (but not on first line)
- insert pasted text

optionally, collapse leading spaces into tabs, if ide settings have that set.
TagsNo tags attached.
Fixed in Revision
Attached Files


Jonathan Annett

2020-05-12 06:46


Michael Van Canneyt

2020-05-12 07:03

administrator   ~0122719

What you suggest is the default behaviour of Lazarus ?

If it isn't enabled on your system you can enable it in the options:
See Tools-Options, under Editor - General - Tab and Indent, click 'Set up smart indent'
under 'Indentation for pascal sources' make sure 'on paste from clipboard' is set.

Bart Broersma

2020-05-12 15:53

developer   ~0122731

See Michaels note.

Issue History

Date Modified Username Field Change
2020-05-12 06:46 Jonathan Annett New Issue
2020-05-12 06:46 Jonathan Annett File Added: pasted edit.mp4
2020-05-12 07:03 Michael Van Canneyt Note Added: 0122719
2020-05-12 12:06 Martin Friebe Summary Suggestion => Suggestion: Automatic indent on paste
2020-05-12 12:06 Martin Friebe Description Updated View Revisions
2020-05-12 12:06 Martin Friebe Additional Information Updated View Revisions
2020-05-12 12:06 Martin Friebe LazTarget => -
2020-05-12 15:53 Bart Broersma Assigned To => Bart Broersma
2020-05-12 15:53 Bart Broersma Status new => resolved
2020-05-12 15:53 Bart Broersma Resolution open => no change required
2020-05-12 15:53 Bart Broersma Note Added: 0122731