I made an issue:
https://pharo.fogbugz.com/f/cases/15422/SHTextStyler-styleInBackgroundProcess-should-not-set-the-text-if-styling-process-was-terminated

Then do we add waitTimeoutSeconds:ifSignalled:ifTimedOut: to the Semaphore
class?

On Mon, Apr 27, 2015 at 6:33 PM, Andrei Chis <[email protected]>
wrote:

> That would work for me. Styling the text if the process doing the styling
> did not finish or is stuck does not feel as the right thing to do.
>
> On Mon, Apr 27, 2015 at 6:25 PM, Ben Coman <[email protected]> wrote:
>
>>
>>
>> On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> In the glamour debugger that we use in moose we are now having the
>>> following problem:
>>>  - the selection of a PluggableTextMorph is, quite randomly , changed
>>> during styling.
>>>
>>> If I revert the fix for issue 15240
>>> <https://pharo.fogbugz.com/f/cases/15240> then it works ok.
>>> Also if I change in SHTextStyler>>#styleInBackgroundProcess:  from
>>>
>>> sem waitTimeoutSeconds: 5.
>>> view ifNotNil: [ view stylerStyledInBackground: text ]
>>>
>>> to:
>>>
>>> (sem waitTimeoutSeconds: 5) ifFalse: [
>>> view ifNotNil: [ view stylerStyledInBackground: text ] ]
>>>
>>> it works ok. In the second snippet we only do the styling if the styler
>>> completed.
>>>
>>>
>>> If I look at the senders of styleInBackgroundProcess: there is another
>>> strange issue.
>>> First PluggableTextMorph>>#setText: calls either style:
>>> or styleInBackgroundProcess:, depending in the size of the text.
>>> Then, PluggableTextMorph>>#setText:
>>> calls PluggableTextMorph>>#setTextBasic:, which calls
>>> PluggableTextMorph>>#hasUnacceptedEdits: which in turn
>>> calls again styleInBackgroundProcess:.
>>> So when you set the text if the size of the text is small Shout will try
>>> to style the text with and without a background process. If you call
>>> hasUnacceptedEdits:
>>> manually when initializing the morph then three processes will be
>>> started for doing the styling.
>>>
>>> Removing the calls to styleInBackgroundProcess: from
>>> PluggableTextMorph>>#hasUnacceptedEdits:  and
>>> PluggableTextMorph>>#basicHasUnacceptedEdits:.
>>> also solves the problem with the changing selection.
>>>
>>> Cheers,
>>> Andrei
>>>
>>
>> Perhaps we should have...
>>
>>    sem
>>         waitTimeoutSeconds: 5
>>         ifSignalled: [ view ifNotNil: [ view stylerStyledInBackground:
>> text ] ]
>>         ifTimedOut: [ "do nothing" ].
>>
>> cheers -ben
>>
>
>

Reply via email to