Browse Source

Update fork

Charlie Root 1 tháng trước cách đây
mục cha
commit
062e23388d
78 tập tin đã thay đổi với 675 bổ sung355 xóa
  1. 8 2
      compiler/arm/narminl.pas
  2. 10 19
      compiler/defcmp.pas
  3. 15 0
      compiler/ngenutil.pas
  4. 1 0
      compiler/options.pas
  5. 1 2
      compiler/pdecvar.pas
  6. 5 1
      compiler/symcreat.pas
  7. 2 1
      packages/chm/src/chmsitemap.pas
  8. 5 0
      packages/fcl-base/fpmake.pp
  9. 3 0
      packages/fcl-base/namespaced/Fcl.WMarkDown.pp
  10. 1 0
      packages/fcl-base/namespaces.lst
  11. 290 0
      packages/fcl-base/src/wmarkdown.pp
  12. 2 2
      packages/fv/examples/testapp.pas
  13. 6 6
      packages/fv/src/app.inc
  14. 16 7
      packages/fv/src/colorsel.inc
  15. 5 5
      packages/fv/src/dialogs.inc
  16. 13 13
      packages/fv/src/drivers.inc
  17. 33 18
      packages/fv/src/editors.inc
  18. 5 5
      packages/fv/src/fvclip.inc
  19. 2 2
      packages/fv/src/fvcommon.inc
  20. 1 1
      packages/fv/src/fvconsts.pas
  21. 1 1
      packages/fv/src/inplong.inc
  22. 6 6
      packages/fv/src/memory.pas
  23. 3 3
      packages/fv/src/menus.inc
  24. 1 1
      packages/fv/src/msgbox.inc
  25. 1 1
      packages/fv/src/outline.inc
  26. 2 2
      packages/fv/src/resource.pas
  27. 4 4
      packages/fv/src/statuses.inc
  28. 6 6
      packages/fv/src/stddlg.inc
  29. 1 1
      packages/fv/src/str.inc
  30. 1 1
      packages/fv/src/strtxt.inc
  31. 7 7
      packages/fv/src/time.pas
  32. 4 4
      packages/fv/src/validate.inc
  33. 10 10
      packages/fv/src/views.inc
  34. 1 1
      packages/ide/fp.pas
  35. 1 1
      packages/ide/fpcodcmp.pas
  36. 4 4
      packages/ide/fpcompil.pas
  37. 2 2
      packages/ide/fpdesk.pas
  38. 2 2
      packages/ide/fphelp.pas
  39. 7 7
      packages/ide/fpide.pas
  40. 4 4
      packages/ide/fpini.pas
  41. 1 1
      packages/ide/fpmcomp.inc
  42. 1 1
      packages/ide/fpmdebug.inc
  43. 1 1
      packages/ide/fpmingw.pas
  44. 7 7
      packages/ide/fpmopts.inc
  45. 2 2
      packages/ide/fpmrun.inc
  46. 1 1
      packages/ide/fpredir.pas
  47. 3 3
      packages/ide/fpregs.pas
  48. 1 1
      packages/ide/fpswitch.pas
  49. 9 9
      packages/ide/fpsymbol.pas
  50. 1 1
      packages/ide/fptools.pas
  51. 3 3
      packages/ide/fpusrscr.pas
  52. 1 1
      packages/ide/fputils.pas
  53. 1 1
      packages/ide/fpvars.pas
  54. 5 5
      packages/ide/fpviews.pas
  55. 3 3
      packages/ide/gdbmiint.pas
  56. 1 1
      packages/ide/globdir.inc
  57. 14 14
      packages/ide/weditor.pas
  58. 1 1
      packages/ide/whlpview.pas
  59. 6 6
      packages/ide/whtml.pas
  60. 4 4
      packages/ide/whtmlhlp.pas
  61. 1 1
      packages/ide/winclip.pas
  62. 1 1
      packages/ide/wnghelp.pas
  63. 1 1
      packages/ide/woahelp.pas
  64. 1 1
      packages/ide/wos2help.pas
  65. 2 2
      packages/ide/wviews.pas
  66. 1 1
      packages/ide/wwinhelp.pas
  67. 1 1
      packages/rtl-generics/readme.txt
  68. 8 0
      rtl/inc/objpas.inc
  69. 9 0
      rtl/inc/objpash.inc
  70. 10 0
      rtl/inc/system.inc
  71. 6 0
      rtl/inc/systemh.inc
  72. 1 1
      rtl/objpas/classes/classes.inc
  73. 0 33
      tests/webtbf/tw2129.pp
  74. 0 54
      tests/webtbs/tw2129.pp
  75. 0 41
      tests/webtbs/tw2129b.pp
  76. 21 0
      tests/webtbs/tw41504a.pp
  77. 16 0
      tests/webtbs/tw41504b.pp
  78. 38 0
      tests/webtbs/tw41533.pp

+ 8 - 2
compiler/arm/narminl.pas

@@ -66,7 +66,8 @@ implementation
     uses
       globtype,verbose,globals,
       procinfo,
-      compinnr,cpuinfo,defutil,symdef,aasmdata,aasmcpu,
+      compinnr,cpuinfo,defutil,symdef,
+      aasmdata,aasmcpu,aasmtai,
       cgbase,cgutils,pass_1,pass_2,
       cpubase,ncgutil,cgobj,cgcpu, hlcgobj,
       nutils,ncal;
@@ -106,7 +107,12 @@ implementation
        begin
          case inlinenumber of
            in_arm_yield:
-             current_asmdata.CurrAsmList.concat(taicpu.op_none(A_YIELD));
+             if CPUARM_HAS_MP_INSTRUCTIONS in cpu_capabilities[current_settings.cputype] then
+               current_asmdata.CurrAsmList.concat(taicpu.op_none(A_YIELD))
+             else
+               { while yield is a no op operation if not supported by the cpu, assemblers do not
+                 handle it, so encode it in hex if the cpu does not support it }
+               current_asmdata.CurrAsmList.concat(tai_const.Create_32bit(longint($e320f001)));
            else
              inherited pass_generate_code_cpu;
          end;

+ 10 - 19
compiler/defcmp.pas

@@ -962,27 +962,18 @@ implementation
                        eq:=te_equal
                      else
                        begin
-                         { Delphi does not allow explicit type conversions for float types like:
-                             single_var:=single(double_var);
-                           But if such conversion is inserted by compiler (internal) for some purpose,
-                           it should be allowed even in Delphi mode. }
-                         if (fromtreetype=realconstn) or
-                            not((cdoptions*[cdo_explicit,cdo_internal]=[cdo_explicit]) and
-                                (m_delphi in current_settings.modeswitches)) then
+                         doconv:=tc_real_2_real;
+                         { do we lose precision? }
+                         if (def_to.size<def_from.size) or
+                           (is_currency(def_from) and (tfloatdef(def_to).floattype in [s32real,s64real])) then
                            begin
-                             doconv:=tc_real_2_real;
-                             { do we lose precision? }
-                             if (def_to.size<def_from.size) or
-                               (is_currency(def_from) and (tfloatdef(def_to).floattype in [s32real,s64real])) then
-                               begin
-                                 if is_currency(def_from) and (tfloatdef(def_to).floattype=s32real) then
-                                   eq:=te_convert_l3
-                                 else
-                                   eq:=te_convert_l2
-                               end
+                             if is_currency(def_from) and (tfloatdef(def_to).floattype=s32real) then
+                               eq:=te_convert_l3
                              else
-                               eq:=te_convert_l1;
-                           end;
+                               eq:=te_convert_l2
+                           end
+                         else
+                           eq:=te_convert_l1;
                        end;
                    end;
                  else

+ 15 - 0
compiler/ngenutil.pas

@@ -1148,6 +1148,9 @@ implementation
       nameinit,namefini : TSymStr;
       tabledef: tdef;
       entry : pinitfinalentry;
+      unitnametcb : ttai_typedconstbuilder;
+      unitnamedef : tdef;
+      unitnamelbl : tasmlabel;
 
       procedure add_initfinal_import(symtable:tsymtable);
         var
@@ -1245,6 +1248,18 @@ implementation
               if entry^.module<>current_module then
                 add_initfinal_import(entry^.module.localsymtable);
             end;
+          { Add pointer to unit name }
+          if assigned(entry^.module.realmodulename) then
+            begin
+              { Create string constant and emit pointer to it }
+              unitinits.start_internal_data_builder(current_asmdata.asmlists[al_globals],sec_rodata,'',unitnametcb,unitnamelbl);
+              unitnamedef:=unitnametcb.emit_shortstring_const(entry^.module.realmodulename^);
+              unitinits.finish_internal_data_builder(unitnametcb,unitnamelbl,unitnamedef,sizeof(pint));
+              unitinits.queue_init(charpointertype);
+              unitinits.queue_emit_asmsym(unitnamelbl,unitnamedef);
+            end
+          else
+            unitinits.emit_tai(Tai_const.Create_nil_dataptr,charpointertype);
         end;
 
       { Add to data segment }

+ 1 - 0
compiler/options.pas

@@ -4952,6 +4952,7 @@ begin
   def_system_macro('FPC_HAS_MEMBAR');
   def_system_macro('FPC_SETBASE_USED');
   def_system_macro('FPC_ALIGNED_THREADVARTABLES');
+  def_system_macro('FPC_INITFINAL_HASUNITNAME');
 
   { don't remove this, it's also for fpdoc necessary (FK) }
   def_system_macro('FPC_HAS_FEATURE_SUPPORT');

+ 1 - 2
compiler/pdecvar.pas

@@ -389,8 +389,7 @@ implementation
          { property parameters ? }
          if try_to_consume(_LECKKLAMMER) then
            begin
-              if (p.visibility=vis_published) and
-                not (m_delphi in current_settings.modeswitches) then
+              if (p.visibility=vis_published) then
                 Message(parser_e_cant_publish_that_property);
               { create a list of the parameters }
               p.parast:=tparasymtable.create(nil,0);

+ 5 - 1
compiler/symcreat.pas

@@ -1884,7 +1884,11 @@ implementation
              (tprocdef(def).localst.symtabletype=localsymtable) then
             add_synthetic_method_implementations(tprocdef(def).localst)
           else if ((def.typ=objectdef) and
-                   not(oo_is_external in tobjectdef(def).objectoptions)) or
+                   not(oo_is_external in tobjectdef(def).objectoptions) and
+                   { we must not create duplicate synthetic methods for a unique
+                     type declaration as that simply shares the VMT of the aliased
+                     types }
+                   not(tobjectdef(def).is_unique_objpasdef)) or
                   (def.typ=recorddef) then
            begin
             { also complete nested types }

+ 2 - 1
packages/chm/src/chmsitemap.pas

@@ -112,6 +112,8 @@ type
     procedure AddURL(const URL:string);
     procedure AddType(const AType:string);
     procedure Sort(Compare: TListSortCompare);
+  public
+    property SubItem[ index :integer]:TChmSiteMapSubItem read getsubitem;
   published
     property Children: TChmSiteMapItems read FChildren write SetChildren;
     property Name: String read FName write FName;
@@ -126,7 +128,6 @@ type
     property FrameName: String read FFrameName write FFrameName;
     property WindowName: String read FWindowName write FWindowName;
     property Merge: String read FMerge write FMerge;
-    property SubItem[ index :integer]:TChmSiteMapSubItem read getsubitem;
     property SubItemcount  :integer read getsubitemcount;
   end;
 

+ 5 - 0
packages/fcl-base/fpmake.pp

@@ -116,6 +116,11 @@ begin
         begin
           AddUnit('wformat');
         end;
+    T:=P.Targets.AddUnit('wmarkdown.pp');
+      with T.Dependencies do
+        begin
+          AddUnit('wformat');
+        end;
     T:=P.Targets.AddUnit('wtex.pp');
       with T.Dependencies do
         begin

+ 3 - 0
packages/fcl-base/namespaced/Fcl.WMarkDown.pp

@@ -0,0 +1,3 @@
+unit Fcl.WMarkDown;
+{$DEFINE FPC_DOTTEDUNITS}
+{$i wmarkdown.pp}

+ 1 - 0
packages/fcl-base/namespaces.lst

@@ -22,6 +22,7 @@ src/pooledmm.pp=namespaced/System.Pooledmm.pp
 src/csvreadwrite.pp=namespaced/Fcl.Csv.ReadWrite.pp
 src/idea.pp=namespaced/System.Hash.Idea.pp
 src/whtml.pp=namespaced/Fcl.Whtml.pp
+src/wmarkdown.pp=namespaced/Fcl.WMarkDown.pp
 src/csvdocument.pp=namespaced/Fcl.Csv.Document.pp
 src/gettext.pp=namespaced/System.GetText.pp
 src/chainstream.pp=namespaced/Fcl.Streams.Chained.pp

+ 290 - 0
packages/fcl-base/src/wmarkdown.pp

@@ -0,0 +1,290 @@
+{
+    This file is part of the Free Component Library (Fcl)
+    Copyright (c) 2025 by the Free Pascal development team
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************
+
+    TMarkdownWriter - Markdown formatting writer implementation
+
+    This unit provides TMarkdownWriter, a concrete implementation of
+    TFormattingWriter that generates Markdown output. It supports:
+
+    - Document structure (headers, paragraphs)
+    - Text formatting (bold, italic, underline via HTML)
+    - Tables with proper alignment
+    - Lists (unordered, ordered, definition)
+    - Preformatted code blocks
+    - Character escaping for special markdown characters
+
+    See demo_markdown.pp for usage examples.
+
+ **********************************************************************}
+{$IFNDEF FPC_DOTTEDUNITS}
+unit wmarkdown;
+{$ENDIF FPC_DOTTEDUNITS}
+
+{$ifdef fpc}
+{$mode objfpc}
+{$endif}
+
+interface
+
+{$IFDEF FPC_DOTTEDUNITS}
+uses Fcl.Wformat,System.Classes,System.SysUtils;
+{$ELSE FPC_DOTTEDUNITS}
+uses wformat,Classes,SysUtils;
+{$ENDIF FPC_DOTTEDUNITS}
+
+Type
+  TMarkdownWriter=Class(TFormattingWriter)
+  Private
+    FTableCols: Integer;
+    FTableHeaderWritten: Boolean;
+    FInListItem: Boolean;
+  Public
+    Constructor Create (AStream : TStream); override;
+    Function EscapeText (AText : String) : String; override;
+    Procedure DocumentStart(Const Title : String); override;
+    Procedure DocumentEnd; override;
+    Procedure HeaderStart(Alevel : Integer); override;
+    Procedure HeaderEnd(Alevel : Integer); override;
+    Procedure ParagraphStart; override;
+    Procedure ParagraphEnd; override;
+    Procedure LineBreak; override;
+    Procedure Rule; override;
+    Procedure BoldStart; override;
+    Procedure BoldEnd;override;
+    Procedure ItalicStart;override;
+    Procedure ItalicEnd;override;
+    Procedure UnderlineStart;override;
+    Procedure UnderlineEnd;override;
+    Procedure PreformatStart; override;
+    Procedure PreformatEnd; override;
+    Procedure TableStart( NoCols: Integer; Border : Boolean); override;
+    Procedure TableEnd; override;
+    Procedure RowStart; override;
+    Procedure RowEnd; override;
+    Procedure CellStart; override;
+    Procedure CellEnd; override;
+    Procedure HeaderCellStart; override;
+    Procedure HeaderCellEnd; override;
+    Procedure ListStart(ListType : TListType); override;
+    Procedure ListEnd(ListType : TListType); override;
+    Procedure ListItemStart; override;
+    Procedure ListItemEnd; override;
+    Procedure DefinitionItem(Const Aname,AText : String); override;
+  end;
+
+implementation
+
+{ TMarkdownWriter }
+
+constructor TMarkdownWriter.Create(AStream: TStream);
+begin
+  inherited;
+  FTableCols := 0;
+  FTableHeaderWritten := False;
+  FInListItem := False;
+end;
+
+function TMarkdownWriter.EscapeText(AText: String): String;
+begin
+  // Only escape backslashes and characters that could break structure
+  Result := StringReplace(AText, '\', '\\', [rfReplaceAll]);
+  Result := StringReplace(Result, '[', '\[', [rfReplaceAll]);
+  Result := StringReplace(Result, ']', '\]', [rfReplaceAll]);
+  // Don't escape * _ ` # as they might be intentional formatting
+end;
+
+procedure TMarkdownWriter.DocumentStart(const Title: String);
+begin
+  if Title <> '' then
+  begin
+    Dump('# ');
+    Write(Title);
+    DumpLn('');
+    DumpLn('');
+  end;
+end;
+
+procedure TMarkdownWriter.DocumentEnd;
+begin
+  // Markdown doesn't require explicit document ending
+end;
+
+procedure TMarkdownWriter.HeaderStart(Alevel: Integer);
+var
+  HeaderMarker: String;
+  i: Integer;
+begin
+  HeaderMarker := '';
+  for i := 1 to ALevel + 1 do
+    HeaderMarker := HeaderMarker + '#';
+  Dump(HeaderMarker + ' ');
+end;
+
+procedure TMarkdownWriter.HeaderEnd(Alevel: Integer);
+begin
+  DumpLn('');
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.ParagraphStart;
+begin
+  // Markdown paragraphs don't need explicit start markers
+end;
+
+procedure TMarkdownWriter.ParagraphEnd;
+begin
+  DumpLn('');
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.LineBreak;
+begin
+  DumpLn('  '); // Two spaces at end of a line creates a line break in markdown
+end;
+
+procedure TMarkdownWriter.Rule;
+begin
+  DumpLn('');
+  DumpLn('---');
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.BoldStart;
+begin
+  Dump('**');
+end;
+
+procedure TMarkdownWriter.BoldEnd;
+begin
+  Dump('**');
+end;
+
+procedure TMarkdownWriter.ItalicStart;
+begin
+  Dump('*');
+end;
+
+procedure TMarkdownWriter.ItalicEnd;
+begin
+  Dump('*');
+end;
+
+procedure TMarkdownWriter.UnderlineStart;
+begin
+  // Markdown doesn't have native underline, use HTML
+  Dump('<u>');
+end;
+
+procedure TMarkdownWriter.UnderlineEnd;
+begin
+  Dump('</u>');
+end;
+
+procedure TMarkdownWriter.PreformatStart;
+begin
+  DumpLn('');
+  DumpLn('```');
+end;
+
+procedure TMarkdownWriter.PreformatEnd;
+begin
+  DumpLn('```');
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.TableStart(NoCols: Integer; Border: Boolean);
+begin
+  FTableCols := NoCols;
+  FTableHeaderWritten := False;
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.TableEnd;
+begin
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.RowStart;
+begin
+  Dump('|');
+end;
+
+procedure TMarkdownWriter.RowEnd;
+var
+  i: Integer;
+begin
+  DumpLn('');
+
+  // After header row, add separator row
+  if not FTableHeaderWritten then
+  begin
+    FTableHeaderWritten := True;
+    Dump('|');
+    for i := 1 to FTableCols do
+      Dump('---|');
+    DumpLn('');
+  end;
+end;
+
+procedure TMarkdownWriter.CellStart;
+begin
+  Dump(' ');
+end;
+
+procedure TMarkdownWriter.CellEnd;
+begin
+  Dump(' |');
+end;
+
+procedure TMarkdownWriter.HeaderCellStart;
+begin
+  CellStart;
+end;
+
+procedure TMarkdownWriter.HeaderCellEnd;
+begin
+  CellEnd;
+end;
+
+procedure TMarkdownWriter.ListStart(ListType: TListType);
+begin
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.ListEnd(ListType: TListType);
+begin
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.ListItemStart;
+begin
+  FInListItem := True;
+  Dump('- '); // Use dash for all list types for simplicity
+end;
+
+procedure TMarkdownWriter.ListItemEnd;
+begin
+  FInListItem := False;
+  DumpLn('');
+end;
+
+procedure TMarkdownWriter.DefinitionItem(const Aname, AText: String);
+begin
+  Write(AName);
+  DumpLn('');
+  Dump(': ');
+  Write(AText);
+  DumpLn('');
+end;
+
+end.

+ 2 - 2
packages/fv/examples/testapp.pas

@@ -27,7 +27,7 @@ PROGRAM testapp;
 {                                                                       }
 {                                                                       }
 {  Comments:                                                            }
-{    There is alot that may seem more complex than it needs to but      }
+{    There is a lot that may seem more complex than it needs to but     }
 {    I have much more elaborate objects operating such as bitmaps,      }
 {    bitmap buttons, percentage bars etc and they need these hooks.     }
 {    Basically the intention is to be able to port existing TV apps     }
@@ -70,7 +70,7 @@ CONST
 {$endif DEBUG}
 
 {---------------------------------------------------------------------------}
-{          TTestAppp OBJECT - STANDARD APPLICATION WITH MENU                }
+{          TTvDemo OBJECT - STANDARD APPLICATION WITH MENU                  }
 {---------------------------------------------------------------------------}
 TYPE
    PTVDemo = ^TTVDemo;

+ 6 - 6
packages/fv/src/app.inc

@@ -743,7 +743,7 @@ BEGIN
    Application := PApplication(@Self);                { Set application ptr }
    InitScreen;                                        { Initialize screen }
    State := sfVisible + sfSelected + sfFocused +
-      sfModal + sfExposed;                            { Deafult states }
+      sfModal + sfExposed;                            { Default states }
    Options := 0;                                      { No options set }
    Size.X := Min(ScreenWidth,MaxViewWidth);           { Set x size value }
    Size.Y := ScreenHeight;                            { Set y size value }
@@ -804,7 +804,7 @@ BEGIN
    ValidView := Nil;                                  { Preset failure }
    If (P <> Nil) Then Begin
 (*
-     If LowMemory Then Begin                          { Check memroy }
+     If LowMemory Then Begin                          { Check memory }
        Dispose(P, Done);                              { Dispose view }
        OutOfMemory;                                   { Call out of memory }
        Exit;                                          { Now exit }
@@ -878,10 +878,10 @@ END;
 PROCEDURE TProgram.InitScreen;
 
 {Initscreen is passive only, i.e. it detects the video size and capabilities
- after initalization. Active video initalization is the task of Tapplication.}
+ after initialization. Active video initialization is the task of Tapplication.}
 
 BEGIN
-  { the orginal code can't be used here because of the limited
+  { the original code can't be used here because of the limited
     video unit capabilities, the mono modus can't be handled
   }
 {$ifdef FV_UNICODE}
@@ -1054,7 +1054,7 @@ BEGIN
            If (Event.What = evNothing) Then
              begin
 {$IFNDEF HASAMIGA}
-               { due to isses with the event handling in FV itself,
+               { due to issues with the event handling in FV itself,
                  we skip this here, and let the IDE to handle it
                  directly on Amiga-like systems. The FV itself cannot
                  handle the System Events anyway. (KB) }
@@ -1195,7 +1195,7 @@ var PrevHeight,PrevWidth : Sw_Word;
 var s:string;
 {$endif}
 
-BEGIN                                                 { Compatability only }
+BEGIN                                                 { Compatibility only }
   {$ifdef unix}DoneClip;{$endif}
   DoneSysError;
   DoneEvents;

+ 16 - 7
packages/fv/src/colorsel.inc

@@ -363,7 +363,7 @@ begin
     evKeyDown: Begin                                 { Key down event }
       NeedClear:=true;
       n15:=15; n11:=11; n16:=16;
-      if (SelType = csBackground) then
+      if Size.Y=2 then
       begin
         n15:=7; n11:=3; n16:=8;
       end;
@@ -397,8 +397,7 @@ begin
         MakeLocal(Event.Where, Mouse);               { Localize mouse }
         mx:=Mouse.X;
         if (mx>=0) and (mx<=12) then
-          if ((Mouse.Y >= 0) and (Mouse.Y <= 3) and (SelType = csForeground))
-          or ((Mouse.Y >= 0) and (Mouse.Y <= 1) and (SelType = csBackground)) then
+          if ((Mouse.Y >= 0) and (Mouse.Y <= Size.Y-1)) then
           begin
             mx:=mx div 3;
             newColor:=(Mouse.Y)*4+mx;
@@ -478,7 +477,7 @@ begin
   CurColor:=0;
   DrawColorLine(0);
   DrawColorLine(1);
-  if SelType = csForeground then
+  if Size.Y >= 4 then
   begin
     DrawColorLine(2);
     DrawColorLine(3);
@@ -691,7 +690,7 @@ begin
       S.Write(R^.Index,Sizeof(R^.Index));
       R := R^.Next;
     end;
-    {write gropu}
+    {write group}
 {$ifdef FV_UNICODE}
     S.WriteUnicodeString(x^.Name);
 {$else FV_UNICODE}
@@ -801,7 +800,7 @@ begin
   x := Groups;
   inherited Done;
   Groups:=nil;
-  {Disopse PColorGroup linked list}
+  {Dispose PColorGroup linked list}
   while Assigned(x) do begin
     R:=x^.Items;
     while Assigned(R) do begin
@@ -962,6 +961,8 @@ begin
   VScrollBar := New(PScrollBar, Init(R2));
   Insert(VScrollBar);
   Groups := New(PColorGroupList, Init(R, VScrollBar, AGroups));
+  Groups^.GrowMode:=gfGrowHiY;
+  VScrollBar^.GrowMode:=gfGrowHiY;
   Insert(Groups);
   R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1;
   Insert(New(PLabel, Init(R2, label_colorsel_group, Groups)));
@@ -976,6 +977,7 @@ begin
   VScrollBar := New(PScrollBar, Init(R2));
   Insert(VScrollBar);
   Items := New(PColorItemList, Init(R, VScrollBar,xItems));
+  Items^.GrowMode:=gfGrowHiY+gfGrowHiX;
   Insert(Items);
   R2.Copy(R); Dec(R2.A.Y); R2.B.Y:=R2.A.Y+1;
   Insert(New(PLabel, Init(R2, label_colorsel_item, Items)));
@@ -984,6 +986,8 @@ begin
   R2.Copy(R); R2.B.Y:=R2.A.Y; Dec(R2.A.Y);
   ForSel:=New(PColorSelector, Init(R, csForeground));
   ForLabel:=New(PLabel, Init(R2, label_colorsel_foreground, ForSel));
+  ForSel^.GrowMode:=gfGrowLoX+gfGrowHiX;
+  ForLabel^.GrowMode:=gfGrowLoX+gfGrowHiX;
   Insert(ForSel);
   Insert(ForLabel);
   {-- Color selector background --}
@@ -991,18 +995,23 @@ begin
   R2.Copy(R); R2.B.Y:=R2.A.Y; Dec(R2.A.Y);
   BakSel:=New(PColorSelector, Init(R, csBackground));
   BakLabel:=New(PLabel, Init(R2, label_colorsel_background, BakSel));
+  BakSel^.GrowMode:=gfGrowLoX+gfGrowHiX;
+  BakLabel^.GrowMode:=gfGrowLoX+gfGrowHiX;
   Insert(BakSel);
   Insert(BakLabel);
   {-- Color Display --}
   R.Assign(45, 12, 59, 15);
   Display:=New(PColorDisplay,Init(R,Sw_NewStr(label_colorsel_displaytext)));
+  Display^.GrowMode:=gfGrowLoX+gfGrowHiX;
   Insert(Display);
   {-- Buttons --}
   R.Assign(37, 16, 47, 18);
   OkButton := New(PButton, Init(R, slOk, cmOK, bfDefault));
+  OkButton^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowLoX+gfGrowHiX;
   Insert(OkButton);
   Inc(R.A.X,12); Inc(R.B.X,12);
-  CancelButton := New(PButton, Init(R, slCancel, cmCancel, bfDefault));
+  CancelButton := New(PButton, Init(R, slCancel, cmCancel, bfNormal));
+  CancelButton^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowLoX+gfGrowHiX;
   Insert(CancelButton);
   {--set focus--}
   Items^.FocusItem(0);

+ 5 - 5
packages/fv/src/dialogs.inc

@@ -1422,7 +1422,7 @@ BEGIN
    If (Validator <> Nil) Then
      DSize := Validator^.Transfer(Data, Nil,
        vtDataSize);                                   { Add validator size }
-   If (DSize <> 0) Then DataSize := DSize             { Use validtor size }
+   If (DSize <> 0) Then DataSize := DSize             { Use validator size }
      Else DataSize := SizeOf(Sw_String);              { DataSize return the
                                                         actual size of the field
                                                         in record. Unlike
@@ -1436,7 +1436,7 @@ BEGIN
    If (Validator <> Nil) AND (Data <> Nil) Then
      DSize := Validator^.Transfer(Data^, Nil,
        vtDataSize);                                   { Add validator size }
-   If (DSize <> 0) Then DataSize := DSize             { Use validtor size }
+   If (DSize <> 0) Then DataSize := DSize             { Use validator size }
      Else DataSize := MaxLen + 1;                     { No validator use size }
 {$endif FV_UNICODE}
 END;
@@ -1679,7 +1679,7 @@ END;
 PROCEDURE TInputLine.Store (Var S: TStream);
 VAR w: Word;
 BEGIN
-   TView.Store(S);                                    { Implict TView.Store }
+   TView.Store(S);                                    { Implicit TView.Store }
    w:=MaxLen;S.Write(w, SizeOf(w));                   { Read max length }
    w:=CurPos;S.Write(w, SizeOf(w));                   { Read cursor position }
    w:=FirstPos;S.Write(w, SizeOf(w));                 { Read first position }
@@ -2353,7 +2353,7 @@ END;
 {---------------------------------------------------------------------------}
 PROCEDURE TButton.Store (Var S: TStream);
 BEGIN
-   TView.Store(S);                                    { Implict TView.Store }
+   TView.Store(S);                                    { Implicit TView.Store }
 {$ifdef FV_UNICODE}
    S.WriteUnicodeString(Title);                       { Store title string }
 {$else FV_UNICODE}
@@ -2675,7 +2675,7 @@ BEGIN
          Options := Options OR ofSelectable;          { Set selectable option }
          Exit;                                        { Now exit }
        End;
-       M := M SHL 1;                                  { Create newbit mask }
+       M := M SHL 1;                                  { Create new bit mask }
      End;
      Options := Options AND NOT ofSelectable;         { Make not selectable }
    End;

+ 13 - 13
packages/fv/src/drivers.inc

@@ -327,7 +327,7 @@ CONST
 {***************************************************************************}
 
 { ******************************* REMARK ****************************** }
-{    The TEvent definition is completely compatable with all existing   }
+{    The TEvent definition is completely compatible with all existing   }
 {  code but adds two new fields ID and Data into the message record     }
 {  which helps with WIN/NT and OS2 message processing.                  }
 { ****************************** END REMARK *** Leon de Boer, 11Sep97 * }
@@ -615,13 +615,13 @@ Called automatically by TApplication.Done.
 PROCEDURE DoneVideo;
 
 {-ClearScreen--------------------------------------------------------
-Does nothing provided for compatability purposes only.
+Does nothing provided for compatibility purposes only.
 04Jan97 LdB
 ---------------------------------------------------------------------}
 PROCEDURE ClearScreen;
 
 {-SetVideoMode-------------------------------------------------------
-Does nothing provided for compatability purposes only.
+Does nothing provided for compatibility purposes only.
 04Jan97 LdB
 ---------------------------------------------------------------------}
 PROCEDURE SetVideoMode (Mode: Sw_Word);
@@ -655,7 +655,7 @@ FUNCTION SystemError (ErrorCode: Sw_Integer; Drive: Byte): Sw_Integer;
 {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
 
 {-PrintStr-----------------------------------------------------------
-Does nothing provided for compatability purposes only.
+Does nothing provided for compatibility purposes only.
 30Jun98 LdB
 ---------------------------------------------------------------------}
 PROCEDURE PrintStr (CONST S: String);
@@ -698,14 +698,14 @@ PROCEDURE ShowMouseCursor;
 {                INITIALIZED DOS/DPMI/WIN/NT/OS2 VARIABLES                  }
 {---------------------------------------------------------------------------}
 CONST
-   CheckSnow    : Boolean = False;                    { Compatability only }
+   CheckSnow    : Boolean = False;                    { Compatibility only }
    MouseEvents  : Boolean = False;                    { Mouse event state }
    MouseReverse : Boolean = False;                    { Mouse reversed }
-   HiResScreen  : Boolean = False;                    { Compatability only }
-   CtrlBreakHit : Boolean = False;                    { Compatability only }
-   SaveCtrlBreak: Boolean = False;                    { Compatability only }
-   SysErrActive : Boolean = False;                    { Compatability only }
-   FailSysErrors: Boolean = False;                    { Compatability only }
+   HiResScreen  : Boolean = False;                    { Compatibility only }
+   CtrlBreakHit : Boolean = False;                    { Compatibility only }
+   SaveCtrlBreak: Boolean = False;                    { Compatibility only }
+   SysErrActive : Boolean = False;                    { Compatibility only }
+   FailSysErrors: Boolean = False;                    { Compatibility only }
    ButtonCount  : Byte = 0;                           { Mouse button count }
    DoubleDelay  : Sw_Word = 8;                           { Double click delay }
    RepeatDelay  : Sw_Word = 8;                           { Auto mouse delay }
@@ -713,8 +713,8 @@ CONST
    SysMonoAttr  : Sw_Word = $7070;                       { System mono attr }
    StartupMode  : Sw_Word = $FFFF;                       { Compatability only }
    CursorLines  : Sw_Word = $FFFF;                       { Compatability only }
-   ScreenBuffer : Pointer = Nil;                      { Compatability only }
-   SaveInt09    : Pointer = Nil;                      { Compatability only }
+   ScreenBuffer : Pointer = Nil;                      { Compatibility only }
+   SaveInt09    : Pointer = Nil;                      { Compatibility only }
    SysErrorFunc : TSysErrorFunc = {$ifdef FPC}@{$endif}SystemError; { System error ptr }
 
 
@@ -983,7 +983,7 @@ END;
 {---------------------------------------------------------------------------}
 PROCEDURE ExitDrivers; {$IFNDEF PPC_FPC}{$IFNDEF OS_UNIX} FAR; {$ENDIF}{$ENDIF}
 BEGIN
-   DoneSysError;                                      { Relase error trap }
+   DoneSysError;                                      { Release error trap }
    DoneEvents;                                        { Close event driver }
 {   DoneKeyboard;}
    DoneVideo;

+ 33 - 18
packages/fv/src/editors.inc

@@ -305,7 +305,7 @@ type
     Length : Sw_Word;
 {$ifdef FV_UNICODE}
     Buffer : Sw_String;  { In Unicode version use UnicodeString for data transfer }
-                         { even thou internaly we use TEditBuffer as utf8 data buffer }
+                         { even thou internally we use TEditBuffer as utf8 data buffer }
 {$else}
     Buffer : TEditBuffer;
 {$endif}
@@ -326,6 +326,7 @@ type
   TFileEditor = object (TEditor)
     //FileName : FNameStr;
     FileName : Sw_String;
+    WriteBOM: Boolean;
     constructor Init (var Bounds : TRect; AHScrollBar, AVScrollBar : PScrollBar;
                           AIndicator : PIndicator; AFileName : FNameStr);
     constructor Load (var S : TStream);
@@ -518,7 +519,7 @@ resourcestring  sClipboard='Clipboard';
                 sReformatNotPossible='Paragraph reformat not possible while trying to wrap current line with current margins.';
                 sReformattingTheDocument='Reformatting the document:';
                 sReplaceNotPossible='Wordwrap on:  Replace not possible in current margins when at end of line.';
-                sReplaceThisOccurence='Replace this occurrence?';
+                sReplaceThisOccurrence='Replace this occurrence?';
                 sRightMargin='Right Margin';
                 sSearchStringNotFound='Search string not found.';
                 sSelectWhereToBegin='Please select where to begin.';
@@ -1022,7 +1023,7 @@ begin
         Inc(T.Y);
         if PPoint(Info)^.Y <= T.Y then
           R.Move(0, Desktop^.Size.Y - R.B.Y - 2);
-        StdEditorDialog := MessageBoxRect(R, sReplaceThisOccurence,
+        StdEditorDialog := MessageBoxRect(R, sReplaceThisOccurrence,
           nil, mfYesNoCancel + mfInformation);
       end;
     edJumpToLine:
@@ -2136,9 +2137,9 @@ begin
 end; { TEditor.Find }
 
 
-{ Functon have functionality only in unicode version of fv. }
+{ Function have functionality only in unicode version of fv. }
 { It mimic FormatLine but instead of drawing line gather }
-{ information on character posisionings }
+{ information on character positioning }
 const
   DelimiterChars: SET OF AnsiChar =
     [' ', '.', ',', ';', ':', '!', '?', '-', '_', '/', '\',
@@ -2206,7 +2207,7 @@ var idxpos : sw_word;
              if (len8=0) and  IsValidUtf8ContinuationByte(p^) and (utf8innerindex>0)  then
              begin    { into utf8 char }
                dec(utf8innerindex);
-               if utf8innerindex = 0 then    { we have complite utf8 char }
+               if utf8innerindex = 0 then    { we have complete utf8 char }
                begin
                  uLen:=Utf8ToUnicode(nil,15,@bStr[iUtf8Char],savLen8);
                  if uLen =3 then   {encoded as unicode pair}
@@ -2335,7 +2336,7 @@ begin
   fillchar(lookUpCharToPosX^,sizeof(lookUpCharToPosX^),0);
   fillchar(lookUpPosXToChar^,sizeof(lookUpPosXToChar^),0);
 {$endif FV_UNICODE}
-  SetLength(bStr,MaxLineLength*4); {  utf8 can have 4 bytes per charater... }
+  SetLength(bStr,MaxLineLength*4); {  utf8 can have 4 bytes per character... }
   bStr[1]:=#0;
   iB:=0;
   iU:=0;
@@ -2409,14 +2410,14 @@ var
     p:=PAnsiChar(Buffer)+idxpos;
 {$ifdef FV_UNICODE}
     { prepare string for drawing }
-    SetLength(bStr,MaxLineLength*4); {  utf8 can have 4 bytes per charater... }
+    SetLength(bStr,MaxLineLength*4); {  utf8 can have 4 bytes per character... }
     iB:=0;
     while endpos>idxpos do
      begin
        inc(iB);
        if p^ in [#10,#13] then
          begin
-           bStr[iB]:=#13; { line ending is line endig }
+           bStr[iB]:=#13; { line ending is line ending }
            break;
          end
        else
@@ -2424,9 +2425,9 @@ var
        inc(p);
        inc(idxpos);
      end;
-     if iB = 0 then exit; { no charatcters, leave early }
+     if iB = 0 then exit; { no characters, leave early }
      SetLength(bStr,iB);
-     if bStr = #13 then { empyt line }
+     if bStr = #13 then { empty line }
      begin
        FillSpace(Width-OutCnt+0);
        FormatUntil:=true;
@@ -3004,7 +3005,7 @@ VAR
 begin
   if EditorDialog (edJumpToLine, @Line_Number) <> cmCancel then
     begin
-      { Convert the Line_Number string to an interger. }
+      { Convert the Line_Number string to an integer.  }
       { Put it into Temp_Value.  If the number is not  }
       { in the range 1..9999 abort.  If the number is  }
       { our current Y position, abort.  Otherwise,     }
@@ -3411,7 +3412,7 @@ VAR
 begin
   { Check if Word_Wrap is toggled on.  If NOT on, check if programmer }
   { allows reformatting of document and if not show user dialog that  }
-  { says reformatting is not permissable.                             }
+  { says reformatting is not permissible.                             }
   if not Word_Wrap then
     begin
       if not Allow_Reformat then
@@ -3447,7 +3448,7 @@ end; { TEditor.Reformat_Document }
 function TEditor.Reformat_Paragraph (Select_Mode   : Byte;
                                      Center_Cursor : Boolean) : Boolean;
 { This procedure will do a reformat of the current paragraph if ^B pressed. }
-{ The feature works regardless if wordrap is on or off.  It also supports   }
+{ The feature works regardless if word wrap is on or off.  It also supports }
 { the AutoIndent feature.  Reformat is not possible if the CurPos exceeds   }
 { the Right_Margin.  Right_Margin is where the EOL is considered to be.     }
 CONST
@@ -3460,7 +3461,7 @@ begin
   Reformat_Paragraph := False;
   { Check if Word_Wrap is toggled on.  If NOT on, check if programmer }
   { allows reformatting of paragraph and if not show user dialog that }
-  { says reformatting is not permissable.                             }
+  { says reformatting is not permissible.                             }
   if not Word_Wrap then
     begin
       if not Allow_Reformat then
@@ -3514,7 +3515,7 @@ begin
           InsertText (@Space, 1, False);
         end;
         { Reset CurPtr to EOL.  While line length is > Right_Margin }
-        { go Do_Word_Wrap.  If wordrap failed, exit routine.        }
+        { go Do_Word_Wrap.  If word wrap failed, exit routine.      }
         SetCurPtr (LineEnd (CurPtr), Select_Mode);
         while LineEnd (CurPtr) - LineStart (CurPtr) > Right_Margin do
           if not Do_Word_Wrap (Select_Mode, Center_Cursor) then
@@ -3976,8 +3977,8 @@ end; { Editor.Store }
 
 
 procedure TEditor.Tab_Key (Select_Mode : Byte);
-{ This function determines if we are in overstrike or insert mode,   }
-{ and then moves the cursor if overstrike, or adds spaces if insert. }
+{ This function determines if we are in over strike or insert mode,   }
+{ and then moves the cursor if over strike, or adds spaces if insert. }
 VAR
   E        : Sw_Word;                { End of current line.                }
   Index    : Sw_Integer;             { Loop counter.                       }
@@ -4313,6 +4314,7 @@ begin
   S.Read (FileName[0], SizeOf (Byte));
   S.Read (Filename[1], Length (FileName));
 {$endif}
+  S.Read (WriteBOM, SizeOf (WriteBOM));
   if IsValid then
     IsValid := LoadFile;
   S.Read (SStart, SizeOf (SStart));
@@ -4389,6 +4391,14 @@ begin
             EditorDialog(edReadError, @FileName)
           else
             begin
+              if (FRead>=3)
+                and (Buffer^[BufSize-FSize+0]=#$EF)
+                and (Buffer^[BufSize-FSize+1]=#$BB)
+                and (Buffer^[BufSize-FSize+2]=#$BF) then { utf BOM detected }
+              begin
+                WriteBOM:=true; {write BOM back on save}
+                FRead:=FRead-3; {reduce size by BOM size}
+              end;
               LoadFile := True;
               Length := FRead;
             end;
@@ -4423,6 +4433,8 @@ end; { TFileEditor.SaveAs }
 
 
 function TFileEditor.SaveFile : Boolean;
+const
+  sbom : string[3] = #$EF#$BB#$BF;
 VAR
   F          : File;
   BackupName : FNameStr;
@@ -4447,6 +4459,8 @@ begin
     EditorDialog (edCreateError, @FileName)
   else
     begin
+      if WriteBOM then
+        BlockWrite (F, sbom[1], 3);
       BlockWrite (F, Buffer^, CurPtr);
       BlockWrite (F, Buffer^[CurPtr + GapLen], BufLen - CurPtr);
       if IOResult <> 0 then
@@ -4495,6 +4509,7 @@ begin
 {$else}
   S.Write (FileName, Length (FileName) + 1);
 {$endif}
+  S.Write (WriteBOM, SizeOf (WriteBOM));
   S.Write (SelStart, SizeOf (SelStart));
   S.Write (SelEnd, SizeOf (SelEnd));
   S.Write (CurPtr, SizeOf (CurPtr));

+ 5 - 5
packages/fv/src/fvclip.inc

@@ -54,7 +54,7 @@ procedure DoneClip;
 {Actual clipboard content will be returned via event system, if terminal supports OSC 52}
 procedure GetGlobalClipboardData;
 
-{ Set clipboard content, if terminal supports OSC 52. Return true allways }
+{ Set clipboard content, if terminal supports OSC 52. Return true always }
 function SetGlobalClipboardData(P: PAnsiChar; ASize: longint): boolean;
 
 implementation
@@ -86,7 +86,7 @@ var cProgram : PProgram;
   PText : PAnsiChar;
 
 {Could not use unit base64 because of Sysutils and reasons }
-{Speed or reuseability here is not a concern               }
+{Speed or reusability here is not a concern                }
 const
   EncodingTable: PAnsiChar =
     'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
@@ -225,7 +225,7 @@ begin
     begin
       inc(countemptines);
       if countemptines = 30 then break;
-      {we might be ahead for a shortwhile, wait a little bit longer}
+      {we might be ahead for a short while, wait a little bit longer}
       timewait.tv_sec := 0;
       timewait.tv_nsec := 2000000;
       ree:=fpNanoSleep(@timewait,@finalparsec);
@@ -233,7 +233,7 @@ begin
     end;
     countemptines:=0;
     if ch = ';' then
-      continue; {ment to eat very first ';', there shoud not be any other}
+      continue; {eat very first ';', there should not be any other}
     if inEsc then
       begin
         escSeq:=escSeq+ch;
@@ -287,7 +287,7 @@ begin
     begin
       inc(countemptines);
       if countemptines = 30 then break;
-      {we might be ahead for a shortwhile, wait a little bit longer}
+      {we might be ahead for a short while, wait a little bit longer}
       timewait.tv_sec := 0;
       timewait.tv_nsec := 2000000;
       ree:=fpNanoSleep(@timewait,@finalparsec);

+ 2 - 2
packages/fv/src/fvcommon.inc

@@ -239,7 +239,7 @@ Given two SmallInt values returns the lowest SmallInt of the two.
 ---------------------------------------------------------------------}
 FUNCTION MinIntegerOf (A, B: SmallInt): SmallInt;
 
-{-MaxIntegerof-------------------------------------------------------
+{-MaxIntegerOf-------------------------------------------------------
 Given two SmallInt values returns the biggest SmallInt of the two.
 04Oct99 LdB
 ---------------------------------------------------------------------}
@@ -263,7 +263,7 @@ FUNCTION MaxLongIntOf (A, B: LongInt): LongInt;
 
 { ******************************* REMARK ****************************** }
 {  Delphi 3+ does not define these standard routines so I have made     }
-{  some public functions here to complete compatability.                }
+{  some public functions here to complete compatibility.                }
 { ****************************** END REMARK *** Leon de Boer, 14Aug98 * }
 
 {-MemAvail-----------------------------------------------------------

+ 1 - 1
packages/fv/src/fvconsts.pas

@@ -180,7 +180,7 @@ const
 {
  The FVConsts unit contains all command constants used in the FreeVision
  library. They have been extracted from their original units and placed here
- for easier maintainence and modification to remove conflicts, such as Borland
+ for easier maintenance and modification to remove conflicts, such as Borland
  created with the cmChangeDir constant in the StdDlg and App units.
 }
 

+ 1 - 1
packages/fv/src/inplong.inc

@@ -23,7 +23,7 @@ Unit InpLong;
 {$ENDIF FPC_DOTTEDUNITS}
 
 (*--
-TInputLong is a derivitave of TInputline designed to accept LongInt
+TInputLong is a derivative of TInputline designed to accept LongInt
 numeric input.  Since both the upper and lower limit of acceptable numeric
 input can be set, TInputLong may be used for SmallInt, Word, or Byte input
 as well.  Option flag bits allow optional hex input and display.  A blank

+ 6 - 6
packages/fv/src/memory.pas

@@ -171,14 +171,14 @@ PROCEDURE NewBuffer (Var P: Pointer; Size: Word);
 
 {-InitDosMem---------------------------------------------------------
 Initialize memory manager routine for a shell to launch a DOS window.
-Interface for compatability only under DPMI/WIN/NT/OS2 platforms.
+Interface for compatibility only under DPMI/WIN/NT/OS2 platforms.
 01Oct99 LdB
 ---------------------------------------------------------------------}
 PROCEDURE InitDosMem;
 
 {-DoneDosMem---------------------------------------------------------
 Finished shell to a DOS window so reset memory manager again.
-Interface for compatability only under DPMI/WIN/NT/OS2 platforms.
+Interface for compatibility only under DPMI/WIN/NT/OS2 platforms.
 01Oct99 LdB
 ---------------------------------------------------------------------}
 PROCEDURE DoneDosMem;
@@ -611,12 +611,12 @@ PROCEDURE NewCache (Var P: Pointer; Size: Word);
 {$IFDEF PROC_REAL}                                    { REAL MODE DOS CODE }
 ASSEMBLER;
 ASM
-   LES DI, P;                                         { Addres of var P }
+   LES DI, P;                                         { Address of var P }
    MOV AX, Size;
    ADD AX, (TYPE TCache)+15;                          { Add offset }
    MOV CL, 4;
    SHR AX, CL;
-   MOV DX, CachePtr.Word[2];                          { Reteive cache ptr }
+   MOV DX, CachePtr.Word[2];                          { Retrieve cache ptr }
    SUB DX, AX;
    JC @@1;
    CMP DX, HeapPtr.Word[2];                           { Heap ptr end }
@@ -810,7 +810,7 @@ PROCEDURE DisposeBuffer (P: Pointer);
 BEGIN
    If (P <> Nil) Then Begin
      {$IFDEF PROC_REAL}                               { REAL MODE DOS CODE }
-     Dec(PtrRec(P).Seg);                              { Prior segement }
+     Dec(PtrRec(P).Seg);                              { Prior segment }
      SetBufSize(P, 0);                                { Release memory }
      {$ELSE}                                          { DPMI/WIN/NT/OS2 CODE }
 {$ifdef fpc}
@@ -842,7 +842,7 @@ VAR BufSize: Word; Buffer: PBuffer;
 BEGIN
    {$IFDEF PROC_REAL}                                 { REAL MODE DOS CODE }
    BufSize := (Size + 15) SHR 4 + 1;                  { Paragraphs to alloc }
-   If (BufHeapPtr+BufSize > BufHeapEnd) Then P := Nil { Exceeeds heap }
+   If (BufHeapPtr+BufSize > BufHeapEnd) Then P := Nil { Exceeds heap }
    Else Begin
      Buffer := Ptr(BufHeapPtr, 0);                    { Current position }
      Buffer^.Size := Size;                            { Set size }

+ 3 - 3
packages/fv/src/menus.inc

@@ -1166,10 +1166,10 @@ BEGIN
    W := 5 + W;                        { Longest text width }
    R.Copy(Bounds);                                    { Copy the bounds }
    If (R.A.X + W < R.B.X) Then R.B.X := R.A.X + W     { Shorten if possible }
-     Else R.A.X := R.B.X - W;                         { Insufficent space }
+     Else R.A.X := R.B.X - W;                         { Insufficient space }
    R.B.X := R.A.X + W;
    If (R.A.Y + H < R.B.Y) Then R.B.Y := R.A.Y + H     { Shorten if possible }
-     Else R.A.Y := R.B.Y - H;                         { Insufficent height }
+     Else R.A.Y := R.B.Y - H;                         { Insufficient height }
    Inherited Init(R);                                 { Call ancestor }
    State := State OR sfShadow;                        { Set shadow state }
    Options := Options OR ofFramed or ofPreProcess;                { View pre processes }
@@ -1397,7 +1397,7 @@ CONSTRUCTOR TStatusLine.Load (Var S: TStream);
 
 BEGIN
    Inherited Load(S);                                 { Call ancestor }
-   Defs := DoLoadStatusDefs;                          { Retreive items }
+   Defs := DoLoadStatusDefs;                          { Retrieve items }
    FindItems;                                         { Find the items }
 END;
 

+ 1 - 1
packages/fv/src/msgbox.inc

@@ -113,7 +113,7 @@ USES objects,                                 { Standard GFV units }
 {---------------------------------------------------------------------------}
 CONST
    mfWarning      = $0000;                            { Display a Warning box }
-   mfError        = $0001;                            { Dispaly a Error box }
+   mfError        = $0001;                            { Display a Error box }
    mfInformation  = $0002;                            { Display an Information Box }
    mfConfirmation = $0003;                            { Display a Confirmation Box }
 

+ 1 - 1
packages/fv/src/outline.inc

@@ -317,7 +317,7 @@ var position:sw_integer;
       begin
         if not lastchild then
           lines:=lines or (1 shl level);
-        {Iterate all childs.}
+        {Iterate all children}
         childcount:=getnumchildren(cur);
         for i:=0 to childcount-1 do
           begin

+ 2 - 2
packages/fv/src/resource.pas

@@ -127,7 +127,7 @@ type
       will work without problems.
 
       When using a string list in the same program as it is created, a
-      resource file is not required.  This allows language independant coding
+      resource file is not required.  This allows language independent coding
       of units without the need for conditional defines and recompiling. }
     constructor Init;
       { Creates an empty, in-memory string list that is not associated with a
@@ -218,7 +218,7 @@ var
       displayed at run-time using MessageBox or the status line hints.
 
       Using the Labels variable when creating views allows language
-      independant coding of views such as the MessageBox, StdDlg and Editors
+      independent coding of views such as the MessageBox, StdDlg and Editors
       units. }
 
   RezFile: PResourceFile;

+ 4 - 4
packages/fv/src/statuses.inc

@@ -285,7 +285,7 @@ type
   TStatusDlg = Object(TDialog)
     { A TStatusDlg displays a status view and optional buttons.  It may be
       used to display any status message and optionally provide end user
-      cancelation or pausing of an ongoing operation, such as printing.
+      cancellation or pausing of an ongoing operation, such as printing.
 
       All status views that are to be inserted into a window or dialog should
       descend from #TStatus# for proper color mapping. }
@@ -320,7 +320,7 @@ type
       { All evStatus events are accepted by the dialog and sent to each
         subview in Z-order until cleared.
 
-        If the dialog recieves an evCommand or evBroadcast event with the
+        If the dialog receives an evCommand or evBroadcast event with the
         Command parameter set to cmCancel, HandleEvent sends an #evStatus#
         message to the Application variable with Event.Command set to the
         cmStatusCancel and Event.InfoPtr set to the #Status#.Command and
@@ -329,7 +329,7 @@ type
         When a pause button is included, a cmStatusPause broadcast event is
         associated with the button.  When the button is pressed a call to
         #TStatus.Pause# results.  The status view is inactivated until it
-        receives an evStatus event with a commond of cmStatusResume and
+        receives an evStatus event with a command of cmStatusResume and
         Event.InfoPtr set to the status view's Command value.  When a pause
         button is used, the application should respond to the evStatus event
         (with Event.Command of cmStatusPause) appropriately, then dispatch a
@@ -361,7 +361,7 @@ type
 
         The size of the dialog is determined by the size of the AStatus.  The
         dialog is anchored at AStatus^.Origin and is of at least
-        AStatus^.Size + 2 in heighth and width.  The exact width and heighth
+        AStatus^.Size + 2 in heighth and width.  The exact width and height
         are determined by AOptions.
 
         AFlags contains flags which determine the buttons to be displayed

+ 6 - 6
packages/fv/src/stddlg.inc

@@ -343,7 +343,7 @@ type
       action on the file named AFile.  If the user elects to perform the
       function FileConfirmFunc's return True, otherwise they return False.
 
-      Using FileConfirmFunc's allows routines to be coded independant of the
+      Using FileConfirmFunc's allows routines to be coded independent of the
       user interface implemented.  OWL and TurboVision are supported through
       conditional defines.  If you do not use either user interface you must
       compile this unit with the conditional define cdNoMessages and set all
@@ -405,7 +405,7 @@ function FileExists (AFile : FNameStr) : Boolean;
     other directories may be searched by prefacing a file name with a valid
     directory path.
 
-    There is no check for a vaild file name or drive.  Errrors are handled
+    There is no check for a valid file name or drive.  Errors are handled
     internally and not reported in DosError.  Critical errors are left to
     the system's critical error handler. }
   {#X OpenFile }
@@ -420,7 +420,7 @@ function GetCurDrive: AnsiChar;
     operating system. }
 
 function IsWild(const S: String): Boolean;
-  { IsWild returns True if S contains a question mark (?) or asterix (*). }
+  { IsWild returns True if S contains a question mark (?) or asterisk (*). }
 
 function IsList(const S: String): Boolean;
   { IsList returns True if S contains list separator (;) AnsiChar }
@@ -475,10 +475,10 @@ function SaveAs (var AFile : FNameStr; HistoryID : Word) : Boolean;
 function SelectDir (var ADir : DirStr; HistoryID : Byte) : Boolean;
   { SelectDir prompts the user to select a directory using ADir as the
     starting directory.  If a directory is selected, SelectDir returns True.
-    The directory returned is gauranteed to exist. }
+    The directory returned is guaranteed to exist. }
 
 function ShrinkPath (AFile : FNameStr; MaxLen : Byte) : FNameStr;
-  { ShrinkPath returns a file name with a maximu length of MaxLen.
+  { ShrinkPath returns a file name with a maximum length of MaxLen.
     Internal directories are removed and replaced with elipses as needed to
     make the file name fit in MaxLen.
 
@@ -1238,7 +1238,7 @@ begin
     begin
       if IsSelectedInner then
         Result := GetColor(3)
-      else 
+      else
         Result := GetColor(6);
       Exit;
     end;

+ 1 - 1
packages/fv/src/str.inc

@@ -85,7 +85,7 @@ sReformattingTheDocument = 66; { Reformatting the document: }
 sReplace = 67; { Replace }
 sReplaceFile = 68; { Replace file?#13#10#13#3%s }
 sReplaceNotPossible = 69; { Wordwrap on:  Replace not possible in current margins when at end of line. }
-sReplaceThisOccurence = 70; { Replace this occurence? }
+sReplaceThisOccurrence = 70; { Replace this occurrence? }
 sRightMargin = 71; { Right Margin }
 sSaveAs = 72; { Save As }
 sScrollbarIcons = 73; { Scroll bar icons }

+ 1 - 1
packages/fv/src/strtxt.inc

@@ -91,7 +91,7 @@ const standard_string_count=107;
           (nr:sReplace;text:'Replace'),
           (nr:sReplaceFile;text:'Replace file?'#13#10#13#3'%s'),
           (nr:sReplaceNotPossible;text:'Wordwrap on:  Replace not possible in current margins when at end of line.'),
-          (nr:sReplaceThisOccurence;text:'Replace this occurrence?'),
+          (nr:sReplaceThisOccurrence;text:'Replace this occurrence?'),
           (nr:sRightMargin;text:'Right Margin'),
           (nr:sSaveAs;text:'Save As'),
           (nr:sScrollbarIcons;text:'Scroll bar icons'),

+ 7 - 7
packages/fv/src/time.pas

@@ -36,7 +36,7 @@
 {  Version  Date        Fix                                }
 {  -------  ---------   ---------------------------------  }
 {  1.00     06 Dec 96   First multi platform release.      }
-{  1.10     06 Jul 97   New functiions added.              }
+{  1.10     06 Jul 97   New functions added.               }
 {  1.20     22 Jul 97   FPC pascal compiler added.         }
 {  1.30     29 Aug 97   Platform.inc sort added.           }
 {  1.40     13 Oct 97   Delphi 2/3 32 bit code added.      }
@@ -274,7 +274,7 @@ END;
 {---------------------------------------------------------------------------}
 PROCEDURE SetTime (Hour, Minute, Second, Sec100: Word);
 {$IFDEF OS_DOS}                                       { DOS/DPMI CODE }
-   {$IFDEF ASM_BP}                                    { BP COMPATABLE ASM }
+   {$IFDEF ASM_BP}                                    { BP COMPATIBLE ASM }
    ASSEMBLER;
    ASM
      MOV CH, BYTE PTR Hour;                           { Fetch hour }
@@ -287,7 +287,7 @@ PROCEDURE SetTime (Hour, Minute, Second, Sec100: Word);
      POP BP;                                          { Restore register }
    END;
    {$ENDIF}
-   {$IFDEF ASM_FPC}                                   { FPC COMPATABLE ASM }
+   {$IFDEF ASM_FPC}                                   { FPC COMPATIBLE ASM }
      {$IFDEF BIT_16}
      ASSEMBLER;
      ASM
@@ -354,8 +354,8 @@ PROCEDURE SetTime (Hour, Minute, Second, Sec100: Word);
      DT.wHour := Hour;                                { Transfer hour }
      DT.wMinute := Minute;                            { Transfer minute }
      DT.wSecond := Second;                            { Transfer seconds }
-     DT.wMilliseconds := Sec100 * 10;                 { Transfer millisecs }
-     SetLocalTime(DT);                               { Set the date/time }
+     DT.wMilliseconds := Sec100 * 10;                 { Transfer milliseconds }
+     SetLocalTime(DT);                                { Set the date/time }
    END;
    {$ENDIF}
 {$ENDIF}
@@ -392,7 +392,7 @@ END;
 {---------------------------------------------------------------------------}
 PROCEDURE GetTime (Var Hour, Minute, Second, Sec100: Word);
 {$IFDEF OS_DOS}                                       { DOS/DPMI CODE }
-   {$IFDEF ASM_BP}                                    { BP COMPATABLE ASM }
+   {$IFDEF ASM_BP}                                    { BP COMPATIBLE ASM }
    ASSEMBLER;
    ASM
      MOV AX, $2C00;                                   { Set function id }
@@ -415,7 +415,7 @@ PROCEDURE GetTime (Var Hour, Minute, Second, Sec100: Word);
      STOSW;                                           { Return hours }
    END;
    {$ENDIF}
-   {$IFDEF ASM_FPC}                                   { FPC COMPATABLE ASM }
+   {$IFDEF ASM_FPC}                                   { FPC COMPATIBLE ASM }
      {$IFDEF BIT_16}
        {$IFDEF FPC_X86_DATA_NEAR}
        ASSEMBLER;

+ 4 - 4
packages/fv/src/validate.inc

@@ -106,7 +106,7 @@ USES
 {---------------------------------------------------------------------------}
 CONST
    vsOk     = 0;                                      { Validator ok }
-   vsSyntax = 1;                                      { Validator sytax err }
+   vsSyntax = 1;                                      { Validator syntax err }
 
 {---------------------------------------------------------------------------}
 {                           VALIDATOR OPTION MASKS                          }
@@ -933,7 +933,7 @@ END;
 FUNCTION TRangeValidator.Transfer (Var S: Sw_String; Buffer: Pointer; Flag: TVTransfer): Word;
 VAR Value: LongInt; Code: Sw_Integer;
 BEGIN
-   If (Options AND voTransfer <> 0) Then Begin        { Tranfer mask set }
+   If (Options AND voTransfer <> 0) Then Begin        { Transfer mask set }
      Transfer := SizeOf(Value);                       { Transfer a longint }
      Case Flag Of
        vtGetData: Begin
@@ -1007,7 +1007,7 @@ END;
 CONSTRUCTOR TStringLookUpValidator.Load (Var S: TStream);
 BEGIN
    Inherited Load(S);                                 { Call ancestor }
-   Strings := PStringCollection(S.Get);               { Fecth string list }
+   Strings := PStringCollection(S.Get);               { Fetch string list }
 END;
 
 {--TStringLookUpValidator---------------------------------------------------}
@@ -1015,7 +1015,7 @@ END;
 {---------------------------------------------------------------------------}
 DESTRUCTOR TStringLookUpValidator.Done;
 BEGIN
-   NewStringList(Nil);                                { Dispsoe string list }
+   NewStringList(Nil);                                { Dispose string list }
    Inherited Done;                                    { Call ancestor }
 END;
 

+ 10 - 10
packages/fv/src/views.inc

@@ -63,7 +63,7 @@ USES
      OS2Api.os2def, OS2Api.doscalls, OS2Api.pmwin,
    {$ENDIF}
 
-   System.Objects, 
+   System.Objects,
    {$ifdef FV_UNICODE}
    FreeVision.Ufvcommon,FreeVision.Udrivers,
    System.Unicode.Graphemebreakproperty,
@@ -71,7 +71,7 @@ USES
    FreeVision.Fvcommon,
    FreeVision.Drivers,
    {$endif}
-   FreeVision.Fvconsts, 
+   FreeVision.Fvconsts,
    { GFV standard units }
    System.Console.Video;
 {$ELSE FPC_DOTTEDUNITS}
@@ -170,7 +170,7 @@ CONST
 {                        >> NEW << VIEW DRAW MASKS                          }
 {---------------------------------------------------------------------------}
 CONST
-   vdBackGnd = $01;                                   { Draw backgound }
+   vdBackGnd = $01;                                   { Draw background }
    vdInner   = $02;                                   { Draw inner detail }
    vdCursor  = $04;                                   { Draw cursor }
    vdBorder  = $08;                                   { Draw view border }
@@ -2390,7 +2390,7 @@ END;
 PROCEDURE TGroup.EndModal (Command: Word);
 BEGIN
    If (State AND sfModal <> 0) Then                   { This view is modal }
-     EndState := Command Else                         { Set endstate }
+     EndState := Command Else                         { Set end state }
      Inherited EndModal(Command);                     { Call ancestor }
 END;
 
@@ -3230,7 +3230,7 @@ END;
 {--TScrollBar---------------------------------------------------------------}
 {  Store -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22May98 LdB             }
 {---------------------------------------------------------------------------}
-{  You can save data to the stream compatable with the old original TV by   }
+{  You can save data to the stream compatible with the old original TV by   }
 {  temporarily turning off the ofGrafVersion making the call to this store  }
 {  routine and resetting the ofGrafVersion flag after the call.             }
 {---------------------------------------------------------------------------}
@@ -3525,7 +3525,7 @@ END;
 {--TScroller----------------------------------------------------------------}
 {  Store -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Jul99 LdB             }
 {---------------------------------------------------------------------------}
-{  The scroller is saved to the stream compatable with the old TV object.   }
+{  The scroller is saved to the stream compatible with the old TV object.   }
 {---------------------------------------------------------------------------}
 PROCEDURE TScroller.Store (Var S: TStream);
 VAR i: SmallInt;
@@ -3742,7 +3742,7 @@ END;
 {---------------------------------------------------------------------------}
 PROCEDURE TListViewer.SetTopItem (Item: Sw_Integer);
 BEGIN
-   if Size.Y<> LastY then SetRange(Range);{ Reset range to ajdust to Size.Y}
+   if Size.Y<> LastY then SetRange(Range);{ Reset range to adjust to Size.Y}
    If (VScrollBar <> Nil) and (Item> VScrollBar^.Max) Then
        Item:=VScrollBar^.Max;           { Don't let overrun scrollbar limit }
    if Item>=Range then Item:=Range-1;             { Item has to be in range }
@@ -3998,7 +3998,7 @@ BEGIN
    Inherited Init(Bounds);                            { Call ancestor }
    State := State OR sfShadow;                        { View is shadowed }
    Options := Options OR (ofSelectable+ofTopSelect);  { Select options set }
-   GrowMode := gfGrowAll + gfGrowRel;                 { Set growmodes }
+   GrowMode := gfGrowAll + gfGrowRel;                 { Set growmode }
    Flags := wfMove + wfGrow + wfClose + wfZoom;       { Set flags }
 {$ifdef FV_UNICODE}
    Title := ATitle;                                   { Hold title }
@@ -4016,7 +4016,7 @@ END;
 {  Load -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 15Sep97 LdB              }
 {---------------------------------------------------------------------------}
 {   This load method will read old original TV data from a stream however   }
-{   although a frame view is read for compatability it is disposed of.      }
+{   although a frame view is read for compatibility it is disposed of.      }
 {---------------------------------------------------------------------------}
 CONSTRUCTOR TWindow.Load (Var S: TStream);
 VAR I: SmallInt;
@@ -4156,7 +4156,7 @@ END;
 {--TWindow------------------------------------------------------------------}
 {  Store -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 30Mar98 LdB             }
 {---------------------------------------------------------------------------}
-{  You can save data to the stream compatable with the old original TV by   }
+{  You can save data to the stream compatible with the old original TV by   }
 {  temporarily turning off the ofGrafVersion making the call to this store  }
 {  routine and resetting the ofGrafVersion flag after the call.             }
 {---------------------------------------------------------------------------}

+ 1 - 1
packages/ide/fp.pas

@@ -196,7 +196,7 @@ begin
             ShowReadme:=true;
           end else
         case Upcase(Param[1]) of
-          'C' : { custom config file (BP compatiblity) }
+          'C' : { custom config file (BP compatibility) }
            if BeforeINI then
             begin
               delete(param,1,1); // delete C

+ 1 - 1
packages/ide/fpcodcmp.pas

@@ -442,7 +442,7 @@ begin
   Insert(New(PLabel, Init(R2, 'Case handling', RB)));
   Insert(RB);
 
-  { Mininum length inputline }
+  { Minimum length inputline }
   R.Copy(R3); R.A.Y:=R.B.Y-7;R.B.Y:=R.A.Y+1; Dec(R.B.X); R.A.X:=R.B.X -5;
   New(MinInputL, Init(R,5));
   MinInputL^.SetValidator(New(PRangeValidator, Init(1,255)));

+ 4 - 4
packages/ide/fpcompil.pas

@@ -17,7 +17,7 @@ unit FPCompil;
 interface
 
 { don't redir under linux, because all stdout (also from the ide!) will
-  then be redired (PFV) }
+  then be redirected (PFV) }
 { this should work now correctly because
   RedirDisableAll and RedirEnableAll function are added in fpredir (PM) }
 
@@ -716,7 +716,7 @@ begin
        CompilerStatus:=true;
        exit;
     end;
-{ only display line info every 100 lines, ofcourse all other messages
+{ only display line info every 100 lines, of course all other messages
   will be displayed directly }
   if (getrealtime-lasttime>=CompilerStatusUpdateDelay) or (status.compiledlines=1) then
    begin
@@ -960,7 +960,7 @@ begin
     FileName:='"'+FileName+'"';
   if mode=cBuild then
     FileName:='-B '+FileName;
-  { tokens are created and distroed by compiler.compile !! PM }
+  { tokens are created and destroyed by compiler.compile !! PM }
   DoneTokens;
   PPasFile:='ppas'+source_info.scriptext;
   WUtils.DeleteFile(GetExePath+PpasFile);
@@ -992,7 +992,7 @@ begin
   else
     EXEFile:=DirOf(MainFile)+NameOf(MainFile)+GetTargetExeExt;
   DefaultReplacements(ExeFile);
-  { tokens are created and distroyed by compiler.compile !! PM }
+  { tokens are created and destroyed by compiler.compile !! PM }
   InitTokens;
   if LinkAfter and
      ExistsFile(GetExePath+PpasFile) and

+ 2 - 2
packages/ide/fpdesk.pas

@@ -551,7 +551,7 @@ begin
     if (W^.Flags and wfGrow)<>0 then
       WI.Bounds.B.Y:=Max(6,round(WI.Bounds.B.Y*(ScreenHeight-2)/(VM.row-2)));
   end;
-  {relocat and resize window as needed}
+  {relocate and resize window as needed}
   W^.GetBounds(R);
   if (R.A.X<>WI.Bounds.A.X) or (R.A.Y<>WI.Bounds.A.Y) then
     R.Move(WI.Bounds.A.X-R.A.X,WI.Bounds.A.Y-R.A.Y);
@@ -897,7 +897,7 @@ begin
       Setlength(Dir,Size);
       S^.Read(Dir[1], Size);                           { Read the directory }
       {$i-}ChDir(Dir);{$i+}
-      IOResult; {eat io result so it does not affect leater operations}
+      IOResult; {eat io result so it does not affect later operations}
       GetDir(0,StartUpDir);
     end;
   end;

+ 2 - 2
packages/ide/fphelp.pas

@@ -201,7 +201,7 @@ const
       hint_browser           = 'Specify global browser settings';
       hint_reloadmodifiedfile= 'Reload file modified on disk';
       hint_tools             = 'Create or change tools';
-      hint_environmentmenu   = 'Specify environment settins';
+      hint_environmentmenu   = 'Specify environment settings';
       hint_preferences       = 'Specify preferences settings';
       hint_editoroptions     = 'Specify default editor settings';
       hint_codecomplete      = 'Specify CodeComplete keywords';
@@ -218,7 +218,7 @@ const
       hint_cascade           = 'Arrange windows on desktop by cascading';
       hint_stepped           = 'Arrange windows on desktop by stepping';
       hint_closeall          = 'Close all windows on the desktop';
-      hint_resize            = 'Change the size/postion of the active window';
+      hint_resize            = 'Change the size/position of the active window';
       hint_zoom              = 'Enlarge or restore the size of the active window';
       hint_next              = 'Make the next window active';
       hint_prev              = 'Make the previous window active';

+ 7 - 7
packages/ide/fpide.pas

@@ -157,7 +157,7 @@ type
       procedure RemoveRecentFile(Index: integer);
     public
       procedure CurDirChanged;
-      procedure UpdateClockAndHeap; { update visiblity of ClockView and HeapView }
+      procedure UpdateClockAndHeap; { update visibility of ClockView and HeapView }
     private
       procedure UpdatePrimaryFile;
       procedure UpdateINIFile;
@@ -318,7 +318,7 @@ resourcestring  menu_local_gotosource = '~G~oto source';
                 menu_tools_msgprev     = 'Goto ~p~revious';
                 menu_tools_grep        = '~G~rep';
                 menu_tools_calculator  = '~C~alculator';
-                menu_tools_asciitable  = 'Ascii ~t~able';
+                menu_tools_asciitable  = 'ASCII ~T~able';
 
                 menu_options           = '~O~ptions';
                 menu_options_mode      = 'Mode~.~..';
@@ -1583,7 +1583,7 @@ begin
   UpdateScreen(true);
 {$endif go32v2}
 {$endif Windows}
-  CurDirChanged; {To avoid memory corruption, palce this call after screen resize has been done.}
+  CurDirChanged; {To avoid memory corruption, place this call after screen resize has been done.}
   displaymode:=dmIDE;
 end;
 
@@ -1601,7 +1601,7 @@ begin
       SOK:=SaveAll;
   if (AutoSaveOptions and asDesktop)<>0 then
     begin
-      { destory all help & browser windows - we don't want to store them }
+      { destroy all help & browser windows - we don't want to store them }
       { UserScreenWindow is also not registered PM }
       DoCloseUserScreenWindow;
       {$IFNDEF NODEBUG}
@@ -1777,9 +1777,9 @@ begin
 
   GetExtent(R);
   AdjustRecentCount :=0;
-  {calculate how much lines on screen for reacent files can be used }
+  {calculate how much lines on screen for recent files can be used }
   if r.b.y-r.a.y -19 > 0 then AdjustRecentCount:=r.b.y-r.a.y -19;
-  {only if there is enough space then show all reacent files }
+  {only if there is enough space then show all recent files }
   {else cut list shorter }
   if RecentFileCount < AdjustRecentCount then
      AdjustRecentCount:=RecentFileCount;
@@ -1982,7 +1982,7 @@ destructor TIDEApp.Done;
 begin
   InsideDone:=true;
   IsRunning:=false;
-  {manualy dispose ClockView and HeapView}
+  {manually dispose ClockView and HeapView}
   Delete(ClockView);
   Dispose(ClockView);
   Delete(HeapView);

+ 4 - 4
packages/ide/fpini.pas

@@ -127,7 +127,7 @@ const
   ieBrowserSymbols   = 'SymbolFlags';
   ieBrowserDisplay   = 'DisplayFlags';
   ieBrowserSub       = 'SubBrowsing';
-  ieBrowserPane      = 'PreferrdPane';
+  ieBrowserPane      = 'PreferredPane';
   ieOpenExts         = 'OpenExts';
   ieHighlightExts    = 'Exts';
   ieTabsPattern      = 'NeedsTabs';
@@ -486,7 +486,7 @@ begin
   DefaultSaveExt:=INIFile^.GetEntry(secEditor,ieDefaultSaveExt,DefaultSaveExt);
   { Browser }
   DefaultSymbolFlags:=INIFile^.GetIntEntry(secBrowser,ieBrowserSymbols,DefaultSymbolFlags);
-  DefaultDispayFlags:=INIFile^.GetIntEntry(secBrowser,ieBrowserDisplay,DefaultDispayFlags);
+  DefaultDisplayFlags:=INIFile^.GetIntEntry(secBrowser,ieBrowserDisplay,DefaultDisplayFlags);
   DefaultBrowserSub:=INIFile^.GetIntEntry(secBrowser,ieBrowserSub,DefaultBrowserSub);
   DefaultBrowserPane:=INIFile^.GetIntEntry(secBrowser,ieBrowserPane,DefaultBrowserPane);
   { Highlight }
@@ -580,7 +580,7 @@ begin
         TryToOpenFile(@R,S1,X,Y,false)
       else
         TryToOpenFile(nil,S1,X,Y,false);
-      { remove it because otherwise we allways keep old files }
+      { remove it because otherwise we always keep old files }
       INIFile^.DeleteEntry(secFiles,ieOpenFile+IntToStr(I));
     end;
 *)
@@ -712,7 +712,7 @@ begin
   INIFile^.SetEntry(secEditor,ieDefaultSaveExt,DefaultSaveExt);
   { Browser }
   INIFile^.SetIntEntry(secBrowser,ieBrowserSymbols,DefaultSymbolFlags);
-  INIFile^.SetIntEntry(secBrowser,ieBrowserDisplay,DefaultDispayFlags);
+  INIFile^.SetIntEntry(secBrowser,ieBrowserDisplay,DefaultDisplayFlags);
   INIFile^.SetIntEntry(secBrowser,ieBrowserSub,DefaultBrowserSub);
   INIFile^.SetIntEntry(secBrowser,ieBrowserPane,DefaultBrowserPane);
   { Highlight }

+ 1 - 1
packages/ide/fpmcomp.inc

@@ -61,7 +61,7 @@ begin
   if Desktop^.ExecView(D)=cmOK then
     begin
        TargetSwitches^.SetCurrSel(RB^.Value);
-       { we allways need to recompile if we change
+       { we always need to recompile if we change
          the target OS PM }
        if L<>RB^.Value then
          PrevMainFile:='';

+ 1 - 1
packages/ide/fpmdebug.inc

@@ -44,7 +44,7 @@ end;
 procedure TIDEApp.DoUserScreenWindow;
 begin
   {$ifdef HASAMIGA}
-  Exit; // Do not open the Userscreen on AMIGA systems, its not closeable
+  Exit; // Do not open the Userscreen on AMIGA systems, its not closable
   {$endif}
   if UserScreenWindow=nil then
     begin

+ 1 - 1
packages/ide/fpmingw.pas

@@ -32,7 +32,7 @@ implementation
 
 uses
   windows,
-  gdbint; // force dependancies that hopefully make it execute at the right moment.
+  gdbint; // force dependencies that hopefully make it execute at the right moment.
 
 // prototype of atexit:
 Type

+ 7 - 7
packages/ide/fpmopts.inc

@@ -90,7 +90,7 @@ begin
   Count:=max(Count,ProcessorCodeGenerationSwitches^.ItemCount); {lines we need to be able to show}
   if Count < 10 then Count:=10; {10 lines are needed in Assembler page}
   TargetHeight:=Count+11; {11 lines for rest (empty lines, borders, pages, conditions...)}
-  if TargetHeight> 31 then TargetHeight:=31; {don't go wild, limit ourselvs on 31 line}
+  if TargetHeight> 31 then TargetHeight:=31; {don't go wild, limit ourselves on 31 line}
   if (R.B.Y-R.A.Y) < (TargetHeight+5) then
     TargetHeight:= (R.B.Y-R.A.Y)-5; {screen allow exactly this much lines}
   if TargetHeight<21 then
@@ -355,7 +355,7 @@ begin
     Tab^.GrowMode:=0;
     Insert(Tab);
 
-    { conditionnals }
+    { conditionals }
     R2.Copy(TabR); R2.A.Y:=R2.B.Y+1; R2.B.Y:=R2.A.Y+1; Dec(R2.B.X,4);
     New(IL, Init(R2, 255));
     IL^.Data^:=ConditionalSwitches^.GetStringItem(0);
@@ -935,7 +935,7 @@ begin
             c^.freeall;
             for j:=0 to e^.GetLineCount-1 do
               begin
-                s:=e^.GetLineText(j);   { Note: AnsiString to ShortString convertino}
+                s:=e^.GetLineText(j);   { Note: AnsiString to ShortString convertion}
                 s:=Trim(s);
                 if s<>'' then
                   c^.insert(newstr(s));
@@ -1137,7 +1137,7 @@ begin
       NewSItem(label_preferences_showheapmonitor,
       nil))));
     CB3^.Value:=DesktopPreferences;
-    if OverrideHeapMonitor then  { if heap motior state is set by fp parameter }
+    if OverrideHeapMonitor then  { if heap monitor state is set by fp parameter }
       CB3^.EnableMask:=CB3^.EnableMask and not(dpHeapMonitor); { disable heap monitor check box }
     Insert(New(PGroupView, Init(R, label_preferences_clockheap, CB3)));
     Insert(CB3);
@@ -1374,7 +1374,7 @@ begin
   begin    { Default browser options }
     TitleS:=dialog_browseroptions;
     SymbolsFlags := DefaultSymbolFlags;
-    DisplayFlags := DefaultDispayFlags;
+    DisplayFlags := DefaultDisplayFlags;
     BrowserSub:=DefaultBrowserSub;
     BrowserPane:=DefaultBrowserPane;
     DialogWidth:=56;
@@ -1390,7 +1390,7 @@ begin
     DialogWidth:=56-20;
     SymbolsHight:=7;
     DisplayHight:=2;
-    RB1:=nil; {it is not suppoused to be valid}
+    RB1:=nil; {it is not supposed to be valid}
   end;
   R.Assign(0,0,DialogWidth,16);
   New(D, Init(R, TitleS));
@@ -1462,7 +1462,7 @@ begin
     begin
       {DefaultBrowserFlags:=BrowserFlags;}
       DefaultSymbolFlags:=SymbolsFlags;
-      DefaultDispayFlags:=DisplayFlags;
+      DefaultDisplayFlags:=DisplayFlags;
       DefaultBrowserSub:=RB1^.Value;
       DefaultBrowserPane:=RB2^.Value;
     end else

+ 2 - 2
packages/ide/fpmrun.inc

@@ -240,9 +240,9 @@ begin
               else
                 Debugger^.Run;
               RunDirect:=false;
-              {we are about to run debuger, AutoSave first}
+              {we are about to run debugger, AutoSave first}
               SaveCancelled:=false;
-              AutoSave; {ignore result, ignore if canceled}
+              AutoSave; {ignore result, ignore if cancelled}
             end;
         end;
 {$endif ndef NODEBUG}

+ 1 - 1
packages/ide/fpredir.pas

@@ -811,7 +811,7 @@ end;
     {We need to use fpsystem to get wildcard expansion and avoid being
      interrupted by ctrl+c (SIGINT).
      But used wifexited and wexitstatus functions
-     to correctly interpret fpsystem reutrn value }
+     to correctly interpret fpsystem return value }
      s:=fpsystem(MaybeQuoted(FixPath(Progname))+' '+Comline);
      if wifexited(s) then
        ExecuteResult:=wexitstatus(s)

+ 3 - 3
packages/ide/fpregs.pas

@@ -513,7 +513,7 @@ const
            OK:=GetIntRegs(rs);
            LastOK:=OK;
            NewReg:=rs;
-           { get inital values }
+           { get initial values }
            if first then
              begin
                OldReg:=NewReg;
@@ -1083,7 +1083,7 @@ const
              );
            LastOK:=OK;
            NewReg:=rs;
-           { get inital values }
+           { get initial values }
            if first then
              begin
                OldReg:=NewReg;
@@ -1468,7 +1468,7 @@ const
              );
            LastOK:=OK;
            NewReg:=rs;
-           { get inital values }
+           { get initial values }
            if first then
              begin
                OldReg:=NewReg;

+ 1 - 1
packages/ide/fpswitch.pas

@@ -1514,7 +1514,7 @@ begin
                OtherLinkerSwitches^.SetBooleanItem(0,true);
             end;
        end;
-       { set appriopriate default target }
+       { set appropriate default target }
        TargetSwitches^.SetCurrSelParam(target_info.shortname);
     end;
   SwitchesMode:=OldSwitchesMode;

+ 9 - 9
packages/ide/fpsymbol.pas

@@ -49,9 +49,9 @@ const
 const
       DefaultSymbolFlags : longint = bfUnits or
          bfLabels or bfConstants or bfTypes or bfVariables or bfProcedures;
-      DefaultDispayFlags : longint = (bfQualifiedSymbols) shr 30;
+      DefaultDisplayFlags : longint = (bfQualifiedSymbols) shr 30;
       { Note: default browser flags will be created with formula:
-        BrowserFlags:=DefaultDispayFlags shl 30 or DefaultSymbolFlags;
+        BrowserFlags:=DefaultDisplayFlags shl 30 or DefaultSymbolFlags;
       }
       DefaultBrowserSub  : longint = 0;
       DefaultBrowserPane : longint = 0;
@@ -82,7 +82,7 @@ type
       {Shell of TSymbol used to filter inherited and to display qualified symbols }
     PHollowSymbol = ^THollowSymbol;
     THollowSymbol = object(TSymbol)
-        Sym        : PSymbol; { orginal symbol, need for unit info save}
+        Sym        : PSymbol; { original symbol, need for unit info save}
         Parent     : PSymbol; { to get object name from }
         NeedPrefix : Boolean; { GetName will add object prefix if needed }
         constructor Init(ASymbol,AParent:PSymbol);
@@ -301,7 +301,7 @@ type
     end;
 
     { Tree to go to previous browser windows }
-    { Holds all parametrs to recreate closed previous window if needed to be}
+    { Holds all parameters to recreate closed previous window if needed to be}
     TBrowserLinked = Object(TObject)
         BrowserWindow : PBrowserWindow;
         Previous : PBrowserLinked;
@@ -1182,7 +1182,7 @@ begin
       if Idx<>-1 then
         begin
           { Have found, but get filtered list index first
-            Some entries might be missing if need then look up agin }
+            Some entries might be missing if need then look up again }
           Idx:=GetFilteredLookUpIdx(Idx);
           if Idx<>-1 then
           begin
@@ -1337,7 +1337,7 @@ begin
         {----------  only selected ones  ----------}
         S^.NeedPrefix:=bQua;
         if Inh then  { we are in object scope view }
-          if not bInh then  { Inherite checkbox is not selected }
+          if not bInh then  { Inherited checkbox is not selected }
             if S^.Parent <> ObjSymbol then continue;
         case S^.typ of
           labelsym: if not bLab then continue;
@@ -2208,7 +2208,7 @@ begin
   HelpCtx:=hcBrowserWindow;
   Sym:=ASym;
   Prefix:=NewStr(APrefix);
-  BrowserFlags:=DefaultDispayFlags shl 30 or DefaultSymbolFlags;
+  BrowserFlags:=DefaultDisplayFlags shl 30 or DefaultSymbolFlags;
 
   GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+1;
 {$ifndef NODEBUG}
@@ -2399,7 +2399,7 @@ begin
   PageTab^.GrowMode:=gfGrowHiX;
   Insert(PageTab);
 
-  if assigned(ScopeView) {Scope assinged and chosen to be selected by default}
+  if assigned(ScopeView) {Scope assigned and chosen to be selected by default}
     and ((DefaultBrowserPane=0) or not assigned(ReferenceView)) then
     SelectTab(btScope)
   else if assigned(ReferenceView) then
@@ -2638,7 +2638,7 @@ var Y, uL,dL,tL: sw_integer;
 begin
   if (PrevSize.Y<>Size.Y) then
   begin
-    {-- unit info page resize manualy --}
+    {-- unit info page resize manually --}
     if assigned(UnitInfo) then
     begin
       { get number of lines everyone needs }

+ 1 - 1
packages/ide/fptools.pas

@@ -1261,7 +1261,7 @@ begin
                           I:=I+ReplacePart(LastWordStart,I-1,S)-1;
                   end;
                 end
-              else { just prompt for parms }
+              else { just prompt for parameters }
                 begin
                   I:=I+ReplacePart(LastWordStart,I-1,'')-1;
                   if CheckOnly=false then

+ 3 - 3
packages/ide/fpusrscr.pas

@@ -440,7 +440,7 @@ end;
 procedure TDOSScreen.FreeGraphBuffer;
 begin
   { We don't want to restore the last user screen if
-    it was a grpahic screen, for example if we
+    it was a graphic screen, for example if we
     leave in the middle of the debugging of a
     graphic program, so we first
     dispose the graphic buffer, thus
@@ -999,7 +999,7 @@ begin
   GetConsoleScreenBufferInfo(StartScreenBufferHandle,
     @ConsoleScreenBufferInfo);
   BigWin.X:=ConsoleScreenBufferInfo.dwSize.X;
-  BigWin.Y:=ConsoleScreenBufferInfo.srwindow.bottom-ConsoleScreenBufferInfo.srwindow.top; // mants 15779 was 200
+  BigWin.Y:=ConsoleScreenBufferInfo.srwindow.bottom-ConsoleScreenBufferInfo.srwindow.top; // mantis 15779 was 200
   { Try to allow to store more info }
   res:=SetConsoleScreenBufferSize(NewScreenBufferHandle,BigWin);
   if not res then
@@ -1017,7 +1017,7 @@ begin
   BigWin.Y:=ConsoleScreenBufferInfo.srwindow.bottom-ConsoleScreenBufferInfo.srwindow.top;
   res:=SetConsoleScreenBufferSize(NewScreenBufferHandle,
      BigWin);
-// mants 15779 : was
+// mantis 15779 : was
 //  res:=SetConsoleScreenBufferSize(NewScreenBufferHandle,
 //         ConsoleScreenBufferInfo.dwMaximumWindowSize);
   if not res then

+ 1 - 1
packages/ide/fputils.pas

@@ -2,7 +2,7 @@
     This file is part of the Free Pascal Integrated Development Environment
     Copyright (c) 1998 by Berczi Gabor
 
-    Utilility routines used by the IDE
+    Utility routines used by the IDE
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.

+ 1 - 1
packages/ide/fpvars.pas

@@ -112,7 +112,7 @@ const INIFileName      : string = ININame;
                                    dfCodeCompleteWords+dfCodeTemplates;
       DesktopLocation  : byte    = dlConfigFileDir;
       AutoSaveOptions  : longint = asEnvironment+asDesktop;
-      DesktopPreferences:longint = 0; { by default show no Clock, no Heap mointor }
+      DesktopPreferences:longint = 0; { by default show no Clock, no Heap monitor }
       MiscOptions      : longint = moChangeDirOnOpen+moCloseOnGotoSource;
       EditorModified   : boolean = false;
       IniCenterDebuggerRow : tcentre = do_centre;

+ 5 - 5
packages/ide/fpviews.pas

@@ -139,7 +139,7 @@ type
     TSourceEditor = object(TFileEditor)
       CompileStamp : longint;
       CodeCompleteTip: PFPToolTip;
-      {for nested comments managment}
+      {for nested comments management}
       SwitchesNestedComments : boolean;
       NestedComments : boolean;
       FixedNestedComments : TPoint;
@@ -581,7 +581,7 @@ uses
      ag68kgas,
   {$endif}
 {$ifdef USE_EXTERNAL_COMPILER}
-   fpintf, { superseeds version_string of version unit }
+   fpintf, { supersedes version_string of version unit }
 {$endif USE_EXTERNAL_COMPILER}
   {$ifdef VESA}Vesa,{$endif}
   FPSymbol,FPDebug,FPVars,FPUtils,FPCompil,FPHelp,
@@ -1457,7 +1457,7 @@ begin
   ResultIsSet:=false;
   RegisterNestnessPoint(0,0);
   if (not IsFlagSet(efSyntaxHighlight)) then
-  begin {not ment to be syntax highlighted }
+  begin { not meant to be syntax highlighted }
     FixedNestedComments.Y:=0;
     FixedNestedComments.X:=0;
     exit;
@@ -4660,11 +4660,11 @@ begin
    DInput := New(PEditorInputLine, Init(R, FileNameLen+4));
    DInput^.GrowMode:=gfGrowHiX;
    DInput^.SetData(S);
-   InsertBefore(DInput,DirInput); {insert before to preserv order as it was}
+   InsertBefore(DInput,DirInput); {insert before to preserve order as it was}
    Delete(DirInput);
    Dispose(DirInput,done);
    DirInput:=DInput;
-   Control:=DirInput^.Next; {here we make assumption that THistory control will folow}
+   Control:=DirInput^.Next; {here we make assumption that THistory control will follow}
    while (Control<> nil) do
    begin
      if TypeOf(Control^) = TypeOf(THistory) then

+ 3 - 3
packages/ide/gdbmiint.pas

@@ -368,10 +368,10 @@ Ignore:
         {    TODO: maybe show information to the user about the signal
           we have:
                GDB.ExecAsyncOutput.Parameters['signal-name'].AsString (e.g. 'SIGTERM')
-               GDB.ExecAsyncOutput.PArameters['signal-meaning'].AsString (e.g. 'Terminated')
+               GDB.ExecAsyncOutput.Parameters['signal-meaning'].AsString (e.g. 'Terminated')
           }
         LocalSignalName:=GDB.ExecAsyncOutput.Parameters['signal-name'].AsString;
-        LocalSignalString:=GDB.ExecAsyncOutput.PArameters['signal-meaning'].AsString;
+        LocalSignalString:=GDB.ExecAsyncOutput.Parameters['signal-meaning'].AsString;
         signal_name:=@LocalSignalName;
         signal_string:=@LocalSignalString;
         if (user_screen_shown) then
@@ -454,7 +454,7 @@ Ignore:
         {    TODO: maybe show information to the user about the signal
           we have:
                GDB.ExecAsyncOutput.Parameters['signal-name'].AsString (e.g. 'SIGTERM')
-               GDB.ExecAsyncOutput.PArameters['signal-meaning'].AsString (e.g. 'Terminated')
+               GDB.ExecAsyncOutput.Parameters['signal-meaning'].AsString (e.g. 'Terminated')
           }
         DoEndSession(1);
       end;

+ 1 - 1
packages/ide/globdir.inc

@@ -18,7 +18,7 @@
 {$ifdef Go32V2}
   { NOVESA conditional avoids use of
     vesa unit, it also disables USE_GRAPH_SWITCH
-    conditional, in order to obtain a go32v2 excutable that
+    conditional, in order to obtain a go32v2 executable that
     doesn't require full screen switching
     at startup on Windows OS }
   {$ifndef NOVESA}

+ 14 - 14
packages/ide/weditor.pas

@@ -300,7 +300,7 @@ type
       function    GetMark(Index:Sw_integer):PEditorBookMark; virtual;
       procedure   AdjustMark(APosX,Adjustment:Sw_integer); virtual;
       { Syntax information is now generated separately for each editor instance.
-        This is not neccessary for a one-language IDE, but this unit contains
+        This is not necessary for a one-language IDE, but this unit contains
         a _generic_ editor object, which should be (and is) as flexible as
         possible.
         The overhead caused by generating the same syntax info for ex.
@@ -2395,7 +2395,7 @@ var
     tmpIs:=(MatchesAnySpecSymbol(ssCommentPrefix,pmLeft));
     if tmpIs
       and (CurrentCommentType=2) {bad, we are making assumption that this is comment opener (* }
-      and (LineText[X+1]=')') { looking into next char is bad aproach but it is working }
+      and (LineText[X+1]=')') { looking into next char is bad approach but it is working }
       then
         tmpIs:=false;  { in comment this "(*)" is not start of new nested comment but end }
     IsMatchingCommentPrefix:= tmpIs and (CurrentCommentType=SymbolIndex);
@@ -2698,7 +2698,7 @@ var
                 begin
                   inc(CurrentCommentDepth);
                   if LookForNestedComments then
-                  begin  { once per every nested comment test IsNestedCommments }
+                  begin  { once per every nested comment test IsNestedComments }
                     LookForNestedComments:=false;
                     NestedComments:=Editor^.IsNestedComments(X,CurLineNr);
                   end;
@@ -2786,7 +2786,7 @@ begin
     PrevLine:=GetLine(CurLineNr-1)
   else
     PrevLine:=nil;
-  CommentStartY:=CurLineNr-1; { use in detection for false positive commment: (*) }
+  CommentStartY:=CurLineNr-1; { use in detection for false positive comment: (*) }
   repeat
     Line:=GetLine(CurLineNr);
     if Assigned(PrevLine) then PrevLI:=PrevLine^.GetEditorInfo(Editor) else PrevLI:=nil;
@@ -4397,7 +4397,7 @@ begin
                 FreeFormat[X]:=false;
               end;
 
-            { redundant check, for loop condition is taking care of coorect range
+            { redundant check, for loop condition is taking care of correct range
             if (0<=LSX+X-1-Delta.X) and (LSX+X-1-Delta.X<MaxViewWidth) then  }
               MoveChar(B[LSX+X-1-Delta.X],C,Color,1);
           end; { for X:=1 to ... }
@@ -4425,7 +4425,7 @@ begin
       SetCursor(GetReservedColCount+CurPos.X-Delta.X,EditorToViewLine(CurPos.Y)-Delta.Y);
       InsertMode:=Overwrite;
       if IsFlagSet (efBlockInsCursor) then
-         InsertMode:=not InsertMode; {revers insert and overwrite mode cursor shapes}
+         InsertMode:=not InsertMode; {reverse insert and overwrite mode cursor shapes}
       SetState(sfCursorIns,InsertMode);
     end;
 end;
@@ -4847,7 +4847,7 @@ begin
   else
     SetCurPtr(CurPos.X,Delta.Y);
  end;
- 
+
  procedure TCustomCodeEditor.WindowEnd;
  begin
   if not NoSelect and ShouldExtend then
@@ -4903,7 +4903,7 @@ begin
     if Assigned(Line) then
       Line^.InsertMark(@Self,@Bookmarks[MarkIdx])
     else
-      Bookmarks[MarkIdx].Valid:=false; {this should not be ever reached, but safty first}
+      Bookmarks[MarkIdx].Valid:=false; {this should not be ever reached, but safety first}
   end;
 end;
 
@@ -6691,7 +6691,7 @@ begin
   begin
     Lines:=GetLineCount;
     {Linecount can be 0, but in that case there still is a cursor blinking in top
-     of the window, which will become line 1 as soon as sometype hits a key.}
+     of the window, which will become line 1 as soon as someone hits a key.}
     if lines=0 then
       lines:=1;
     if EditorDialog(edGotoLine, @GotoRec) <> cmCancel then
@@ -7273,7 +7273,7 @@ begin
   Lock;
 
   { here should be some kind or "mark" or "break" inserted in the Undo
-    information, so activating it "undoes" only the completition first and
+    information, so activating it "undoes" only the completion first and
     doesn't delete the complete word at once... - Gabor }
 
   FragLen:=Length(GetCodeCompleteFrag);
@@ -7354,7 +7354,7 @@ begin
       else if (SelStart.Y < SelEnd.Y) and ( ((SelStart.Y=CurPos.Y) and (SelStart.X<=CurPos.X)) or ((SelEnd.Y=CurPos.Y) and (SelEnd.X>=CurPos.X))) then
         InSelectionArea:=true  {in first line or last line}
       else if (SelStart.Y > SelEnd.Y) and ( ((SelStart.Y=CurPos.Y) and (SelStart.X>=CurPos.X)) or ((SelEnd.Y=CurPos.Y) and (SelEnd.X<=CurPos.X))) then
-        InSelectionArea:=true; {in first line or last line (selection Start and End revers)}
+        InSelectionArea:=true; {in first line or last line (selection Start and End reverse)}
     end;
 end;
 
@@ -7439,7 +7439,7 @@ begin
    dec(ey);
   S:='';
   { Find shortest white space of beginning of line from all lines
-    for simplisity reason Tab is not recognized as white space in this regard }
+    for simplicity reason Tab is not recognized as white space in this regard }
   LLen:=0;
   WhiteLen:=-1;
   WhiteLen:= WhiteLen shr 1; { logical SHR to get max sw_integer }
@@ -7694,7 +7694,7 @@ begin
   while OK and (Line<=EndP.Y) and (Line<GetLineCount) do
   begin
     S:=GetLineText(Line);
-    { Remove all traling spaces PM }
+    { Remove all trailing spaces PM }
     if not Editor^.IsFlagSet(efKeepTrailingSpaces) then
       s:=RTrim(S,False); // removes trailing #0 too
     { if FlagSet(efUseTabCharacters) then
@@ -7988,7 +7988,7 @@ begin
   DInput := New(PFPFileInputLine, Init(R, 79{FileNameLen+4}));
   DInput^.SetData(S);
   DInput^.GrowMode:=FileName^.GrowMode;
-  InsertBefore(DInput,FileName); {insert before to preserv order as it was}
+  InsertBefore(DInput,FileName); {insert before to preserve order as it was}
   Delete(FileName);
   Dispose(FileName,done);
   FileName:=DInput;

+ 1 - 1
packages/ide/whlpview.pas

@@ -887,7 +887,7 @@ begin
   begin
     if Y=R.A.Y then StartX:=R.A.X else StartX:=Margin;
     if Y=R.B.Y then EndX:=R.B.X else EndX:=High(S);
-    S:=S+copy(GetLineText(Y),StartX+1,EndX-StartX+1);   { Note: AnsiString to ShortString convertino}
+    S:=S+copy(GetLineText(Y),StartX+1,EndX-StartX+1);   { Note: AnsiString to ShortString convertion}
     Inc(Y);
   end;
   GetLinkText:=S;

+ 6 - 6
packages/ide/whtml.pas

@@ -441,7 +441,7 @@ begin
   if (Code=165) or (Name='yen')    then E:=''   else { yen sign                      }
   if (Code=166) or (Name='brvbar') then E:='|'   else { broken vertical bar           }
   if (Code=167) or (Name='sect')   then E:=''   else { section sign                  }
-  if (Code=168) or (Name='uml')    then E:='"'   else { umlaut  (dieresis)            }
+  if (Code=168) or (Name='uml')    then E:='"'   else { umlaut  (diaeresis)           }
   if (Code=169) or (Name='copy')   then E:='(C)' else { copyright sign                }
 (*  if (Code=170) or (Name='ordf')   then E:=#255  else { ordinal indicator, feminine   }*)
   if (Code=171) or (Name='laquo')  then E:='"'   else { angle quotation mark -left    }
@@ -460,7 +460,7 @@ begin
 (*  if (Code=184) or (Name='cedil')  then E:='?'   else { cedilla                       }*)
   if (Code=185) or (Name='sup1')   then E:='^1'  else { superscript 1                 }
 (*  if (Code=186) or (Name='ordm')   then E:='?'   else { ordinal indicator, masculine  }*)
-  if (Code=187) or (Name='raquo')  then E:='"'   else { angle quoatation mark -right  }
+  if (Code=187) or (Name='raquo')  then E:='"'   else { angle quotation mark -right   }
   if (Code=188) or (Name='frac14') then E:='¬'   else { fraction one-quarter          }
   if (Code=189) or (Name='frac12') then E:='«'   else { fraction one-half             }
   if (Code=190) or (Name='frac34') then E:='3/4' else { fraction three-quarters       }
@@ -476,11 +476,11 @@ begin
   if (Code=200) or (Name='Egrave') then E:=''   else { capital E, grave accent       }
   if (Code=201) or (Name='Eacute') then E:=''   else { capital E, acute accent       }
   if (Code=202) or (Name='Ecirc')  then E:='E'   else { capital E, circumflex accent  }
-  if (Code=203) or (Name='Euml')   then E:='E'   else { capital E, dieresis or umlaut }
+  if (Code=203) or (Name='Euml')   then E:='E'   else { capital E, diaeresis or umlaut}
   if (Code=204) or (Name='Igrave') then E:='I'   else { capital I, grave accent       }
   if (Code=205) or (Name='Iacute') then E:='I'   else { capital I, acute accent       }
   if (Code=206) or (Name='Icirc')  then E:='I'   else { capital I, circumflex accent  }
-  if (Code=207) or (Name='Iuml')   then E:='I'   else { capital I, dieresis or umlaut }
+  if (Code=207) or (Name='Iuml')   then E:='I'   else { capital I, diaeresis or umlaut}
 (*  if (Code=208) or (Name='ETH')    then E:='?'   else { capital Eth, Icelandic        }*)
   if (Code=209) or (Name='Ntidle') then E:='¥'   else { capital N, tilde              }
   if (Code=210) or (Name='Ograve') then E:='O'   else { capital O, grave accent       }
@@ -525,10 +525,10 @@ begin
   if (Code=249) or (Name='ugrave') then E:='—'   else { small u, grave accent         }
   if (Code=250) or (Name='uacute') then E:='£'   else { small u, acute accent         }
   if (Code=251) or (Name='ucirc')  then E:='–'   else { small u, circumflex accent    }
-  if (Code=252) or (Name='uuml')   then E:=''   else { small u, dieresis or umlaut   }
+  if (Code=252) or (Name='uuml')   then E:=''   else { small u, diaeresis or umlaut   }
   if (Code=253) or (Name='yacute') then E:='y'   else { small y, acute accent         }
 (*  if (Code=254) or (Name='thorn')  then E:='?'   else { small thorn, Icelandic        }*)
-  if (Code=255) or (Name='yuml')   then E:='y'   else { small y, dieresis or umlaut   }
+  if (Code=255) or (Name='yuml')   then E:='y'   else { small y, diaeresis or umlaut  }
   { Special codes appearing in TeXH generated files }
   if (code=$2c6{710}) or (Name='circ')  then E:='^' else      { Modifier Letter Circumflex Accent }
   if (code=$2dc{732}) or (Name='tilde') then E:='~' else      { Small tilde }

+ 4 - 4
packages/ide/whtmlhlp.pas

@@ -734,7 +734,7 @@ begin
  CanonicalizeURL:=CompleteURL(Base,relative);
 end;
 
-procedure THTMLTopicRenderer.Resolve( href: ansistring; var AFileId,ALinkId : sw_integer); 
+procedure THTMLTopicRenderer.Resolve( href: ansistring; var AFileId,ALinkId : sw_integer);
 begin
 {$IFDEF WDEBUG}
               DebugMessageS({$i %file%},' htmlresolve "'+HRef+'"',{$i %line%},'1',0,0);
@@ -792,7 +792,7 @@ begin
         begin
 {$IFDEF WDEBUG}
           DebugMessage(GetFileName,' Found '+SuppressUntil+'comment "'
-            +Comment+'" SuppressOuput reset to false',Line,1);
+            +Comment+'" SuppressOutput reset to false',Line,1);
 {$endif WDEBUG}
           SuppressOutput:=false;
           SuppressUntil:='';
@@ -1362,14 +1362,14 @@ begin
    CanonicalizeUrl:=relative;
 end;
 
-procedure TCHMTopicRenderer.Resolve( href: ansistring; var AFileId,ALinkId : sw_integer); 
+procedure TCHMTopicRenderer.Resolve( href: ansistring; var AFileId,ALinkId : sw_integer);
 var resolved:boolean;
 begin
 {$IFDEF WDEBUG}
   DebugMessageS({$i %file%},' chmresolve "'+HRef+'"',{$i %line%},'1',0,0);
 {$ENDIF WDEBUG}
   resolved:=false; AFileID:=0; ALinkID:=0;	
-  href:=stringreplace(href,'%20',' '); 
+  href:=stringreplace(href,'%20',' ');
   if copy(href,1,7)='ms-its:' then
     resolved:=CHMResolve(Href,AFileId,ALinkID);
   if not resolved then

+ 1 - 1
packages/ide/winclip.pas

@@ -218,7 +218,7 @@ var
   M : MemPtr;
 {$endif DOS}
 {$ifdef linux}
-  rez : boolean; {one variable needed to satifay compiler}
+  rez : boolean; {one variable needed to satisfy compiler}
 {$endif linux}
 {$ifdef Windows}
   h : HGlobal;

+ 1 - 1
packages/ide/wnghelp.pas

@@ -394,7 +394,7 @@ begin
          AddFormatParamInt(R.SClass);
          AddFormatParamInt(L);
          AddFormatParamInt(R.Size);
-         ErrorBox('Uknown help record tag %x encountered, '+
+         ErrorBox('Unknown help record tag %x encountered, '+
                   'offset %x, size %d',@FormatParams);
        {$else}
          {Skip};

+ 1 - 1
packages/ide/woahelp.pas

@@ -181,7 +181,7 @@ begin
        AddFormatParamInt(R.SClass);
        AddFormatParamInt(L);
        AddFormatParamInt(R.Size);
-       ErrorBox('Uknown help record tag %x encountered, '+
+       ErrorBox('Unknown help record tag %x encountered, '+
                 'offset %x, size %d',@FormatParams);
      {$else}
        {Skip};

+ 1 - 1
packages/ide/wos2help.pas

@@ -84,7 +84,7 @@ type
 
       TINFTOCEntry = packed record
         Size     : byte; { length of the entry including this byte    }
-        Flags    : byte; { flag byte, description folows (MSB first)  }
+        Flags    : byte; { flag byte, description follows (MSB first)  }
         NumSlots : byte; { number of "slots" occupied by the text for }
                          { this toc entry                             }
         Slots    : record end;

+ 2 - 2
packages/ide/wviews.pas

@@ -151,7 +151,7 @@ type
     end;
 
     { Dialog that broadcasts empty space mouse clicks }
-    { Needed for dialogs that contines TDropDownListBox }
+    { Needed for dialogs that contains TDropDownListBox }
     PDialogEmptyClick = ^TDialogEmptyClick;
     TDialogEmptyClick = object(TCenterDialog)
       procedure HandleEvent(var Event: TEvent); virtual;
@@ -2279,7 +2279,7 @@ begin
 {          ListBox^.List:=nil;}
           InDel:=true;
           LB:=ListBox; ListBox:=nil; { this prevents GPFs while deleting }
-          Owner^.Delete(LB);  { GPFs have been resoved by not calling this rotine from ListBox itself  M }
+          Owner^.Delete(LB);  { GPFs have been resolved by not calling this routine from ListBox itself  M }
           Dispose(LB, Done);
         end;
       if SB<>nil then

+ 1 - 1
packages/ide/wwinhelp.pas

@@ -1444,7 +1444,7 @@ begin
           {Column:=}ReadSHORT; {-1 = end of topic}
           {Unknown:=}ReadSHORT; {Always0:=}ReadCHAR;
         end;
-        {Unknown:=}ReadUCHAR; {Uknown:=}ReadCHAR;
+        {Unknown:=}ReadUCHAR; {Unknown:=}ReadCHAR;
         ID:=ReadUSHORT;
         Flags:=ReadUSHORT;
         if (Flags and 1)<>0 then

+ 1 - 1
packages/rtl-generics/readme.txt

@@ -1,6 +1,6 @@
 
 This directory contains the rtl-generics units. These units are created 
-outside the FPC source tree by Macie Izak, see:
+outside the FPC source tree by Maciej Izak, see:
 
 https://github.com/maciej-izak/generics.collections
 

+ 8 - 0
rtl/inc/objpas.inc

@@ -438,6 +438,10 @@ end;
 
       destructor TObject.Destroy;
         begin
+          {$IFDEF ENABLE_OBJECTHOOK}
+          if assigned(DestroyObjectHook) then
+            DestroyObjectHook(Self);
+          {$ENDIF}
         end;
 
       procedure TObject.Free;
@@ -538,6 +542,10 @@ end;
 {$endif def FPC_HAS_FEATURE_RTTI}
 
            InitInstance:=TObject(Instance);
+           {$IFDEF ENABLE_OBJECTHOOK}
+           If Assigned(AllocateObjectHook) then
+             AllocateObjectHook(TObject(Instance));
+           {$ENDIF}
         end;
 
       class function TObject.ClassParent : tclass;

+ 9 - 0
rtl/inc/objpash.inc

@@ -252,6 +252,15 @@
        protected
           function GetDisposed : Boolean; inline;
           Property Disposed : Boolean Read GetDisposed;
+      {$IFDEF ENABLE_OBJECTHOOK}
+       public
+          Type
+             TObjectHook = procedure(aObject : TObject);
+          class var
+             AllocateObjectHook : TObjectHook;
+             DestroyObjectHook : TObjectHook;
+       {$ENDIF}
+
        public
           { please don't change the order of virtual methods, because
             their vmt offsets are used by some assembler code which uses

+ 10 - 0
rtl/inc/system.inc

@@ -1132,6 +1132,9 @@ type
   TInitFinalRec=record
     InitProc,
     FinalProc : TProcedure;
+    {$IFDEF FPC_INITFINAL_HASUNITNAME}
+    unitname : ^shortstring;
+    {$ENDIF}
   end;
   TInitFinalTable = record
     TableCount,
@@ -1165,6 +1168,13 @@ begin
       begin
         if assigned(Procs[i].InitProc) then
          Procs[i].InitProc();
+        {$ifdef FPC_INITFINAL_HASUNITNAME}
+        {$ifdef ENABLE_UNIT_INIT_TRACKING}
+        if assigned(UnitInitTrackingProc) then
+          UnitInitTrackingProc(i,Procs[i].unitname^);
+        {$endif ENABLE_UNIT_INIT_TRACKING}
+        {$endif FPC_INITFINAL_HASUNITNAME}
+
         InitCount:=i;
       end;
    end;

+ 6 - 0
rtl/inc/systemh.inc

@@ -1736,6 +1736,9 @@ Type
   TAbstractErrorProc = Procedure;
   TAssertErrorProc = Procedure(const msg,fname:ShortString;lineno:longint;erroraddr:pointer);
   TSafeCallErrorProc = Procedure(error : HResult;addr : pointer);
+  {$ifdef ENABLE_UNIT_INIT_TRACKING}
+  TUnitInitTrackProc = procedure(aSequence : SmallInt; const aUnitName : ShortString);
+  {$endif ENABLE_UNIT_INIT_TRACKING}
 
 
 const
@@ -1748,6 +1751,9 @@ const
   ExceptObjProc     : Pointer = nil; { Used to convert OS exceptions to FPC exceptions. }
   ExceptClsProc     : Pointer = nil;
 {$endif FPC_HAS_FEATURE_EXCEPTIONS}
+{$ifdef ENABLE_UNIT_INIT_TRACKING}
+  UnitInitTrackingProc : TUnitInitTrackProc;
+{$endif ENABLE_UNIT_INIT_TRACKING}
 
 {*****************************************************************************
                           SetJmp/LongJmp

+ 1 - 1
rtl/objpas/classes/classes.inc

@@ -909,7 +909,7 @@ begin
     as volatile, so the access won't be optimized away by the compiler. (KB) }
   for i:=1 to aIterations do
     begin
-    {$if FPC_FULLVERSION<30300}
+    {$if (FPC_FULLVERSION<30300) or defined(CPULLVM)}
     Inc(SpinWaitDummy); // SpinWaitDummy *MUST* be global
     {$else}
     {$IF defined(CPUX86_64) or Defined(CPUI386)}

+ 0 - 33
tests/webtbf/tw2129.pp

@@ -1,33 +0,0 @@
-{ %fail }
-{ Source provided for Free Pascal Bug Report 2129 }
-{ Submitted by "Bill Rayer" on  2002-09-18 }
-{ e-mail: [email protected] }
-
-{$mode delphi}
-
-(*
-Comp() cast has different effect in FPC.
-Compiles using Delphi4:
-  dcc32 -CC fpc19
-Compiles in FPC 1.0.6:
-  ppc386 -WC fpc19
-
-When run, the Delphi version shows -6.5E+18, but the FPC version
-shows zero. In Delphi, the comp() cast actually moves 8 bytes from
-the double into the comp without converting the data, but FPC uses
-floating point instructions to convert the data and therefore prints
-zero.
-
-In Delphi, if you want to convert a double to a float, you just use
-the assignment "comp1 := dbl1" which corresponds to the FLD/FIST
-opcodes. FPC should not use the comp() cast for doing this, since
-it introduces a subtle incompatibility with Delphi.
-*)
-
-program fpc19;
-var
-  single1 : single;
-  dbl1 : double;
-begin
-  single1 := single(dbl1);
-end.

+ 0 - 54
tests/webtbs/tw2129.pp

@@ -1,54 +0,0 @@
-{ Source provided for Free Pascal Bug Report 2129 }
-{ Submitted by "Bill Rayer" on  2002-09-18 }
-{ e-mail: [email protected] }
-
-{$mode delphi}
-
-(*
-Comp() cast has different effect in FPC.
-Compiles using Delphi4:
-  dcc32 -CC fpc19
-Compiles in FPC 1.0.6:
-  ppc386 -WC fpc19
-
-When run, the Delphi version shows -6.5E+18, but the FPC version
-shows zero. In Delphi, the comp() cast actually moves 8 bytes from
-the double into the comp without converting the data, but FPC uses
-floating point instructions to convert the data and therefore prints
-zero.
-
-In Delphi, if you want to convert a double to a float, you just use
-the assignment "comp1 := dbl1" which corresponds to the FLD/FIST
-opcodes. FPC should not use the comp() cast for doing this, since
-it introduces a subtle incompatibility with Delphi.
-*)
-
-program fpc19;
-uses
-  sysutils;
-
-var
-  comp1 : comp;
-  dbl1 : double;
-  s : string;
-begin
-  dbl1 := -1e-128;
-  comp1 := comp(dbl1);
-{$ifdef FPC_DOUBLE_HILO_SWAPPED}
-  comp1:=swap(comp1);
-{$endif FPC_DOUBLE_HILO_SWAPPED}
-  str(comp1:23,s);
-{$ifdef FPC_HAS_TYPE_EXTENDED}
-  if s<>'-6.53142228756617E+0018' then
-{$else FPC_HAS_TYPE_EXTENDED}
-  { this constant has been verified and is correct (FK) }
-  { doubles have slightly different precision on processors <> x86, because }
-  { intermediate calculations are not performed in 80 bit there (JM)        }
-  if trim(s)<>'-6531422287566170211' then
-{$endif FPC_HAS_TYPE_EXTENDED}
-    begin
-      writeln(s);
-      writeln('error');
-      halt(1);
-    end;
-end.

+ 0 - 41
tests/webtbs/tw2129b.pp

@@ -1,41 +0,0 @@
-{ Source provided for Free Pascal Bug Report 2129 }
-{ Submitted by "Bill Rayer" on  2002-09-18 }
-{ e-mail: [email protected] }
-
-(*
-Comp() cast has different effect in FPC.
-Compiles using Delphi4:
-  dcc32 -CC fpc19
-Compiles in FPC 1.0.6:
-  ppc386 -WC fpc19
-
-When run, the Delphi version shows -6.5E+18, but the FPC version
-shows zero. In Delphi, the comp() cast actually moves 8 bytes from
-the double into the comp without converting the data, but FPC uses
-floating point instructions to convert the data and therefore prints
-zero.
-
-In Delphi, if you want to convert a double to a float, you just use
-the assignment "comp1 := dbl1" which corresponds to the FLD/FIST
-opcodes. FPC should not use the comp() cast for doing this, since
-it introduces a subtle incompatibility with Delphi.
-*)
-
-program fpc19;
-{ the same as tw2129.pp for cpu's were comp = int64 }
-var
-  comp1 : comp;
-  dbl1 : double;
-  s : string;
-begin
-{$ifdef cpui386}
-  dbl1 := -1e-128;
-  comp1 := comp(dbl1);
-  str(comp1:23,s);
-  if s<>' 0.00000000000000E+0000' then
-    begin
-      writeln('error: ',s);
-      halt(1);
-    end;
-{$endif cpui386}
-end.

+ 21 - 0
tests/webtbs/tw41504a.pp

@@ -0,0 +1,21 @@
+{ %NORUN }
+
+program tw41504a;
+{$mode objFPC}
+
+type
+  TClassMain = class
+    procedure method; virtual; abstract;
+  end;
+
+  generic TGenClass<T> = class
+  type
+    TType = T;
+    TSelf = TGenClass;
+  end;
+
+  LType = type specialize TGenClass<TClassMain>.TSelf.TType;
+
+begin
+end.
+

+ 16 - 0
tests/webtbs/tw41504b.pp

@@ -0,0 +1,16 @@
+{ %NORUN }
+
+program tw41504b;
+
+{$mode objfpc}
+
+type
+  TTest = class
+    procedure Test; virtual; abstract;
+  end;
+
+  TTest2 = type TTest;
+
+begin
+
+end.

+ 38 - 0
tests/webtbs/tw41533.pp

@@ -0,0 +1,38 @@
+program FloatCastTest;
+{$mode Delphi}
+uses Variants, Math;
+var
+  C: Currency;
+  D, D2: Double;
+  S: Single;
+  Cp: Comp;
+  V: Variant;
+begin
+  C := 5.5556;
+  D := Double(C);
+  S := Single(D);
+  D2 := Single(D);
+  Cp := Comp(D);
+  V := Double(C);
+
+  Writeln('C: ', C);
+  Writeln('D: ', D);
+  if not SameValue(C, D) then // C and D must be the same
+    Halt(1);
+
+  Writeln('D2:', D2);
+  if SameValue(D, D2) then // D and D2 must be different -> precision reduced with Single() conversion
+    Halt(2);
+
+  Writeln('S: ', S);
+  if not SameValue(D2, S) then // D2 and S must be the same
+    Halt(3);
+
+  Writeln('Cp:', Cp);
+  if not SameValue(Cp, 6) then // Cp is 6
+    Halt(4);
+
+  Writeln('V:  ', V);
+  if not SameValue(D, V) then // D and V must be the same
+    Halt(5);
+end.