Closed dedukun closed 2 months ago
Hey @sxyazi, can you take a look just to make sure that I'm using the pub_static
correctly?
There's seems to be an issue, or maybe this is just how DDS is suppose to work, but this only saves to persistent memory if there's a different instance of Yazi also sub_remote
the same time. If only the instance that is doing the pub_static
is subbed it's not saving the data.
Sure, it sounds like a bug, I'll investigate it
Hi, I pushed a new commit, please give it a try
Hey,
It still seems to need to have two a different instance of Yazi subbed
https://github.com/dedukun/bookmarks.yazi/assets/25795432/7099cbe0-4ff2-4324-8ed2-d9372bcf1c22
Weird I tried now again and it seems to be working, I'll have a better look at it and do some more tests.
Oh I had a hidden terminal with Yazi running, that's why it was working... :smile:
I pushed a new commit just now, please try it again
Thanks @sxyazi , I think that it is working correctly now.
Thanks, I updated to the last commit and it is working has you said.
Just a side note, I noticed that when running the jump, i.e.
ya.manager_emit("cd", { bookmarks[selected].desc })
ya.manager_emit("arrow", { -99999999 })
ya.manager_emit("arrow", { bookmarks[selected].cursor })
that sometimes the arrows don't do anything, I must run it twice to jump to the cursor. The manager_emit
doesn't run in sync right? Maybe it does the arrow
before finishing the cd
?
This is not an issue in the last commit, I think that it was happening before.
I'm not sure if this is even an issue, I can always listen to the cd
DDS event and only do the arrow
then.
The manager_emit doesn't run in sync right? Maybe it does the arrow before finishing the cd?
Yeah manager_emit
is async, but it does ensure the order of commands.
I can always listen to the cd DDS event and only do the arrow then.
I'm not very sure I understand what you mean. If you cd
into a new directory (that hasn't been loaded before), triggering arrow
at this point won't do anything because until the directory is fully loaded (or partially loaded), there are no files in that directory. arrow
will be ignored when executed on an empty directory.
If that's the issue, currently the only solution is to use loop + ya.sleep()
. I'll add a utility function in the next target to better address it.
Thanks, I updated to the last commit and it is working has you said.
Just a side note, I noticed that when running the jump, i.e.
ya.manager_emit("cd", { bookmarks[selected].desc }) ya.manager_emit("arrow", { -99999999 }) ya.manager_emit("arrow", { bookmarks[selected].cursor })
that sometimes the arrows don't do anything, I must run it twice to jump to the cursor. The
manager_emit
doesn't run in sync right? Maybe it does thearrow
before finishing thecd
?This is not an issue in the last commit, I think that it was happening before.
You should not record cwd
and cursor
,
you just record the url
of the file,
Then you can cd
the url
to jump to where you have record.
Ah yeah, that reminds me, you can just use the reveal
command, it handles all that automatically, even if there aren't any files in the directory yet. It'll hover over the correct file once the directory files are loaded.
I'm not very sure I understand what you mean. If you
cd
into a new directory (that hasn't been loaded before), triggeringarrow
at this point won't do anything because until the directory is fully loaded (or partially loaded), there are no files in that directory.arrow
will be ignored when executed on an empty directory.If that's the issue, currently the only solution is to use loop +
ya.sleep()
. I'll add a utility function in the next target to better address it.
Yes I think that's what was happening, I'll have a look at reveal
has you said, I didn't know about that command.
Thanks, I updated to the last commit and it is working has you said. Just a side note, I noticed that when running the jump, i.e.
ya.manager_emit("cd", { bookmarks[selected].desc }) ya.manager_emit("arrow", { -99999999 }) ya.manager_emit("arrow", { bookmarks[selected].cursor })
that sometimes the arrows don't do anything, I must run it twice to jump to the cursor. The
manager_emit
doesn't run in sync right? Maybe it does thearrow
before finishing thecd
? This is not an issue in the last commit, I think that it was happening before.You should not record
cwd
andcursor
,you just record the
url
of the file,Then you can
cd
theurl
to jump to where you have record.
Oh, I also didn't know that we could use cd
like that. Thanks I'll also have a look at it.
closes #6 and #9