diff --git a/components/synedit/syneditwrappedview.pp b/components/synedit/syneditwrappedview.pp index ca61fce018..7e5cfc1e9d 100644 --- a/components/synedit/syneditwrappedview.pp +++ b/components/synedit/syneditwrappedview.pp @@ -1559,7 +1559,7 @@ end; function TLazSynEditLineWrapPlugin.GetWrapColumn: Integer; begin - Result := TSynEdit(Editor).CharsInWindow; + Result := TSynEdit(Editor).CharsInWindow - 1; end; function TLazSynEditLineWrapPlugin.CreatePageMapNode(AMapTree: TSynLineMapAVLTree): TSynEditLineMapPage; diff --git a/components/synedit/test/testbase.pas b/components/synedit/test/testbase.pas index 62cf1eeb0c..a00a6f761b 100644 --- a/components/synedit/test/testbase.pas +++ b/components/synedit/test/testbase.pas @@ -658,6 +658,7 @@ end; procedure TTestBase.SetSynEditWidth(Chars: Integer; PartCharPixel: Integer); begin + inc(Chars); // wordwrap takes one off again FSynEdit.Width := FSynEdit.CharWidth * Chars + PartCharPixel + (FSynEdit.Width - (FSynEdit.TextArea.Right - FSynEdit.TextArea.Left)); AssertEquals('SetSynEditWidth', Chars, SynEdit.CharsInWindow);