Bug: Format exits with unlocked model
Gerardo Richarte
gr at fuzzy.uba.ar
Mon Apr 13 03:41:22 UTC 1998
Leandro dijo:
>Gerardo Richiarte wrote:
>
>> The problem is in ParagraphEditor>>dispatchOnCharacter:with:, I have
>>already posted a BugFix for version 1.23, but the bug was back in v1.3x.
>Here
>>is the (updated) Fix:
>
>Using your fix I still find the following problem:
>
>1. Clic on a selector in the browser (assume the method isn't formatted)
>2. Shift-clic and format the method's code
>3. Press Command-S to save the version just formatted
>
>then the method's pane flashes and the formated version is not saved :-(
>
>Also I've inserted a #halt in the middle of your patch: <self halt
>closeTypeIn>.
>The halt gets evaluated only when I press Command-S, but not when I accept
>from the popup menu. I'm using 1.31 on Windows.
>
>Saludos,
>Leandro
>
After tracing the problem I realised that it was in
BrowserCodeController>>format, the problem was that this method restored the
locking status (it says if anything has changed) of the model befor
exiting: As you can't format without saving previusly, you allways
entered BCC>>format with model unlocked, and after formating, this
method changed model back to unlocked. Here's a fix:
--------------------------------------
'From Squeak 1.3 of Jan 16, 1998 on 13 April 1998 at 12:33:46 am'!
!BrowserCodeController methodsFor: 'menu messages' stamp: 'r++ 4/13/98 00:33'!
format
"Reformat the contents of the receiver's view, formatted, if the view is
unlocked."
| selectedClass aCompiler newText locked savedSelection |
savedSelection _ startBlock stringIndex.
locked _ model isLocked.
model messageListIndex = 0 | locked ifTrue: [^ view flash].
selectedClass _ model selectedClassOrMetaClass.
Cursor execute
showWhile:
[aCompiler _ selectedClass compilerClass new.
self deselect; selectInvisiblyFrom: 1 to: paragraph text size.
newText _ aCompiler
format: model contents
in: selectedClass
notifying: self.
"(self selection string beginsWith: newText)"
"r++: I think that this line commented above should"
" be decommented for better functionallity, but"
" it'll be slower. "
" delete this lines after reading them"
newText == nil
ifFalse: [self replaceSelectionWith: (newText asText makeSelectorBoldIn: selectedClass).
self selectAt: savedSelection.
locked _ true "r++ 4/13/98 00:32 Fix: After formating you couldn't save"]].
locked ifFalse: [self unlockModel]! !
--------------------------------------
More information about the Squeak-dev
mailing list
|