Issue #165 <https://github.com/leo-editor/leo-editor/issues/165>requests the vim-open-*file* command.
This post suggests an easy way to do vim-open-file and asks for your comments. *Executive summary* The vim-open-file command should open the actual external file in vim, not a temp file. *Background* The ExternalFilesController in leoApp.py encapsulates recent work, and contains code from the mod_tempfname plugin. The new code handles the vim-open-*node* command. This code creates a *temporary *file, invokes vim on that file, checks for modifications of the temp file at idle time and finally updates the node in Leo if the temp file has changed. Complications (conflicts) arise if both the temp file and the originating node have changed. Recent work *also *checks for changes to external (*non-temporary*) files created by all @<file> nodes in all open Leo outlines. Again, complications can arise if both the external file and the originating @<file> node have changed. The two kinds of complications are similar but not identical ;-) *The old and new plans* Originally, I had envisaged the vim-open-*file* command to be a super-duper version of the vim-open-*node* command. vim-open-file would create a *temporary *file and then manage that file similarly to the the vim-open-node command. But this would be tricky in so many ways. The Aha is for the vim-open-file command to open the *real *external file in vim. This would bypass the vim-open-node machinery. When vim changes this file, Leo will detect those changes and potential conflicts using *existing *code. The code will then prompt the user to update the outline. Even better, if the user tries to write the external file in Leo while the file is open in vim, the OS will likely complain. That looks like what we want. *Summary* Having vim-open-file open the actual external file in vim seems simpler and safer. Your comments, please. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
