I started a new message thread, because the renamed one you started
ended up in the same message thread tree as the "Auto indentation" thread.


Martin wrote:
> True again, but again elastic tabs do not have a benefit over normal
>  tabs here.


They do, see below...


> Elastic tabs is only one scenario for this. Same as good you could
> have: - leading tabs (before any none-white-space) = every 2 or 4
> spaces - embedded tabs at fixed location (first embedded tab at
> column 80 for comments)

I disagree, tabs can be used between text as well - depending on your
coding style obviously.

I tried to create some examples for you using plain text, but it was too
difficult to get the point across. So instead I used gEdit (with ET
enabled) and tooks some screenshots. I also included the original .pas
files for you to view.

ex1.png & ex1_normal_tabs.png
-----------------------------
In ex1.png you can see how the text looks like in gEdit with Elastic
Tabstops enabled. The Tab ($09) char is indicated with the pink dots.
Every dot is a single Tab character.
First I created a procedure declaration which has each parameter
commented. I then duplicated that declaration and then inserted a new
3rd parameter. As you can see from the second declaration, without me
having to go to any of the other parameter lines, all the comments
automatically aligned in the new location.

Now compare that output to a editor that doesn't use elastic tabstops
like Lazarus IDE. The ex1_normal_tabs.png show how Lazarus displays that
same text using TabWidth = 4. Alignment is totally garbled, and no
setting of specific tabstops is going to fix that, without adding extra
Tab characters.

ex2.png & ex2_normal_tabs.png
-----------------------------
ex2.png shows an array of records declaration. Again in gEdit it was
very easy to align the text. Each blue dot represents a Tab ($09) character.
Now compare how that text looks like, when opened in Lazarus IDE which
has TabWidth = 4 defined. Again, alignment is completely garbled and
would require quite a few more Tab characters to fix.


I have also include the two example .pas files, but converted Tabs to
Spaces. gEdit with ET enabled automatically inserted the correct amount
of spaces so that alignment stays correct.


As you can see from the above. Editors with standard tab support
specific tab width simply cannot align content as easily and neatly as
can be done with an editor that has Elastic Tabstops support. ET also
uses much less tab characters because the tab widths differ from line to
line, and tab to tab.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

<<inline: ex1.png>>

<<inline: ex1_normal_tabs.png>>

<<inline: ex2..png>>

<<inline: ex2_normal_tabs.png>>

procedure MyProc(	Param1: string;	{ comment goes here }
	Param2: integer;	{ comment goes here }
	Param3: boolean;	{ comment goes here }
	);

procedure MyProc(	Param1: string;	{ comment goes here }
	Param2: integer;	{ comment goes here }
	ALongParam21: string	{ new param addede }
	Param3: boolean;	{ comment goes here }
	);

procedure MyProc(   Param1: string;     { comment goes here }
                    Param2: integer;    { comment goes here }
                    Param3: boolean;    { comment goes here }
                    );

procedure MyProc(   Param1: string;         { comment goes here }
                    Param2: integer;        { comment goes here }
                    ALongParam21: string    { new param addede }
                    Param3: boolean;        { comment goes here }
                    );

cTasks: array[0..9] of
	record
		Name: ShortString;
		Desc: ShortString;
	end = (
		(Name: pnGeneral	; Desc: 'General permissions'	),
		(Name: pnGeneralPrint	; Desc: 'Allow user to print anything'	),
		(Name: pnGeneralPrintSetup	; Desc: 'Allowing setting up the printer'	),
		(Name: pnQuestionMaint	; Desc: 'Enable Question Maintenaince'	),
		(Name: pnQuestionMaintDel	; Desc: 'Allow deleting of questions'	),
		(Name: pnGenerateWorkS	; Desc: 'Generate Worksheets'	),
		(Name: pnPreGenWorkS	; Desc: 'Pre Generated Worksheets'	),
		(Name: pnPDFBooks	; Desc: 'PDF Books'	),
		(Name: pnPDFBooksGenerate	; Desc: 'Generate PDF Books'	),
		(Name: pnPDFBooksPrint	; Desc: 'Print PDF Books'	)
	); 

cTasks: array[0..9] of
    record
        Name: ShortString;
        Desc: ShortString;
    end = (
        (Name: pnGeneral              ; Desc: 'General permissions'               ),
        (Name: pnGeneralPrint         ; Desc: 'Allow user to print anything'      ),
        (Name: pnGeneralPrintSetup    ; Desc: 'Allowing setting up the printer'   ),
        (Name: pnQuestionMaint        ; Desc: 'Enable Question Maintenaince'      ),
        (Name: pnQuestionMaintDel     ; Desc: 'Allow deleting of questions'       ),
        (Name: pnGenerateWorkS        ; Desc: 'Generate Worksheets'               ),
        (Name: pnPreGenWorkS          ; Desc: 'Pre Generated Worksheets'          ),
        (Name: pnPDFBooks             ; Desc: 'PDF Books'                         ),
        (Name: pnPDFBooksGenerate     ; Desc: 'Generate PDF Books'                ),
        (Name: pnPDFBooksPrint        ; Desc: 'Print PDF Books'                   )
    ); 

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to