Mantis - Squeak
Viewing Issue Advanced Details
5504 ST80 tweak always 11-24-06 18:14 05-13-14 20:32
sumi  
nicolas cellier  
normal  
resolved 3.9  
fixed  
none    
none trunk  
0005504: [FIX][ENH] editor mode FileList should keeps its contents even if saving as another name
We can open a text file using FileList's editor mode, by choosing world menu -> open... -> file... or "do it" a script such as...

(FileStream fileNamed: 'some.txt') edit

Two problems occurs when we change the file's name. Whenever renaming, we have to re-open the renamed file because the code pane, no longer, shows the contents of the text file, but file list of current directory.

The attached changeset file fixes these problems.
 FileListLabelTweak.1.cs.gz [^] (1,239 bytes) 11-24-06 18:15
 FileListLabelTweak.2.cs.gz [^] (1,377 bytes) 05-28-08 09:46
 fileEditorSaveAsFix-sumim-M0005504.2.cs [^] (1,551 bytes) 05-07-10 02:47

Notes
(0010565)
edgardec   
04-17-07 11:17   
In 3.10 I was able to rename file and the code pane shows the file contents
(0012086)
sumi   
05-13-08 06:35   
Unfortunately, the 3.10 still has the same problem.

Please try a FileList window that is opened by "(FileStream fileNamed: 'some.txt') edit". After rename operation by accept (alt + s) -> "test.txt already exists." pop-up -> select "choose another name" -> input new file name -> accept, you can see that the FileList window shows file list of current directory, not the text previously editing.
(0012206)
ScottWallace   
05-28-08 09:03   
The code in the fileout assumes the presence of an inst var named labelString in FileList, but in most (perhaps all) Squeak versions, FileList does not have an inst var of that name.

Presumably the intention of the fileout is to add the inst var #labelString to FileList, but if so, the class redefinition to accomplish that somehow got omitted from the fileout.
(0012207)
sumi   
05-28-08 09:52   
I attached another change-set file that includes FileList class definition. Thanks.
(0013759)
sumi   
05-07-10 02:47   
This problem still remains in 4.1
So I re-write a new patch that attached as fileEditorSaveAsFix-sumim-M0005504.2.cs
It is replacement of FileListLabelTweak.2.cs we needs no longer.

(0014504)
nicolas cellier   
05-13-14 20:32   
Integrated in trunk (4.6) http://source.squeak.org/trunk/Tools-nice.521.mcz [^]
Thanks sumi!