[Cuis-dev] Displaying TextEditor as not dirty when saved contents are equal to current edits

Juan Vuletich juan at cuis.st
Sun Nov 20 08:48:02 PST 2022


Hi Mariano,

Thanks for reporting.

Did something similar to what you suggest, but without a new class. Just 
pushed it. Please take a look and try the fix.

Thanks!

On 11/19/2022 6:37 PM, Mariano Montone via Cuis-dev wrote:
> Hi guys,
>
> this change broke some of my text editing morphs. I can fix them using 
> a custom PluggableTextModel subclass, but, the problem is in the 
> #isDirty implementation in TextModelMorph:
>
> isDirty
>
>     textGetter ifNil: [ 
^ super isDirty ].
>     
^ ((textProvider perform: textGetter) = (CodeProvider 
> normalizeCodeForCodeFiles: actualContents)) not.
>
> That normalization for comparing text is ok for Smalltalk code, but 
> not for a generic text model, which I think PluggableTextModel should 
> be able to be used with.
>
> How about removing that #isDirty implementation in PluggableTextModel 
> and use a SmalltalkCodeTextModel or similar with that implementation 
> of #isDirty for when working with Smalltalk code?
>
>
>        Mariano
>

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich



More information about the Cuis-dev mailing list