Andrius
2013-09-22 15:29:50 UTC
Here is the patch that would provide saving of more information about state of the opened documents, and after re-opening of the project, it would configure all documents to the previous state and switch to the last edited tab.
Changes are following:
project->files stringlist is changed to array list, which would include, together with uri also cursor position, textview offset and whether document is current or not.
Then, during project load, the textview is scrolled to the last position and cursor is placed to last known position, so one can continue editing from where he left. This is done for all documents in project.
Large number of files needed modification, mostly because modifications of doc_new_from_uri() and file_doc_from_uri(), which now has variables for cursor offset and textview alignment method.
I would be glad to receive feedback regarding this patch, if it is acceptable, and if the speed of opening of the first document is good enough...
Theoretically, first document loading speed might be improved even more, with some further modifications to doc_new_from_uri() and file_doc_from_uri() to pass higher event priority for last edited document to the callbacks that does document loading and configuration.
Andrius
load. The perceived loading speed for a project is very high this
way. This obviously only makes sense if project loading is slow
because either there are many many files, or because the connection
to the server with the files is slow.
matter at all, so retaining the last opened document and line number
would be a nice feature indeed. Perhaps a project setting "load
optimize for speed / load with restored current document and line
numbers " is a good thing? Or should we enable it always?
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Changes are following:
project->files stringlist is changed to array list, which would include, together with uri also cursor position, textview offset and whether document is current or not.
Then, during project load, the textview is scrolled to the last position and cursor is placed to last known position, so one can continue editing from where he left. This is done for all documents in project.
Large number of files needed modification, mostly because modifications of doc_new_from_uri() and file_doc_from_uri(), which now has variables for cursor offset and textview alignment method.
I would be glad to receive feedback regarding this patch, if it is acceptable, and if the speed of opening of the first document is good enough...
Theoretically, first document loading speed might be improved even more, with some further modifications to doc_new_from_uri() and file_doc_from_uri() to pass higher event priority for last edited document to the callbacks that does document loading and configuration.
Andrius
________________________________
Sent: Tuesday, September 3, 2013 4:01 PM
Subject: Re: Switching to last edited document when opening project
I would vote to make it always enabled, because perceived loading speed doesnt mater much for me, anyway I need to scroll to document manually. Would it be OK first to make it not selectable for testing and evaluation, and if there will be complains, I can always add project setting at the later time?
Andrius
finished loading, in the meanwhile all other documents continue toSent: Tuesday, September 3, 2013 4:01 PM
Subject: Re: Switching to last edited document when opening project
I would vote to make it always enabled, because perceived loading speed doesnt mater much for me, anyway I need to scroll to document manually. Would it be OK first to make it not selectable for testing and evaluation, and if there will be complains, I can always add project setting at the later time?
Andrius
________________________________
Sent: Monday, September 2, 2013 11:22 PM
Subject: Re: Switching to last edited document when opening project
Hi,
Sent: Monday, September 2, 2013 11:22 PM
Subject: Re: Switching to last edited document when opening project
Hi,
right now when opening project, bluefish activates document in the notepad somewhat randomly, depending on processor and file system speed. Sometimes it activates tab #1, but most often #5 or even #7. Would it be there interest to add code to activate the last edited document, maybe even to scroll to the same part of document that was edited last? In this case after closing project and re-opening one would be able to continue from where he left.
Andrius
The current code is optimized to show the first document that hasAndrius
load. The perceived loading speed for a project is very high this
way. This obviously only makes sense if project loading is slow
because either there are many many files, or because the connection
to the server with the files is slow.
I agree that for local small projects the loading speed doesn't
would be a nice feature indeed. Perhaps a project setting "load
optimize for speed / load with restored current document and line
numbers " is a good thing? Or should we enable it always?
Olivier
--
--
Blog http://oli4444.wordpress.com/