sometimes Shout changes the selection during styling
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
On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis <chisvasileandrei@gmail.com> 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
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 <btc@openinworld.com> wrote:
On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis <chisvasileandrei@gmail.com> 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
I made an issue: https://pharo.fogbugz.com/f/cases/15422/SHTextStyler-styleInBackgroundProces... Then do we add waitTimeoutSeconds:ifSignalled:ifTimedOut: to the Semaphore class? On Mon, Apr 27, 2015 at 6:33 PM, Andrei Chis <chisvasileandrei@gmail.com> 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 <btc@openinworld.com> wrote:
On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis <chisvasileandrei@gmail.com> 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
I was waiting for others to chime in, but they can do that on the issue once code is there to review. I'd say its worth pushing it through to that point at least. If you do it, I'll review and then we can call for a second reviewer. Actually, semantically the following may be better... DelayWaitTimeout>>waitOnCompletion:onTimeout: called from... Semaphore>>waitTimeoutSeconds:onCompletion:onTimeout: cheers -ben On Tue, Apr 28, 2015 at 8:12 PM, Andrei Chis <chisvasileandrei@gmail.com> wrote:
I made an issue: https://pharo.fogbugz.com/f/cases/15422/SHTextStyler-styleInBackgroundProces...
Then do we add waitTimeoutSeconds:ifSignalled:ifTimedOut: to the Semaphore class?
On Mon, Apr 27, 2015 at 6:33 PM, Andrei Chis <chisvasileandrei@gmail.com> 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 <btc@openinworld.com> wrote:
On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis <chisvasileandrei@gmail.com
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
Ok. I'll make a slice, at latest by tomorrow afternoon. Cheers, Andrei On Tue, Apr 28, 2015 at 4:45 PM, Ben Coman <btc@openinworld.com> wrote:
I was waiting for others to chime in, but they can do that on the issue once code is there to review. I'd say its worth pushing it through to that point at least. If you do it, I'll review and then we can call for a second reviewer.
Actually, semantically the following may be better...
DelayWaitTimeout>>waitOnCompletion:onTimeout:
called from...
Semaphore>>waitTimeoutSeconds:onCompletion:onTimeout:
cheers -ben
On Tue, Apr 28, 2015 at 8:12 PM, Andrei Chis <chisvasileandrei@gmail.com> wrote:
I made an issue: https://pharo.fogbugz.com/f/cases/15422/SHTextStyler-styleInBackgroundProces...
Then do we add waitTimeoutSeconds:ifSignalled:ifTimedOut: to the Semaphore class?
On Mon, Apr 27, 2015 at 6:33 PM, Andrei Chis <chisvasileandrei@gmail.com> 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 <btc@openinworld.com> wrote:
On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis < chisvasileandrei@gmail.com> 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
Slice in inbox. Cheers, Andrei On Tue, Apr 28, 2015 at 5:37 PM, Andrei Chis <chisvasileandrei@gmail.com> wrote:
Ok. I'll make a slice, at latest by tomorrow afternoon.
Cheers, Andrei
On Tue, Apr 28, 2015 at 4:45 PM, Ben Coman <btc@openinworld.com> wrote:
I was waiting for others to chime in, but they can do that on the issue once code is there to review. I'd say its worth pushing it through to that point at least. If you do it, I'll review and then we can call for a second reviewer.
Actually, semantically the following may be better...
DelayWaitTimeout>>waitOnCompletion:onTimeout:
called from...
Semaphore>>waitTimeoutSeconds:onCompletion:onTimeout:
cheers -ben
On Tue, Apr 28, 2015 at 8:12 PM, Andrei Chis <chisvasileandrei@gmail.com> wrote:
I made an issue: https://pharo.fogbugz.com/f/cases/15422/SHTextStyler-styleInBackgroundProces...
Then do we add waitTimeoutSeconds:ifSignalled:ifTimedOut: to the Semaphore class?
On Mon, Apr 27, 2015 at 6:33 PM, Andrei Chis <chisvasileandrei@gmail.com
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 <btc@openinworld.com> wrote:
On Mon, Apr 27, 2015 at 8:41 PM, Andrei Chis < chisvasileandrei@gmail.com> 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
Le 27/4/15 14:41, Andrei Chis a écrit :
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.
Ouch. And I imagine that it can be a mess after. Thanks for looking at this issue.
Removing the calls to styleInBackgroundProcess: from PluggableTextMorph>>#hasUnacceptedEdits: and PluggableTextMorph>>#basicHasUnacceptedEdits:. also solves the problem with the changing selection.
Cheers, Andrei
participants (3)
-
Andrei Chis -
Ben Coman -
stepharo