Modification Line Marks do not designate a change performed by Undo

SyntaxEditor for WPF Forum

Posted 9 years ago by Timo Emondts
Version: 14.2.0611
Platform: .NET 4.5
Environment: Windows 7 (64-bit)
Avatar

I used the Demo "SDI Code Editor (Inline)" for this:

1. Type some text into a random line. (Marker appears and is yellow)

2. Save the file. (Marker turns green)

3. Type some more text into the same line. (Marker turns yellow)

4. Save the file. (Marker turns green)

5. Undo the last change. (Bug: Marker disappears)

The file is definitely in a modified state but the Modificaton Line Marks do not designate this.

I'd say the only reason to remove a marker is, if the file hasn't been saved yet and the file represents the original loaded state. Both conditions are not true in this scenario.

Comments (7)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Timo,

Thanks for the bug report.  We are aware of a couple minor issues with the undo and line modification marking.  We'll log this info with the related TODO item.


Actipro Software Support

Posted 9 years ago by Timo Emondts
Avatar

For the sake of completeness I'd like to add another way to reproduce this bug/a closely related bug.

1. Type some text into a random line. (Marker appears and is yellow)

2. Type some text into another line. (Marker appears and is yellow)

3. Type some more text into the first line, and then some more text in the second line.

4. Undo twice and save. (Both marker turn green.)

5. Redo twice. (Bug: both markers are still green.)

I'd expect to see yellow markers.

---

And here's another one:

1. Delete a couple of lines. (In the first line of the deleted range a marker appears and is yellow)

2a. Undo. (Bug: The first line doesn't have a yellow marker (that's fine), but the other lines do have)

2b. Save and undo afterwards (Bug: The first line doesn't have a marker, but the other lines do have a green marker)

In case of 2a, I'd expect to see no markers at all (the file equals its loaded state and there were no save) and in case of 2b I'd expect to see yellow markers for all lines.

[Modified 9 years ago]

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Timo,

Thanks, when we work on this, we'll use these test cases to see if it's resolved.


Actipro Software Support

Posted 9 years ago by Timo Emondts
Avatar

I've got a request related to this issue here. (Or rather since you're going to make changes in these files anyway.)

 

We're adding a margin at the right hand side which is similar to the margin in VS that shows all errors, warnings etc. inside of the whole document.

We'd like to show unsaved and saved changes there, too; hence, we would need to access the information which lines have unsaved and saved changes. 

I added two RangeCollections to the interface IUndoHistory so that I can return the otherwise private data.

 

Did I overlook anything, i.e. is it already possible to access the data differently? Or would it be possible that you guys could support the access to these information?

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Timo,

The ITextViewLine.SavePointChangeType property returns the modification mark kind fo a particular view line.  That's what we use when rendering the selection margin.

That calls the IUndoHistory.GetChangeTypeForLineRange() method, which is probably what you would want to call.


Actipro Software Support

Posted 9 years ago by Timo Emondts
Avatar

Oh yeah, that would give us the information we need.

That said, it seems not to be quite performant as we would need to scan the whole document on each change anyway, i.e. foreach over each line. (It would cost a lot, too, if we would try to tell which ranges haven't changed in order to limit the range we'd need to scan.)

Thanks for the heads-up all the same. :)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Timo,

I wanted to let you know that the latest maintenance release has completely reworked the line modification marks to fix past issue and also added reverted change (orange mark) tracking.

http://blog.actiprosoftware.com/post.aspx?id=45e93abd-4afd-4323-bd84-ac303cbc2956

[Modified 8 years ago]


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.