single line 'if then' with the JediCF lazarus / 9-Editor ---------------------------------------------------------------------- Eleazar · 2020-12-27 13:24 Hello, My question is about the Jedi Code Formatter that I use quite often. In the Style Guide (https://wiki.delphi- jedi.org/wiki/Project_JEDI_Delphi_Language_Style_Guide) the following is mentioned: JCL 'discourages' a line like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if A < B then DoSomething; and states: Use it only in "obvious" situations such as Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  if ParameterIncorrect then Exit; I like that as well, so I tried to change the settings in Tools/Options/JCF Format Settings/Clarify/Line Breaking/Blocks for 'Block without begin'. The setting - result are as follows: Never - you get a single line Always - line is broken Leave as is - line is broken as well! Is this a bug, or am I missing something? Regards ---------------------------------------------------------------------- DomingoGP · 2020-12-29 21:06 Hello, Yes, is a bug. JCF adds a new line before processing the block conditions so the option "leave as is" keeps the incorrect new line. I filled a issue in bug tracker with a patch that solves the problem. issue https://bugs.freepascal.org/view.php?id=38277 Regards. ---------------------------------------------------------------------- Eleazar · 2020-12-30 00:59 Hey, thanks Domingo and Juha for the solution. What a great team! It works just right now! At first, after replacing only the two files (ReturnAfter.pas and ReturnBefore.pas) I ran into an error (unknown IsGenericFunctionOrProperty) during building. Then I just replaced the whole jcf2 folder with a fresh clone from Github graemeg/lazarus and after a 'Clean Up/Build All' it worked! Apparently I missed some other changed files in jcf2, although my Lazarus installation is rather fresh (maybe 4 months old).. Thanks and regards, Leo ---------------------------------------------------------------------- JuhaManninen · 2020-12-30 09:58 Quote from: Eleazar on December 30, 2020, 01:59:40 amApparently I missed some other changed files in jcf2, although my Lazarus installation is rather fresh (maybe 4 months old).. How did you install it 4 months ago? Sounds like you could use Lazarus trunk without any intermediate steps. Graeme's mirror is a good place to get. There are also other mirrors and the original Subversion server. Then you just do "git pull" or "svn up" and always have the latest changes. First time build with "make". Then start Lazarus from its location, no installation is needed, and build from Tools menu. Most of time trunk works well. Occasional bigger hiccups are usually fixed quickly. ---------------------------------------------------------------------- Eleazar · 2020-12-31 01:00 Hi Juha, I just checked. I freshly installed using the lazarus-2.0.10-fpc-3.2.0-win32.exe installer about 7 weeks ago. Also checked: some of the files in folder jcf2 were from 2017. I'm really interested in setting up a scheme to work with the latest updates. I will try to get that working later with help of the FAQ and other pages. First attempt did not work, probably because of the fpc.cfg? This is what I tried so far: -I used Github Desktop to get the graemeg/lazarus upstream trunk. I have tried several hours to get it working as you suggested: -I copied the contents of my old installation c:\lazarus\fpc\3.2.0\bin\i386-win32\ to folder c:\make\, and added 'c:\make\' to the system variable path -so, make is available as command -when i run 'make bigide' in the trunk directory e:\GitHub\lazarus\lazarus\, the compilation is aborted with fatal error: (10022) Can't find unit BaseIDEIntf used by lazbuild -I have read the information at https://wiki.lazarus.freepascal.org/Installing_Lazarus -also renamed the files with same capitalisation, but that did not help either.. For me this is new stuff. I have always installed Lazarus/FPC using the release package, but working with a trunk that gets updated sounds really interesting to me... Hope to get it working and transfer my 'old' settings (the components installed) to the new environment in the trunk mirror. Hope you, or someone else can help with a hint to get this working. Until then, I'll keep happily coding in my older installation :-). Greetings, Leo ---------------------------------------------------------------------- JuhaManninen · 2020-12-31 14:33 Quote from: Eleazar on December 31, 2020, 02:00:51 am-I copied the contents of my old installation c:\lazarus\fpc\3.2.0\bin\i386-win32\ to folder c:\make\, and added 'c:\make\' to the system variable path -so, make is available as command No! "make" is an executable, not a folder. I can see you don't know Unix / Linux concepts. There "make" is used to build everything. FPC installation provides "make" also for Windows. Just ensure that FPC is installed correctly and found in PATH. Test by compiling a Hello World program from command line. When FPC works, building Lazarus trunk is super-easy. Just "cd" to the folder with sources (e:\GitHub\lazarus\lazarus\ maybe), then run "make", then start lazarus.exe from the same place. QuoteHope to get it working and transfer my 'old' settings (the components installed) to the new environment in the trunk mirror. The settings are stored in local configuration and will be used with your new Lazarus trunk unless you give it option --pcp= . In case you want to test FPC trunk, it requires installation and is a little more difficult. For that I would recommend fpcupdeluxe. However you don't need FPC trunk for Lazarus trunk. P.S. Delphi also comes with "make" executable which is not compatible. If running "make" gives you very many errors, it probably comes from the Delphi "make". Just remove it or adjust PATH. ---------------------------------------------------------------------- Eleazar · 2020-12-31 18:38 Hi Juha, In the directory 'make' I had placed the stuff from FPC, and it was compiling well, up to that specific error. From the output I saw that it also jumped to the fpc folder inside lazarus folder (that is where fpc ends up when you use the lazarus-2.0.10-fpc-3.2.0-win32.exe installer). Now I did a fresh install of FPC, using the install from SourceForge. And then compiling of the Lazarus trunk went fine. Just needed to install source files separately inside FPC folder. I had a short look at fpcupdeluxe, looks promising, will try it later. Thanks and greetings, Leo ---------------------------------------------------------------------- JuhaManninen · 2020-12-31 20:45 Quote from: Eleazar on December 31, 2020, 07:38:14 pmIn the directory 'make' I had placed the stuff from FPC, and it was compiling well, up to that specific error. From the output I saw that it also jumped to the fpc folder inside lazarus folder (that is where fpc ends up when you use the lazarus-2.0.10-fpc-3.2.0-win32.exe installer). Ok, I don't know why FPC directory is under Lazarus directory in the Windows installer. In other platforms they are separate install packages. QuoteNow I did a fresh install of FPC, using the install from SourceForge. And then compiling of the Lazarus trunk went fine. Just needed to install source files separately inside FPC folder. Good. Yes, having the FPC sources helps browsing code in Lazarus. I forgot to mention, you can have sources of many Lazarus versions, then build and start them the same way, maybe using different --pcp= parameters. BTW, Martin has a Github mirror of Lazarus with all branches included. Branch "master" is the default unlike in Graeme's mirror.  https://github.com/User4martin ---------------------------------------------------------------------- PascalDragon · 2021-01-01 10:37 Quote from: JuhaManninen on December 31, 2020, 09:45:53 pmQuote from: Eleazar on December 31, 2020, 07:38:14 pmIn the directory 'make' I had placed the stuff from FPC, and it was compiling well, up to that specific error. From the output I saw that it also jumped to the fpc folder inside lazarus folder (that is where fpc ends up when you use the lazarus-2.0.10-fpc-3.2.0-win32.exe installer). Ok, I don't know why FPC directory is under Lazarus directory in the Windows installer. In other platforms they are separate install packages. Because in this case FPC is part of Lazarus. This way it doesn't interfere with an independant installation and also an additional path where to install would need to be queried otherwise.