On Dec 7, 2007, at 1:05 AM, Philip Aker wrote: On 2007-12-06, at 14:38, David Ewing wrote:
On Dec 2, 2007, at 5:50 AM, email@hidden wrote:
i have the following behaviour in Xcode 2.4
1-i open a file, it shows lines 157-204
2-if i hit an arrow-button, the window scrolls to the cursor position (line 228)
3-if i move the cursor up to, say line 20, save the file, close the file, open the file again
it again shows lines 157-204
what i would like Xcode to do is:
1-open the file with the cursor in view (in step 1: f.i. show lines 200-240)
2-remember the last cursor position (in step 3: f.i. show lines 0-40)
how do i get Xcode to do this?
Check to make sure "Save Window State" is checked in the General Prefs. It sounds to me like it's off, but the window state for that file was previously saved (which means it continues to open at that stale location).
FWIW, I always have "Save Window State" checked and I get the behavior Perry describes on a regular basis. In order to get it to work, I have to do something like:
• Clear file history. • Move to the top of the file. • Type a bunch of returns. • Save the file. • Close the window. • Re-open the window. • Delete the extraneous returns. • Move to the target selection area and enter the selection. • Save the file.
If that doesn't work, then clean every target in the project, quit Xcode, remove the directory containing the intermediate files and start afresh.
Another thing that might cause this is if your .pbxuser file is read-only. If you can workaround the problem with the steps you give (which make little sense to me as to why it would work), then I don't think that's what's happening for you (but it might be what's causing the issue for Perry).
Another thing to make clear is that the scroll and selection locations are stored in the project file (your specific .pbxuser file). So, if there's no project open, the location is not remembered. There's been some talk about storing this information in the extended attributes of the file (as we do in 3.0 for a file's encoding), but that hasn't happened yet.
In any case, it sounds like Philip is running into a real bug. Filing a report would be best. And it would be especially good if you can include the project file and source file, along with the com.apple.Xcode.plist preferences file.
Dave
|