Chinh:
> I'm a little confused by the behavior of the change history markers. I'm seeing a modified and saved marker in situations where I would've expected a reverted to modified marker. I am using only the markers and turned off the indicators.
The indicators show the detailed state of change history and the markers try to summarize that state for each line. It is easier to understand the markers when the indicators are also visible.
The margin markers for each state present are all drawn so choosing markers that do not overdraw can show all the states on a line.
The prioritization is just the normal order of markers being drawn over each other. This order is REVERTED_TO_ORIGIN, SAVED, MODIFIED, REVERTED_TO_MODIFIED.
> However, if I reopen the file and repeat the edits but after the first undo where the marker turns green-yellow, I add a character and the marker stays green-yellow instead of orange. The documentation states "The margin shows a block indicating the overall state of the line, prioritizing the more consequential modified states." but I still would've expected the line to be considered modified.
The line contains both modified and reverted to modified. Reverted to modified overdraws modified.
> by selecting the i in is and typing the letter a to replace the I, then selecting the letter a in the word a and pressing the letter I to replace it, then selecting the letter t in test and replacing it with r, the marker turns orange as expected. Save the file and the marker turns green. However, if undo once, the marker stays green instead of the green-yellow I expected. Undo again and the marker stays green. Why did the marker stay green instead of green-yellow?
The undo returned that text to its original state so the line contains both saved and reverted to original. Saved draws last.
> The documentation for SC_MARKNUM_HISTORY_SAVED (green marker) says "This line was modified and saved. This line is the same as its state on disk." but that's not the behavior that I'm seeing. I looked at Visual Studio and their history markers only have 3 states where there is no reverted to modified,
Visual Studio has more states that do not have distinct visuals.
> So is this all a bug or is it behaving as expected?
It's likely behaving as expected. A different order of markers (different numbers for the SC_MARKNUM_HISTORY_*) may produce results closer to your expectations but that would not be compatible with existing applications.
I think that the alpha and layer attributes of the markers could be set by the application to change the perceived prioritization.
> Also, I put the change history markers in its own margin. If I have markers on and indicators off, hiding the change history margin for some reason changes the background color of each line of text to the history marker color of each line.
This is the behaviour of all margin markers: if there is no margin displaying a marker, it produces a line background colour change to ensure that it can be seen. This ensures that bookmarks or breakpoints are still visible when the user hides the relevant margin to increase space.
Neil