> Alternatively, more similar to what you had earlier: > > int pit; > int pos; > boost::tie(pit, pos) = LyX::ref().lastfiles().loadFilePosition(s);
This is good to know. > Can you please drop the bookmark part of the patch for now? > If we decide that we do want bookmark[0] to be the position the cursor > was in when the doc was last saved we can put this in later. > (but... I just realized that you rely on this in your > implementation... hmm) No problem. I can copy part of restorePosition to here ... > Just as a test... load a document move the cursor save. > Exit lyx. Start lyx. Load a different document. Load the first doc. > Where is the cursor placed now? It will move to the position when the first file was closed. My test goes well except that "lyx file.lyx" does not scroll as expected. > Doesn't this almost double the size of lastfiles.C? > (I am just trying to prove that code complexity is not reduced it IMNO > increases a lot.) I added about 50 lines. Now the code is 155 lines. A separate fileposition.C will be this long as well, and we need to change the lyx().lastfile() interface. Cheers, Bo