Open eblume opened 8 months ago
@eblume I noticed your use case is like what I requested under #300
Thanks @voxelv. It looks like my reading of #300's solution on lines 144-146, this plugin is not using --edit
but rather nb edit
. My issue is specifically related to using either nb add
or nb edit
while using the --edit
flag to indicate that the editor should be invoked. In particular, my problem is that the resulting editor session seems to hold a "lock" of some sort on either nb itself (globally across all processes) or else on the underlying git repo. (Note the obscure corner case where nb edit
is used with --edit
which corresponds to the case that we want to append content to a document AND THEN, afterwards, open the resulting document in an editor.)
Can you tell me if the plugin exhibits this behavior as well? From my reading it doesn't seem to invoke --edit
in any case so I don't know if a test can be made.
(An extra word aside here for my use case: I am trying to design an 'interactive log' of sorts where a long-lived editor session is set to autoload changes from scripted prompts while allowing the user to attach prose and links in context buffers. It's all very hacked and alpha right now, but the code is working and can be seen here.)
I have noticed that using
nb add
ornb edit
with the--edit
flag causes nb to stop responding to any further requests until the editor session is closed.I was able to rectify this in my scripts by doing add/edit command with it's relevant --content section first, and then separately executing
nb open
to open the editor to the file, but I wonder if this is a bug or something that can be fixed? I understand the issue is probably related to the git usage pattern, maybe you can help me make sense of the workflow I should use instead.Here was the pre-workaround version of my function:
Here is the workaround function:
I'm sure there's something I'm not quite getting here, but I'm currently unblocked with my workaround so please of course feel free to close this issue if there's nothing to track on your end.