Lazarus Git main from today,
FPC Git main from yesterday.
Bug appears in cudatext editor: statusbar cells have the LEFT align, instead of CENTER align.
Debugging on linux-x64-gtk2 shows that in this procedure
procedure TfmMain.UpdateStatusbarPanelsFromString(const AText: string);
var
SPanel, SItem: string;
NIndex, NSize, NTag: integer;
Al: TAlignment;
SepAll, SepItem: TATStringSeparator;
bAutoSize, bStretch, bHotTrack: boolean;
begin
...
SepAll.Init(AText, '|');
repeat
if not SepAll.GetItemStr(SPanel) then Break;
SepItem.Init(SPanel);
NTag:= 0;
NIndex:= StatusbarMain.PanelCount;
bStretch:= false;
bHotTrack:= false;
SepItem.GetItemStr(SItem);
case SItem of
'caret': begin NTag:= StatusbarTag_Caret; bHotTrack:= true; end;
'enc': begin NTag:= StatusbarTag_Enc; bHotTrack:= true; end;
'ends': begin NTag:= StatusbarTag_LineEnds; bHotTrack:= true; end;
'lexer': begin NTag:= StatusbarTag_Lexer; bHotTrack:= true; end;
'tabsize': begin NTag:= StatusbarTag_TabSize; bHotTrack:= true; end;
'ins': begin NTag:= StatusbarTag_InsOvr; bHotTrack:= true; end;
'msg': begin NTag:= StatusbarTag_Msg; bStretch:= true; end;
'selmode': begin NTag:= StatusbarTag_SelMode; bHotTrack:= true; end;
'wrap': begin NTag:= StatusbarTag_WrapMode; bHotTrack:= true; end;
'zoom': begin NTag:= StatusbarTag_Zoom; bHotTrack:= false; end;
'ro': begin NTag:= StatusbarTag_ReadOnly; bHotTrack:= false; end;
else Continue;
end;
SepItem.GetItemStr(SItem);
bAutoSize:= SItem='A';
if bAutoSize then
Al:= taLeftJustify
else
Al:= AppStringToAlignment(SItem);
...
until false;
end;
code goes into place shown with '// <--'
SepItem.GetItemStr(SItem);
bAutoSize:= SItem='A';
if bAutoSize then
Al:= taLeftJustify // <--
even when SItem='C' (C means CENTER) !
I extracted this fragment to a small demo, and repeated LPI file <CompilerOptions> part from cudatext.lpi (
https://github.com/Alexey-T/CudaText/blob/master/app/cudatext.lpi ). It did not help. In cudatext.lpi I have default build-mode - problem don't appear, and 'linux-x64-gtk2' mode - probem appears. I copied <CompilerOptions> from the needed build-mode.
Small demo which cannot repeat the bug, is like this:
procedure TForm1.FormCreate(Sender: TObject);
var
STest, SItem: string;
bAutoSize: boolean;
Al: TAlignment;
begin
STest:= '0,C';
SItem:= STest[3];
bAutoSize:= SItem='A';
if bAutoSize then
Al:= taLeftJustify
else
Al:= taCenter;
if Al=taLeftJustify then
caption:= 'wrong'
else
caption:= 'ok';
end;