No, I don't think that's what Félix means. Open a .Leo file in say a text editor while it's also open in Leo. In the text editor, make a change to the .leo file and save. Leo doesn't notice the change. I just tried it. After I closed and reopened the .leo file in Leo, the change showed up in Leo, but Leo hadn't known about it before the re-opening.Félix, is that what you mean?
Thank you to both of you ! I'll take a look at this again tonight :)
Not directly used by leoInteg, but the behavior should be mimicked by leointeg: I want to make sure leoInteg does it too (I removed this when making the auto-detection/auto-answer of derived files part of leoInteg - I should have let it in for .leo files themselves too!)I guess this is very important when switching git branches: the .leo file has to refresh everything including itself first!
Leo 6.4-devel, devel branch, build 30ca7ea314
2020-12-05 09:26:07 -0600
Python 3.6.9, PyQt version 5.9.5
linux
Steps:
1) In leo, create a new outline, say with a couple of nodes. save as myfile.leo.
2) keeping in leo, switch to a console, say. Edit the leo file (or just 'touch' it) in a text editor, save & exit
3) switch focus back to leo
4a) hoped for/expected: Leo notices the change and says "do you want me to reload the file into Leo?"
4b) observed: leo does not notice the change (yet)
4c) observed: if I then (or, later, after some leo editing activity) try to save the file in Leo, the fact that the underlying file has changed *is* noticed. I get a dialog box:
dialog title: "Overwrite the version in Leo": dialog text: "<myfile.leo> has changed in leo\n Overwrite it?"
4d) observation: regardless, the text of this dialog is confusing.
I guess there are two non-usual situations here:
A) When acquiring focus (or through periodic checks), Leo notices that the file on disk has been changed somehow. It asks whether I want to reload the new file into Leo
B) before attempting to write the file, Leo notices that there is a discrepancy. It asks for confirmation whether I want to overwrite the file on disk
I would expect (A) to be the most usual/useful case; Leo currently seems to try for (B)
Does that help/make sense?
thanks
Jon N
Hi Edwardyour explanation of the difference between #1240 and #1771 does, thanks. I think my issue is unrelated to any recent insights re. git branches etc.I have tried the smallest example I could to illustrate what behaviour I see, and hope for. This is on:Leo 6.4-devel, devel branch, build 30ca7ea314
2020-12-05 09:26:07 -0600
Python 3.6.9, PyQt version 5.9.5
linux
update, after trying with the ekr-change branch:- making a change in the .leo file (outside of leo) now seems to be noted. I still think the dialog text is confusing though. To my mind 'overwrite it' smacks of writing something to disc, and the wording should be more like ... reload into Leo?"
- just touching the file (ie changing the timestamp) externally doesn't seem to be noticed by leo, at least not consistently.
- Leo also fails to restart sometimes after answering 'yes'
On Thu, Dec 10, 2020 at 4:17 PM jkn <jkn...@nicorp.f9.co.uk> wrote:update, after trying with the ekr-change branch:- making a change in the .leo file (outside of leo) now seems to be noted. I still think the dialog text is confusing though. To my mind 'overwrite it' smacks of writing something to disc, and the wording should be more like ... reload into Leo?"I'll change the dialog.
- just touching the file (ie changing the timestamp) externally doesn't seem to be noticed by leo, at least not consistently.That's on purpose. efc.has_changed first checks the timestamps. If they are different, the code then checks that the contents are different. Only then does it raise the dialog.
- Leo also fails to restart sometimes after answering 'yes'I'll look into this.efc.ask does have some weird timing code, which is probably needed because the dialog is raised as the result of checks that are made periodically at idle time.
I had planned to merge the ekr-change branch into devel today, but I'll put that on hold while I investigate the restart part of the issue.