Skip to content
Discussion options

You must be logged in to vote

aha ! I managed to do it !

 function ()
        local sa = require("sniprun.api")
        local row = vim.api.nvim_win_get_cursor(0)[1]
        local called = false

        sa.register_listener(function(result)
            if called then return end
            called = true

            if result.status ~= "ok" then
                print("SnipRun error: " .. result.message)
                return
            end

            local lines = vim.split(result.message, "\n", { plain = true })

            --smartly wrapping results into comment, so we can call sniprun multiple times easily
            local prefixes = {
                lua = "---> ",
                c = "//-> ",
             …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@qiine
Comment options

Answer selected by qiine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants