oberblastmeister / neuron.nvim

Make neovim the best note taking application
MIT License
398 stars 34 forks source link

Does not work with the latest version of neuron #19

Closed VVKot closed 3 years ago

VVKot commented 3 years ago

After https://github.com/srid/neuron/pull/572 the output of neuron query is pretty-printed, and this trips up decoding the JSON. The error messages are thrown here - but I am not sure how to fix it. https://github.com/oberblastmeister/neuron.nvim/blob/4a92912eec159faff27c56cfe7683cd5d09145fc/lua/neuron/cmd.lua#L79

It seems that string contains some linebreaks that can not be handled by json_decode, and those are not \ns or \rs - I tried substituting those. @oberblastmeister maybe you happen to know how to fix it?

VVKot commented 3 years ago

Example output if I just print(data) above the offending line:

[
    {
        "Date": "2021-01-21T19:01",
        "ID": "inbox",
        "Meta": {
            "date": "2021-01-21T19:01",
            "tags": []
        },
        "Path": "./inbox.md",
        "Slug": "inbox",
        "Title": "Inbox"
    }
]
oberblastmeister commented 3 years ago

16 should fix this

VVKot commented 3 years ago

Ah I see, that's because plenary was calling this function for every line! That all makes sense now, and linked PR indeed fixes the issue. Thanks @jqfeld! ❤️