dedukun / bookmarks.yazi

MIT License
43 stars 1 forks source link

refactor: use `ya.sync` to simplify the code #1

Closed sxyazi closed 4 months ago

sxyazi commented 4 months ago

Needs the latest main branch of Yazi at the moment.

dedukun commented 4 months ago

Hi, I reverted the commit because I can't get it working on my end. I installed the git version from cargo, so I'm in

❯ yazi --version
yazi 0.2.3 (dc1718f 2024-02-09)

I had tried to use the ya.sync method when I was writing it but the state inside the ya.sync didn't seemed to be persist between calls from my tests.

sxyazi commented 4 months ago

That's so weird, have you changed the plugin command in your keymap.toml by removing the --sync option?

dedukun commented 4 months ago

Yeah, however the issue now is about the folder used in save_bookmarks. It's nil for some reason.

EDIT:

 2024-02-10T08:02:54.571163Z ERROR yazi::lives::lives: runtime error: [string "yazi-fm/src/app/commands/plugin.rs:46:30"]:36: attempt to index a nil value (global 'folder')
stack traceback:
        [C]: in metamethod 'index'
        [string "yazi-fm/src/app/commands/plugin.rs:46:30"]:36: in function <[string "yazi-fm/src/app/commands/plugin.rs:46:30"]:30>
    at yazi-fm/src/lives/lives.rs:63