SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
762 stars 30 forks source link

Errors for multi-line nodes #61

Open LittleTealeaf opened 1 year ago

LittleTealeaf commented 1 year ago

I'm getting the following errors:

   Error  10:58:25 AM msg_show.lua_error Error executing vim.schedule lua callback: ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:39: 'replacement string' item contains newlines
stack traceback:
    [C]: in function 'nvim_buf_set_lines'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:39: in function 'fill_buffer'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:366: in function 'redraw'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:248: in function 'new'
    ...share/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/init.lua:255: in function 'handler'
    ...share/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/init.lua:201: in function 'handler'
    ....local/share/nvim/lazy/nvim-navic/lua/nvim-navic/lib.lua:264: in function 'handler'
    ...w/Cellar/neovim/0.9.0/share/nvim/runtime/lua/vim/lsp.lua:1394: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
   Error  10:58:25 AM msg_show.lua_error Error detected while processing CursorMoved Autocommands for "<buffer=16>":
10:58:25 AM msg_show Error executing lua callback: ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:39: 'replacement string' item contains newlines
stack traceback:
    [C]: in function 'nvim_buf_set_lines'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:39: in function 'fill_buffer'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:366: in function 'redraw'
    ...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:198: in function <...re/nvim/lazy/nvim-navbuddy/lua/nvim-navbuddy/display.lua:194>

When I try opening navbuddy in my .scss file.

This is what my :LspInfo is:

 Press q or <Esc> to close this window. Press <Tab> to view server doc.

 Language client log: /home/tealeaf/.local/state/nvim/lsp.log
 Detected filetype:   scss

 3 client(s) attached to this buffer: 

 Client: null-ls (id: 1, bufnr: [4])
    filetypes:       graphql, handlebars, less, jsonc, typescriptreact, typescript, vue, markdown.mdx, javascript, javascriptreact, css, scss, markdown, yaml, json, html, toml
    autostart:       false
    root directory:  /home/tealeaf/git/littletealeaf.github.io
    cmd:             <function>

 Client: cssls (id: 2, bufnr: [4])
    filetypes:       css, scss, less
    autostart:       true
    root directory:  /home/tealeaf/git/littletealeaf.github.io
    cmd:             /home/tealeaf/.local/share/nvim/mason/bin/vscode-css-language-server --stdio

 Client: emmet_ls (id: 3, bufnr: [4])
    filetypes:       astro, css, eruby, html, htmldjango, javascriptreact, less, pug, sass, scss, svelte, typescriptreact, vue
    autostart:       true
    root directory:  /home/tealeaf/git/littletealeaf.github.io
    cmd:             /home/tealeaf/.local/share/nvim/mason/bin/emmet-ls --stdio

 Configured servers list: kotlin_language_server, cssls, yamlls, emmet_ls, prismals, jsonls, tsserver, vimls, clangd, sqlls, pyright, texlab, gradle_ls, lua_ls, lemminx, html, bashls, gopls, jdtls, cssmodules_ls

Not a total deal-breaker for me, but thought this would be something that should be looked into :)

LittleTealeaf commented 1 year ago

Crazily enough, it started working when I moved some code to another file. Seems it doesn't like this section of code:

@media only screen and (max-device-width: 768px),
  only screen and (max-width: 768px) {
        @include header-mobile;
}

because it has multiple lines?

SmiteshP commented 1 year ago

Oh I see, this is definitely due to multi line elements. How should we fix this though 🤔

Charging1948 commented 1 month ago

Happens also inside of nix-files, when writing multi-line strings:

text = ''
  # Check if the correct number of arguments is provided
  if [ "''$#" -ne 2 ]; then
    echo "Usage: ''$0 input.pdf output.md"
    exit 1
  fi
'';