Code format .inc file lazarus / 13-General ---------------------------------------------------------------------- riwu · 2016-06-13 06:33 How do i use the JEDI code format for a .inc file? If i format the entire project or the unit that uses the .inc file, it won't format the .inc file. If i format the .inc file itself, it gives an error since .inc does not have those headings of a unit file. 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 xxx.inc(1,1) Error: Exception TEParseError  Expected program, package, library, unit, got "ttType" Near TYPE Is the only way to copy and paste all my .inc to the unit that uses them, format the unit, then copy and paste paste back? ---------------------------------------------------------------------- howardpc · 2016-06-13 06:59 The JEDI formatter copes with .inc files by ignoring them. If you force it to look at an .inc its parser does not recognise the file as Pascal, because it does not match the simplified syntax rules that ignore .inc files. The Lazarus CodeTools knows about .inc files and (internally) adds them to its 'clean' copy of your full source, so code navigation etc. works well, whether you have .inc files or not. The CodeTools uses a different algorithm for formatting of indentation, not rule-based (where you set preferences for lots of options as with JEDI) but by mimicking indentation from a standard Pascal file. A default sample .pas is used by the IDE, but you can change the sample file to suit your indentation style in the General page of the IDE Options dialog->CodeTools node. The whole philosophy is different from the JEDI formatter, and it is designed to work seamlessly either with or without .inc files in the sources that are parsed. ---------------------------------------------------------------------- timppl · 2016-06-15 10:44 At the top of your .inc file ( before anything else ) put 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 (** Uncomment for formattingunit XXX; interface implementation begin**) and at the end 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 // end. . To format it with jedi, uncomment all the above, format it and then comment the lines out again. I have been using this for years. HTH Tim