typst-preview.nvim icon indicating copy to clipboard operation
typst-preview.nvim copied to clipboard

Not updating when using WSL

Open carschandler opened this issue 1 year ago • 7 comments

Hey there! I'm interested in using Typst and am a neovim user, so I found your plugin. I love the idea, but when I run TypstPreview, I get the preview but it doesn't update as I type or even when I write the changes. I can get an updated version by toggling the preview off and back on. I'm not sure if this has anything to do with me running the plugin on WSL... it's an Arch Linux install, but I also use nix. I see that the typst-preview-linux-x64 is dynamically linked, so maybe that's part of the issue.

carschandler avatar Jan 11 '24 13:01 carschandler

Hi,

I believe that #18 will fix your issue. It seems that the PR's author is running into the same issue as you are.

chomosuke avatar Feb 25 '24 05:02 chomosuke

Sweet thanks for the info! I’ll try it out and let you know.

carschandler avatar Feb 25 '24 05:02 carschandler

@carschandler can you try it now that #18 has been merged ? thanks If on nix*-unstable just install the dependencies , add their bin names/paths to the config as shown in the README and you should be fine. If on any other channel other than unstable the typst-preview version provided wont work

LamprosPitsillos avatar Mar 03 '24 19:03 LamprosPitsillos

@LamprosPitsillos I just tried today and I was able to successfully add the paths manually and get the preview to open again, but unfortunately it is still having the same issue I originally described. I wonder if this is a problem with the nix package... have you been able to get it working using nix? I'm on the newest version of the lua plugin and I'm also on typst-preview v.0.10.8.

FWIW, I tried this using both my Arch+Nix and NixOS WSL distros. I can try it using pure NixOS when I get home.

carschandler avatar Mar 07 '24 20:03 carschandler

Does :messages not show anything?

LamprosPitsillos avatar Mar 07 '24 21:03 LamprosPitsillos

Only when debug = true in my config.

Watching buffer: 1
[2024-03-07T21:08:50Z INFO  typst_preview] Arguments: CliArguments {
        preview: PreviewArgs {
            data_plane_host: "127.0.0.1:0",
            control_plane_host: "127.0.0.1:0",
            enable_partial_rendering: false,
            invert_colors: "never",
        preview_mode: Document,
        static_file_host: "127.0.0.1:0",
        dont_open_in_browser: true,
        font_paths: [],
        root: Some(
            "/home/chan/temp",
        ),
        input: "/home/chan/temp/test.typst",
    }
Connecting to server
websocat connecting to: ws://127.0.0.1:35625/
[2024-03-07T21:08:50Z DEBUG typst_preview::actor::typst] TypstActor: waiting for message
[2024-03-07T21:08:50Z DEBUG typst_ts_compiler::service::watch] start watching files...
[2024-03-07T21:08:50Z INFO  typst_preview] Data plane server listening on: 127.0.0.1:37079
[2024-03-07T21:08:50Z INFO  typst_preview] Control plane server listening on: 127.0.0.1:35625
[2024-03-07T21:08:50Z DEBUG typst_ts_compiler::service::compile] CompileActor: initialized
[2024-03-07T21:08:50Z DEBUG typst_ts_compiler::service::compile] CompileActor: fs event incoming None
[2024-03-07T21:08:50Z INFO  typst_ts_compiler::service::diag::console] /test.typst: compiling ...

[2024-03-07T21:08:50Z INFO  typst_ts_compiler::service::diag::console] /test.typst: Compilation succeeded in 462.762µs

[2024-03-07T21:08:50Z DEBUG typst_ts_compiler::service::compile] CompileActor: fs event incoming Some(Update(FileChangeSet { removes: [], inserts: [("/home/chan/temp/test.typst", FileSnapshot { mtime: SystemTime
 { tv_sec: 1709845727, tv_nsec: 668034209 }, content: FileContent { len: 27 } })] }))
[2024-03-07T21:08:50Z INFO  typst_ts_compiler::service::diag::console] /test.typst: compiling ...

[2024-03-07T21:08:50Z INFO  typst_ts_compiler::service::diag::console] /test.typst: Compilation succeeded in 31.716µs

Setting link
[2024-03-07T21:08:50Z INFO  typst_preview] Static file server listening on: 127.0.0.1:38779
Opening preview with command: /mnt/c/Windows/explorer.exe http://127.0.0.1:38779
[2024-03-07T21:08:50Z INFO  typst_preview] Peer address: 127.0.0.1:47574
[2024-03-07T21:08:50Z INFO  typst_preview] New WebSocket connection: 127.0.0.1:47574
websocat said: {"event":"syncEditorChanges"}
{"event":"compileStatus","kind":"Compiling"}
{"event":"compileStatus","kind":"CompileSuccess"}
{"event":"compileStatus","kind":"Compiling"}
{"event":"compileStatus","kind":"CompileSuccess"}
[2024-03-07T21:08:50Z DEBUG typst_preview::actor::editor] EditorActor: received message from editor: SyncMemoryFiles ["/home/chan/temp/test.typst"]
[2024-03-07T21:08:50Z DEBUG typst_preview::actor::typst] TypstActor: processing SYNC memory files: ["/home/chan/temp/test.typst"]
[2024-03-07T21:08:50Z DEBUG typst_ts_compiler::service::compile] CompileActor: memory event incoming
[2024-03-07T21:08:50Z INFO  typst_ts_compiler::service::diag::console] /test.typst: compiling ...

[2024-03-07T21:08:50Z INFO  typst_ts_compiler::service::diag::console] /test.typst: Compilation succeeded in 125.528µs

websocat said: {"event":"compileStatus","kind":"Compiling"}
websocat said: {"event":"compileStatus","kind":"CompileSuccess"}
[2024-03-07T21:08:51Z INFO  typst_preview] Serve frontend: Document
[2024-03-07T21:08:51Z INFO  typst_preview] Peer address: 127.0.0.1:48884
[2024-03-07T21:08:51Z INFO  typst_preview] New WebSocket connection: 127.0.0.1:48884
[2024-03-07T21:08:51Z INFO  typst_preview] New WebSocket connection: 127.0.0.1:48884
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] OutlineRenderActor: waiting for message
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] RenderActor: waiting for message
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] RenderActor: has_full_render: true
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] OutlineRenderActor: received message: RenderFullLatest
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] OutlineRenderActor: sending outline
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] OutlineRenderActor: waiting for message
websocat said: {"event":"outline","items":[]}
[2024-03-07T21:08:51Z DEBUG typst_preview::actor::render] RenderActor: waiting for message

This is the initial log I get after :TypstPreview and then it stays here even if I start typing or write the file.

carschandler avatar Mar 07 '24 21:03 carschandler

@LamprosPitsillos ,hello, I had the same problem. But I edited typ file in linuxmint and use the newest typst-preview. it can'i update after I :TypstPreview.

ZZT-console avatar Apr 04 '24 02:04 ZZT-console

Please reopen this issue if the problem persist with the newest release.

chomosuke avatar Oct 15 '24 10:10 chomosuke