Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to unpin the main file with tinymist.pinMain fails in Neovim #1103

Open
JonPichel opened this issue Jan 2, 2025 · 1 comment
Open
Labels
editor-integration Features about editor integrations need-to-investigate

Comments

@JonPichel
Copy link

JonPichel commented Jan 2, 2025

Describe the bug

Sending the tinymist.pinMain command with a nil argument from Neovim as specified in the documentation doesn't work.

Package/Software version:

Neovim version:

NVIM v0.11.0-dev-1437+g259573db83
Build type: Release
LuaJIT 2.1.1734355927

tinymist version: v0.12.14. Get it by tinymist --version in terminal.

tinymist
Build Timestamp:     2024-12-25T13:14:21.205058339Z
Build Git Describe:  v0.12.14
Commit SHA:          db2080715352f8cc8eba699b42ae3fa828892c07
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: x86_64-unknown-linux-gnu
Typst Version:       0.12.0
Typst Source:        git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.12.0#58426a90a7ef721738a01be09793d33e55eb75a9

Logs:

Neovim messages:

tinymist: -32602: expect Option<PathBuf> at args[0]

Additional context

This is my configuration for tinymist in Neovim:

        tinymist = {
          on_attach = function(client, bufnr)
            -- Pin the main file.
            vim.keymap.set("n", "<leader>pp", function()
              client:exec_cmd({ command = 'tinymist.pinMain', arguments = { vim.api.nvim_buf_get_name(0) } })
            end, {
              buffer = bufnr,
              desc = "Typst: Pin main file"
            })
            -- Unpin the main file.
            vim.keymap.set("n", "<leader>pu", function()
              client:exec_cmd({ command = 'tinymist.pinMain', arguments = { nil } })
            end, {
              buffer = bufnr,
              desc = "Typst: Unpin main file"
            })
          end,
          settings = {
            exportPdf = "onSave",
            fontPaths = {
              "fonts",
            },
            formatterMode = "typstyle",
          },
        },
``
@JonPichel JonPichel changed the title tinymist.unpinMain fails in Neovim Trying to unpin the main file with tinymist.pinMain fails in Neovim Jan 2, 2025
@SylvanFranklin
Copy link
Contributor

The docs for neovim are out of date with a PR under way to fix them. What are you looking for by pinning the file? Is it to avoid exporting a blank PDF of a library file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-integration Features about editor integrations need-to-investigate
Projects
None yet
Development

No branches or pull requests

3 participants