Le 27/07/2016 à 14:05, Davide Anchisi a écrit :
Yes, it is written in ~/.lyx/session every time I exit LyX.
It seems it is not read back (or used) when opening LyX again.
But, even stranger, it does work for some files, apparently those
created using LyX versions 2.1. For those files the cursor position is
correctly restored even when the position and/or the file is modified
with v. 2.2.1. And even for them the cursor position is written in
~/.lyx/session with the same syntax, e.g.:
12, 4, /home/myHome/file.lyx


I can reproduce. But it is not dependent on the version as this problem
seems to be more than 10-year old. Here's the problem: there is a
constant num_lastfilepos (=100) and LyX stops reading file positions
after it has this many. (But it is still writing the positions when
closing the file, which is why one still sees the positions in the
session file.) Now, the file positions are stored ordered by the file
and path name. Thus, instead of forgetting file positions depending on
their age, it forgets them depending on the alphabet.

Two solutions:
1) remove the arbitrary limit num_lastfilepos.
2) store the file positions by age. (Internally, replace the map by a
vector.)

Are there objections regarding the simplest solution 1) ?


Guillaume

Reply via email to