Sign in Join

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

Mailing lists / lazarus / 2008-10

maybe to be merged into 0.9.26 (regression in synedit / bug 12281)

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Friebe
to Mattias Gaertner: On Fri, 03 Oct 2008 20:13:20 +0100 Does the patch support undo? Mattias

[ with delay, as my mailer messed up my first attempt to send this, sorry :( ]

For practical purposes: yes

If you enter a new line into a previous empty SynEdit (as to produce the crash, if it wasn't patched), then you can undo that, and synedit returns to the previous state. At least to the outside.

The only difference is that the internal textbuffer now actually contains a line. Before this synedit simulated this line (even if lines.count = 0 => synedit shows 1 line). Now this is the same difference as if you take an empty synedit, insert a space or letter, and undo (which doesn't crash even without the patch).

In all and every cases:
- an new created synedit has 0 lines (internally, but still displays 1 empty line).
- a Synedit that had some action, which was undone, will have that empty line in the TsyneEditTextBuffer.

So yes it does undo. As far as a user would realize.

If and only if the internal state of Lines.Count can be directly accessed from any application code, then any application doing so, may not be satisfied by the undo. I am not sure if this is the case (not sure if Lines.Count is accessible)

As I indicated I believe it would be best to create this empty line, in TsyneEditTextBuffer.Create. And remove all the special handling from outside. This can (or should) be added as a new issue. I do also believe that such a refactor should not merge into 0.9.26. Fixing the regression can only be done by reverting to the original behaviour.

As for adding undo to a zero line buffer. I am not sure if that is wise for 0.9.26.. Synedit has never done this. So it would be completely untested.
(True, I can not see how it could possible cause a problem, but experience thought me that a lot of things that I thought were safe turned out not to be.)

Regards
Martin

Mattias Gaertner wrote 21 lines
On Fri, 03 Oct 2008 20:13:20 +0100 Martin Friebe wrote: > Hi > > The following bug is a regression from 0.9.24: > http://bugs.freepascal.org/view.php?id=12281 > > I am not sure if it will have the necessary attention in the bug > system, before 0.9.26 is released. please review > Does the patch support undo? Mattias _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email