This bug is reproducible with SciTE 5.3.1:
- Open a file.
- Type
abc. -> The change tracking marker is orange (= This line is different to its state on disk). Correct.
- Save the file. -> The marker is green (=This line is the same as its state on disk). Correct.
- Type
def. -> The marker is orange (= This line is different to its state on disk). Correct.
- Save the file. -> The marker is green (=This line is the same as its state on disk). Correct.
- Undo. -> The marker is green ... which is wrong: The line is not the same as its state on disk.
I am loath to open this one up as the likely outcome is more feature option flags making change history even more complex.
At (6), the line contains a saved insertion 'abc' and a reverted insertion 'def'. With in-text change indicators
change.history=7, there is a green underline for 'abc' and a blue triangle where 'def' was reverted-to-origin.This is summarized onto the margin as both saved and reverted-to-origin. With the default margin markers, the blue reverted-to-origin state is not visible but it can be revealed with translucent markers or using a different symbol like a left side rectangle.
The reverted-to-origin state could be prioritized over saved but that would (arguably) be even less correct.
It may be better to summarize this line as reverted-to-modified. During development there were attempts to interpret mixed states in a nicer way but that was more complex and had more cases - its possible to have all 4 states on one line and insertions and deletions may have different desired levels of prominence. Therefore, the released version shows multiple markers allowing application developers or users to choose multiple marker symbols or to have states obscure lower priority ones.
The documentation describes the common 'happy-path' in a way that users can understand. During the long development of change history, users (including application developers) were uninterested in details and even argued in favour of inaccurate implementations as better than nothing. Documentation could be added for lines with multiple states but that shouldn't obscure the simple commonly occurring states.
Last edit: Neil Hodgson 2022-10-15
I agree that features should default to behaviour that is intuitive and hence understandable at first glance.
I'm a long time (20 years) user of both Microsoft's SQL Server Management Studio and Visual Studio where I had first contact with code editor change tracking being displayed in the margin. The implementation of the two differs and if I recall correctly, SSMS features four states, but IMHO, three states are sufficient for most users:
There are two very important aspects:
If the document reaches a save point, then only lines in states 1 and 3 are possible. This is what confuses me most by the current implementation: the margin tells the user that the line was saved to disk while it isn't.
Are you in favour of a switch which influences the final marker state? I.e. to either go for the current implementation or a reduced (but clearer) 3 state visualisation.
Compatibility with Visual Studio requires reverted-to-origin.
That is going to depend on how it works.
I've just tested my report bug scenario with both SSMS 19 and VS 2022 which I didn't have at my disposal yesterday. I wasn't aware of the fact that both applications support reverted-to-origin , a state I have never actively noticed, obviously. Hence my "plea" for three states.
Anyway, both applications don't show the bug I described in my original post.