Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-23 13:31, Jürgen Hestermann wrote: > Also, you didn't align the parameters in your screenshot as I did in my > example. > I have one 'column' for: If you want columns, then columns you shall have. ;-) See attachment. I've also reduced the tabSize to 2, to make it more representative of common Object Pascal coding style standards. The only thing I can see that is still different to your original code [which ET can't do] is make your const/var column right aligned. See attached screenshot. Again, I've enabled jEdit's setting to show where I inserted TAB characters to make it easier to reproduce. > In the end, you arrange your alignment according to the limitations > of elastic tabstops (ET) Not at all. To the contrary, the "my style #2" is exactly the coding standard I use in all my code (ET enabled or not). You are welcome to verify this by looking at the fpGUI or tiOPF code available on SourceForge. I use a coding style that is very similar, if not exactly like, the code shown in Delphi 7's VCL units. So no, I didn't adjust my styling to fit ET in any way, it just happens to work very well together. ps: In case you are interested. jEdit supports local buffer settings embedded inside the file you are editing. For Object Pascal code, you can place the following anywhere in the first 10 or last 10 lines of a .pas file. If I had to use it, I would personally stick it at the end of the unit, far out of the way. { :mode=pascal:tabSize=2:elasticTabstops=true: } Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-23 12:38, Jürgen Hestermann wrote: > But this happens quite often in my code in function/procedure > declarations as I align the parameters and directly after this See attached screenshot. It shows three options. 1) your original code 2) I live to define each parameter individually with modifier and data type. But this layout makes the code stretch for to the right, meaning I might have to scroll horizontally to see all the parameter definitions. 3) Slightly reworked (2) - no more horizontal scrolling required I know coding style is a very personal thing. So I'm not saying you must change your, I'm just showing examples of others. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-23 12:14, Jürgen Hestermann wrote: > In your screenshot you use empty lines > but no comment lines to separate the blocks. It makes no difference... it has the same result. See attached screenshot, where I added comments using a // prefix. You seem to be missing how indentation or alignment is triggered with ET. It only happens when a TAB (U+0009) character is found. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
Damn spelling mistakes. Seems I'm having finger troubles today. :-) > other languages), so if need be, add blacks lines if you must. Often it Should have been: ... so if need be, add _blank_ lines if you must. > use ET. Also, if you want what things to be aligned when using an ET Should have been: ... if you _don't_ want things to be aligned... Regards, Graeme ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
Am 2016-11-23 um 13:10 schrieb Graeme Geldenhuys: On 2016-11-22 18:29, Jürgen Hestermann wrote: I tried a new file in JEdit (I don't know what format this has then) but a line beginning with double backslash did not separate the blocks. Even worse, it was taken as the first column of the whole block. See attached. In your screenshot you use empty lines but no comment lines to separate the blocks. ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-23 11:25, Jürgen Hestermann wrote: > I am wondering how you can achieve this kind of code alignment Yes, easily, because only lines 1 & 2 have TAB characters. Line 3 has no TAB characters, so ET's algorithm doesn't need to do anything with it. See attached screenshot. Also remember, Object Pascal is not sensitive to whitespace (like some other languages), so if need be, add blacks lines if you must. Often it makes a method implementation easier to read too - separating related tasks in a single method implementation. I do that, even when I don't use ET. Also, if you want what things to be aligned when using an ET enabled editor, then use spaces instead of a TAB character. Like any programming style - make it work for you. Elastic Tabstops will obviously not be a perfect fit for everybody - nothing ever is. But (to me at least) it is a damn sight better than anything before it. The pros far outweigh the cons for me. The pure joy of multiple developers looking at the exact same file, but each developer having their own style (indentation and padding) preferences applied is a huge plus for me. Also in DDL SQL having field comments perfectly align next to table fields is awesome. Also viewing TAB delimited data dumps is awesome - giving text editors the ability to view data like Excel or LibreOffice Calc. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-22 18:29, Jürgen Hestermann wrote: > I tried a new file in JEdit (I don't know what format this has then) > but a line beginning with double backslash did not separate the blocks. > Even worse, it was taken as the first column of the whole block. See attached. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
Am 2016-11-22 um 19:29 schrieb Jürgen Hestermann: > Am 2016-11-22 um 17:59 schrieb Graeme Geldenhuys: > > Inserting a blank line between the two blocks will treat themt > > differently with different indentation widths. > > Yes. But sometimes I do not want to be forced to > insert a blank line just to achieve this and > sometimes I even want to align what is separated > by a blank line. I am wondering how you can achieve this kind of code alignment - MyvariableA := 0; Myx := 1; MyProcedureCall(Param1,Param2,Param3); - by using elastic tabstops and without having an empty line between the 2nd and 3rd code line. Wouldn't the 3rd line always expand the first column of the block shifting the ':=' far to the right? ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
Am 2016-11-22 um 17:59 schrieb Graeme Geldenhuys: > Inserting a blank line between the two blocks will treat themt > differently with different indentation widths. Yes. But sometimes I do not want to be forced to insert a blank line just to achieve this and sometimes I even want to align what is separated by a blank line. > If your file format supports comments, > inserting a comment line between the two blocks will > also work. I tried a new file in JEdit (I don't know what format this has then) but a line beginning with double backslash did not separate the blocks. Even worse, it was taken as the first column of the whole block. ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-22 16:45, Jürgen Hestermann wrote: > In your screenshot "11 22 33" is aligned with 'ggg ' which I do not > want. Ah, okay. In that case you can't do it with ET, as they are consider part of the same text block (think of a paragraph of text in a word document). Inserting a blank line between the two blocks will treat them differently with different indentation widths. If your file format supports comments, inserting a comment line between the two blocks will also work. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
Am 2016-11-22 um 17:26 schrieb Graeme Geldenhuys: > On 2016-11-22 15:57, Jürgen Hestermann wrote: >> I just tried elastic tab stops with JEdit a bit but they are too restrictive for me: >> >> 1.) They do not allow me to start a new table without having an empty line between. >> The following indentation seems to be impossible with elastic tabstops (at least I did not found out how to do this): >> >> >> >> 11 22 33 >> 44 55 66 >> 77 88 99 > > I'm not sure I understand what exactly you are trying to accomplish. Do > you mean column data (think TAB delimiter data files like what Excel > exports)? See attached screenshot. Simply insert a TAB character between > every column of text. I just want it in the way I have shown in my email (via spaces). The first 3 lines and the last 3 lines should *not* share the same tab positions! Only each block of 3 lines should do so. In your screenshot "11 22 33" is aligned with 'ggg ' which I do not want. There should be 2 blocks each with their own columns. ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
On 2016-11-22 15:57, Jürgen Hestermann wrote: > I just tried elastic tab stops with JEdit a bit but they are too restrictive > for me: > > 1.) They do not allow me to start a new table without having an empty line > between. > The following indentation seems to be impossible with elastic tabstops > (at least I did not found out how to do this): > > > > 11 22 33 > 44 55 66 > 77 88 99 I'm not sure I understand what exactly you are trying to accomplish. Do you mean column data (think TAB delimiter data files like what Excel exports)? See attached screenshot. Simply insert a TAB character between every column of text. > 2.) When spaces are used instead of tabs (like in Lazarus IDE) then If you are going to use ET for your programming, you would convert all your source code to TAB indented files. Some text editors (VIM, jEdit etc) allow you to place a comment line within the first 5 or so lines of text (they have a special name for it, but I can't remember it now). Those are special editor instructions like defining TAB width, coding style etc. If Lazarus IDE ever supported ET, that would be a useful feature to add too. So Lazarus IDE could automatically use ET for your code, but standard 2-space indentation for Lazarus LCL code. I had a quick look in jEdit help under "Buffer-Local Properties". >From the documentation: " When jEdit loads a file, it checks the first and last 10 lines for colon-enclosed name/value pairs. For example, placing the following in a buffer changes the indent width to 4 characters, enables soft tabs, and activates the Perl edit mode: :indentSize=4:noTabs=true:mode=perl: " Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
I just tried elastic tab stops with JEdit a bit but they are too restrictive for me: 1.) They do not allow me to start a new table without having an empty line between. The following indentation seems to be impossible with elastic tabstops (at least I did not found out how to do this): 11 22 33 44 55 66 77 88 99 There is no way to specify when a block starts and ends other than empty lines. Even worse, when having a block like above and I then start a new line which has nothing to do with the above block this whole new line is taken as the first column shifting everything above to the right (which is not what I intended). Elastic tabstops are way "too smart". They disturb more often than they help. 2.) When spaces are used instead of tabs (like in Lazarus IDE) then my file has the same look on all editors with monospaced fonts. When I would have used (elastic) tabstops then this would look totally confusing in these editors. 3.) Together with the issues above the advantages are too few to let me put any time into this (I already wasted too much time on testing and writing these emails ;-) ) ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other
Re: [fpc-other] Underscores in numerical literals - grouping
[moved to fpc-other, from fpc-users mailing list] On 2016-11-22 13:47, Reimar Grabowski wrote: >> hahaha... I love how a con is “fundamentally different concept”. >> How is that a con? > > Fundamentally different to the way current IDEs/editors process their > text -> too much work for a feature no one gives a flying f**k > about. Got it? Yet probably the two most popular IDE's in the world (Eclipse and MS Visual Studio) both support Elastic Tabstop. :-/ And that's just two IDE's I know of. Some text editors (stand-alone or built into an IDE) have more advanced functionality than most people realise (or more features than what Lazarus's TSynEdit supports), but never realised the potential of taking advantage of those features - or thinking outside the box. Think about Syntax Highlighting. For decades everybody coded in plain 2-tone text, and everybody accepted it as the norm. Then somebody thought outside the box and implemented syntax highlighting to make it easier on the developer. Yet, Syntax Highlighting doesn't add any extra functionality to your code or the compiler - but does require a "fundamentally different concept and implementation". Now every text editor on the planet supports syntax highlighting and accepts that as the norm. The Elastic Tabstops implementation is actually pretty simple - way under a 100 lines of code. All that ET needs from a text editor is that they support multiple tabstop per line and where each tabstop can have a different width. Optionally (but preferred), also where tabstops are defined in pixels not x number of spaces (but this is not a requirement). ps: Apparently, according to Martin Friebe, implementing ET support in Lazarus is really simple. Bar the fact that it will use x number of spaces as indentation, not pixels. But I don't know enough of Lazarus's source editor and TSynEdit integration to know where to implement a TSynEdit line filter. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-other maillist - fpc-other@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other