The text change margin behave incorrectly

Editors for WPF Forum

Posted 2 years ago by Sunshine - Appeon
Version: 21.1.3
Platform: .NET 5.0
Environment: Windows 10 (64-bit)
Avatar

Enter any content on the Editor and then delete it. The text margin will still be displayed in yellow on that line, which is marked as changed.

In fact, the content has not changed in any way, and it does not match the expected behavior.

Comments (3)

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

Hello,

That is the same way that Visual Studio editor behaves as well.  Editors track the changed state based on where the last save was and which lines were modified, but do not do text comparisons for performance reasons.

That being said, if you type something and then undo back to the original starting point, the change margin will not show any yellow because it will recognize that all changes have been reverted.


Actipro Software Support

Posted 2 years ago by Sunshine - Appeon
Avatar

I tried it on the VS editor, and only when the blank line is entered and then deleted, the margin will show that it has changed, because the blank line is automatically added at the indentation of the blank line when typing. If you delete the white space or try this operation on a non-blank line, the margin will not show that it has changed

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

Can you be more specific about the exact steps you are following? Steps I just performed in Visual Studio:

  1. Open an empty file.
  2. Place the caret at the beginning of line 1.
  3. Press the SPACE key to insert a space. The indicator margin turns yellow for line 1.
  4. Press the BACKSPACE key to delete the space. The indicator margin remains yellow for line 1.

Other steps I've tried:

  1. Open an empty file.
  2. Place the caret at the beginning of line 1.
  3. Press the ENTER key to insert a new line. The indicator margin turns yellow for line 1 and line 2.
  4. Press the BACKSPACE key to delete the line. The indicator margin disappears for line 2 (it no longer exists) and remains yellow for line 1.

And with a non-empty file:

  1. Open a non-empty C# file.
  2. Place the caret at the end of any line that has indented text.
  3. Press the ENTER key to insert a new line. The indicator margin turns yellow for the original line and the newly inserted line. The new line is indented to the same level as the previous line.
  4. Press the BACKSPACE key to delete the automatically inserted white space for indentation. The line indicator marin remains yellow for both lines.
  5. Press the BACKSPACE key to delete the new line that was created. The line indicator margin disappears for the previously inserted new line and the original line remains with a yellow indicator in the margin.

I am not clear which scenario you are describing where the line modification indicator is cleared in Visual Studio after editing the text back to the original value without using the UNDO commands. With the steps outlined above, I've seen the same behavior in both Visual Studio and SyntaxEditor. If you can tell me how to produce what you're seeing and where behavior does not meet the expected result, I'd be happy to look more closely.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.