[Lazarus] Block unindent does not work in Lazarus like in Delphi7....

Martin lazarus at mfriebe.de
Sun Oct 10 19:56:16 CEST 2010


  On 10/10/2010 18:24, Bo Berglund wrote:
> I have tried to fix indentation problems that were not visible when
> the unit was edited in Delphi7, but now shows up as massive block
> indents.
>
> But I cannot get anything to work, not Tab and Shift-Tab or Ctrl-i and
> Ctrl-u...
> They seem only to work as follows:
>
> - Select a block of text
> - Use TAB or Ctrl-i to indent and the block moves to the right
> - Use Shift-TAB or Ctrl-u to unindent and the block moves left
>
> BUT it moves right only to the original position of the text before
> the indentaion commands were given!
> I want to move the block left because it has too much indentaion
> caused by Lazarus translating TAB characters too widely before I had
> time to change the tab indentation width to 2.
>
> So how can I unindent in Lazarus in the same way as is possible in
> Delphi???

Hm, I don't know how delphi does it. I only have "Turbo Delphi" (the one 
Borland gave away for free) and it doesn't seem do have any 
indent/unindent at all. (ctrl-i/ctrl-u don't do it, neither does tab).

But yes it looks like the the unindent in Lazarus doesn't deal with tabs 
at all.

I understand your text has mixed indent some with space, some with tab? 
Which is why adjusting tab doesn't work, because the lines that are 
adjusted on space do not react to it? Maybe you an provide an example?

Also if nothing helps: Lazarus includes Jedi code formater => that 
should be able to deal with it.

If you need to get rid of *whole* tabs (e.g you have lots of consecutive 
lines starting with 4 tabs, but you want all of them only 3 tabs), yoou 
can use column mode selection.
Select with alt-shift-cursor_keys, You can select several lines, but 
only one (or two) tab chars in each line. Once selected you can delete them.
But this only works, if the whole tab is selected => I do not know of a 
way to delete a partial selected  tab (e.g substitute it to spaces)

Martin







More information about the Lazarus mailing list