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

"Open in ${EDTIOR}" does not always use the latest node contents #977

Open
ShadowKyogre opened this Issue Sep 15, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@ShadowKyogre

ShadowKyogre commented Sep 15, 2018

Expected behavior

Opening a node in an external editor should always have the latest content.

What actually happens

It doesn't if the node isn't modified before exiting the external program.

Steps to reproduce

  1. Open a node in your editor of choice with the right click menu entry "Edit in ${EDITOR}"
  2. Close the editor without writing anything to the file.
  3. Type some text in the node.
  4. Open the same node in your editor of choice with the right click menu entry "Edit in ${EDITOR}"
  5. The external editor will show the file data at the time you opened it the first time, but not the second.

Notes

Tested with gvim set as EDITOR. Not sure if this is editor specific, but will do further testing.

I think the main cause of the bug is that Leo isn't always updating the node data in the temporary file before having EDITOR open said file.

Updates

Further investigation of the behavior points to efc.open_with_helper. It looks like the code currently doesn't check if the node's been updated since the temporary file was created.

@edreamleo edreamleo self-assigned this Sep 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment