Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch external file modifications #426

Closed
kosiakk opened this issue Sep 14, 2020 · 4 comments
Closed

Watch external file modifications #426

kosiakk opened this issue Sep 14, 2020 · 4 comments

Comments

@kosiakk
Copy link

kosiakk commented Sep 14, 2020

I'd like to edit the file outside of Pluto and see the changes reflected in the Web UI. It is especially tempting

Use-cases:

  • External editors like VS Code if the notebook is incuded into another program due to its awesome simple file format.
  • Changing Git branch.
  • Two Pluto instances opening the same file unexpectedly.

Currently Pluto simply overwrites the file with an in-memory copy, not even checking that there is a conflict.

I guess, FileWatching.poll_file can help. In this case we might parse that new version of the file (as in Open) and try resucing computed results for the cells with the same ID and exactly the same contents. The rest can be deemed modified and will re-compute upon Ctrl-S

@Moelf
Copy link
Contributor

Moelf commented Sep 14, 2020

up vote for this one since pluto notebook is just a .jl this is very nice to have when you have to, say, rename/edit a long function from vim or something.

@fonsp
Copy link
Owner

fonsp commented Sep 14, 2020

#240

@fonsp fonsp closed this as completed Sep 14, 2020
@pleiby
Copy link

pleiby commented Jan 24, 2021

Seeking easy way to manually reload Pluto .jl file from disk

#240 calls for automatic reload whenever the file is changed on disk, but even that it would be beneficial if
the user could easily manually reload from file. That would address the two use cases which are necessitated by
other intentional user activity:

  • after user edits of the .jl file with a text editor (e.g. refactoring, global search and replace, fast moves, block deletes, etc)
  • after source code updated on disk from a Git branch or pull

As it stands, even the following steps fail to read the updated code from the file.

  • backing up with the browser (<-) and
  • then typing the file path in the New session: Open from File dialog box
    Rather it uses some cached version of the file in memory.

Thanks for Pluto!

@Moelf
Copy link
Contributor

Moelf commented Jan 24, 2021

@pleiby #240 (comment) that's I thought too, haven't got around it but it's still in my mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants