dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

Modified source editor state not maintained correctly on loss of focus #1217

Closed blairmcg closed 9 months ago

blairmcg commented 9 months ago

TextEdit views in Dolphin have historically had only two model update modes:

Source editors in Dolphin use the first mode (the same is true of the XMLPad, Notepad, and Wordpad samples). One effect of this is that the "modified" indication in the browser status bar resets when tabbing away. Although the presenter does still know that the text has been changed, the model has been updated and the ScintillaView itself has been told the data is saved. This not only causes the indicator in the status bar to be incorrect, but also means that if we enable the change margin indicators in Scintilla, that these do not accurately show the change history. The TextEdit update modes are appropriate for normal single line text fields in forms, but we really need a mode that is more suitable for editors on larger bodies of text.

This change replaces the updatePerChar boolean setting with an update mode. The update mode can be one of #focusLost, #perChar, or #explicit. The first two modes correspond to the updatePerChar being false, and true respectively. The other mode disables update of the model except when explicitly requested, which is more suitable for text editors.

In order to make this modification a new STB version of TextEdit was required, which is complicated by the presence of subclasses with later STB versions. Consequently the STB version has had to jump to 22, and modifications to contributed code were required.

Also correct workspace options not always restoring correctly from registry.

Includes rename of UI.Scintilla.IndicatorStyle to IndicatorDefinition: Style terminology is too confusing, since the definition has an indicator style, and various other attributes.