Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-09

SynMemo crash after "Undo"

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

Lazarus 0.9.31 r32144 FPC 2.4.4 i386-win32-win32/win64

Anyone has the same problem?

Drop a SynMemo on a form
Leave all properties unchanged
Build
Run

In Synmemo set cursor at end of last line
Press Enter (once ore more)
(A new line is created)
Press Ctrl+Z
The line is removed, but the cursor stays where it was. In the gutter the linenumbers get updated correctly.

Press Enter again: the synmemo throws an exception "TApplication.HandleException Invalid stringlist index 2"

Does not happen in the IDE source editor b.t.w.

Bart

Reply by email

Dirk
to Bart
Show quoted text 10 lines
Lazarus 0.9.31 r32144 FPC 2.4.4 i386-win32-win32/win64 Anyone has the same problem? ... Press Enter again: the synmemo throws an exception "TApplication.HandleException Invalid stringlist index 2" Does not happen in the IDE source editor b.t.w.

Yes, exactly the same here.
Using Lazarus 0.9.31 r32230M FPC 2.7.1 i386-win32-win32/win64

Dirk.

Reply by email

Martin
to Dirk
Dirk wrote 12 lines
> Lazarus 0.9.31 r32144 FPC 2.4.4 i386-win32-win32/win64 > > Anyone has the same problem? > ... > Press Enter again: the synmemo throws an exception > "TApplication.HandleException Invalid stringlist index 2" > > Does not happen in the IDE source editor b.t.w. > Yes, exactly the same here. Using Lazarus 0.9.31 r32230M FPC 2.7.1 i386-win32-win32/win64

And it's TSynMemo only, TSynEdit works.

BTW, something I have been wondering for a long time: What is everyones facination with TSynMemo?

It's 99.9% identical with TSynEdit (except for the extra bug), it has only the folowing differenes
- it may publish less properties that TSynEdit. Not sure, but it has it's own list what is published, and TSynEdit publishes everything, so TSynMemo is less or equal
- it adds to wrapper function:
Clear and Append => thay are 100% equal to Lines.Clear and Lines.Append
- and it adds CharIndexToRowCol and RowColToCharIndex

The last 2 are the only things that actually have some functionality. Is really everyone using them?
Is everyone treating their text as one long text (contains all the lines) and need to know the BytePos of a XY pos?
Isn't it much easier to treat the text as individual lines? Actually I heard quite a few times people ask, how they do the reverse in TMemo, and here we are TSynEdit already dealing in XY, and everyone needs the BytPos..

I really do not understand it....

Reply by email

Flávio Etrusco
to Martin
Martin wrote 20 lines
On 10/09/2011 09:52, Dirk wrote: >> >> Lazarus 0.9.31 r32144 FPC 2.4.4 i386-win32-win32/win64 >> >> Anyone has the same problem? >> ... >> Press Enter again: the synmemo throws an exception >> "TApplication.HandleException Invalid stringlist index 2" >> >> Does not happen in the IDE source editor b.t.w. >> > Yes, exactly the same here. > Using Lazarus 0.9.31 r32230M FPC 2.7.1 i386-win32-win32/win64 > And it's TSynMemo only, TSynEdit works. BTW, something I have been wondering for a long time: What is everyones facination with TSynMemo?

LOL, I often questioned that on SynEdit upstream. At least there the TSynMemo implemented some EM_xxx messages handling. I vote for removing TSynMemo from the ComponentPalette ;-)

It's 99.9% identical with TSynEdit (except for the extra bug), it has only the folowing differenes

This makes the bug all the more weird.

- it may publish less properties that TSynEdit. Not sure, but it has it's own list what is published, and TSynEdit publishes everything, so TSynMemo is less or equal
TSynMemo doesn't publish any additional properties (except some
IFDEF-out, including some obsolete ones). TSynEdit publish or
implement the following additional properties:
    property ShareOptions;
    property Beautifier;
    property BlockIndent;
    property OnMouseEnter;
    property OnMouseLeave;
    property IncrementColor;
    property HighlightAllColor;
    property BracketHighlightStyle;
    property BracketMatchColor;
    property FoldedCodeColor;
    property MouseLinkColor;
    property LineHighlightColor;
    property DefaultSelectionMode;
    property OnSpecialLineMarkup;
    property OnStatusChange;
    property OnClickLink : TMouseEvent read FOnClickLink write FOnClickLink;
    property OnMouseLink: TSynMouseLinkEvent read FOnMouseLink write
FOnMouseLink;

Best regards,
Fl?vio

Reply by email

Martin
to Flávio Etrusco
Fl?vio Etrusco wrote 8 lines
On Sat, Sep 10, 2011 at 8:24 AM, Martin wrote: > And it's TSynMemo only, TSynEdit works. > > BTW, something I have been wondering for a long time: What is everyones > facination with TSynMemo? > It's 99.9% identical with TSynEdit (except for the extra bug), it has only > the folowing differenes This makes the bug all the more weird.

Not at all

If foo is TSynEdit // pretty much doesn't work for TSynMemo => they both come from TCustomSynEdit

Show quoted text 7 lines
> - it may publish less properties that TSynEdit. Not sure, but it has it's > own list what is published, and TSynEdit publishes everything, so TSynMemo > is less or equal TSynMemo doesn't publish any additional properties (except some IFDEF-out, including some obsolete ones). TSynEdit publish or implement the following additional properties: property ShareOptions;

SharedOptions is public? not published?

Reply by email

Flávio Etrusco
to Martin
Martin wrote 19 lines
On 10/09/2011 14:55, Fl?vio Etrusco wrote: > > On Sat, Sep 10, 2011 at 8:24 AM, Martin ?wrote: >> >> And it's TSynMemo only, TSynEdit works. >> >> BTW, something I have been wondering for a long time: What is everyones >> facination with TSynMemo? >> It's 99.9% identical with TSynEdit (except for the extra bug), it has >> only >> the folowing differenes > > This makes the bug all the more weird. Not at all If foo is TSynEdit // pretty much doesn't work for TSynMemo => they both come from TCustomSynEdit

Only now, when I was going to report the bug I realized what you meant :-/ That's exactly the problem.
TSynEditUndoCaret.PerformUndo and TSynEditUndoSelCaret.PerformUndo check for TSynEdit.
TSynEditPlugin.GetEditor and TSynBaseCompletion.Execute should also be updated. I can make a patch (and/or report a bug in mantis) if you wish. And regardless of these bugs there's no reason for TSynMemo not to inherit from TSynEdit.

SharedOptions is public? not published?

Yes, I just didn't feel the need to single it out since it was unimportant in the context.

Best regards,
Fl?vio

Reply by email

Martin
to Flávio Etrusco
Fl?vio Etrusco wrote 16 lines
On Sat, Sep 10, 2011 at 11:00 AM, Martin wrote: > Not at all > > If foo is TSynEdit // pretty much doesn't work for TSynMemo => they both > come from TCustomSynEdit > Only now, when I was going to report the bug I realized what you meant :-/ That's exactly the problem. TSynEditUndoCaret.PerformUndo and TSynEditUndoSelCaret.PerformUndo check for TSynEdit. TSynEditPlugin.GetEditor and TSynBaseCompletion.Execute should also be updated. I can make a patch (and/or report a bug in mantis) if you wish. And regardless of these bugs there's no reason for TSynMemo not to inherit from TSynEdit.

did I miss some? I fixed several files

Reply by email