Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

New lines in symbols break the outline menu #184

Open
bbaserdem opened this issue Oct 24, 2022 · 1 comment · May be fixed by #204
Open

New lines in symbols break the outline menu #184

bbaserdem opened this issue Oct 24, 2022 · 1 comment · May be fixed by #204

Comments

@bbaserdem
Copy link

bbaserdem commented Oct 24, 2022

I'm having a problem with a latex document that I have. I have a figure, which is considered a symbol. The caption for the figure is a paragraph; and texlab grabs the caption as the symbol text. It contains newlines in the code (no new lines in the compiled document) and I'm getting the following error;

Error executing vim.schedule lua callback: ...tart/symbols-outline.nvim/lua/symbols-outline/writer.lua:21: String cannot contain newlines
stack traceback:
        [C]: in function 'nvim_buf_set_lines'
        ...tart/symbols-outline.nvim/lua/symbols-outline/writer.lua:21: in function 'write_outline'
        ...tart/symbols-outline.nvim/lua/symbols-outline/writer.lua:92: in function 'parse_and_write'
        ...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:71: in function '_update_lines'
        ...acker/start/symbols-outline.nvim/lua/symbols-outline.lua:93: in function 'callback'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1958: in function 'handler'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1390: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

While I understand this is a texlab issue (the optional short caption should be the default as symbol; which is not) a catch-all solution of symbols-outline could trim the symbol name to be the first non-empty line, instead of the full text of the symbol. I don't see this being an issue besides texlab; but this could be a useful feature.

I checked the help text; and could not find anything besides blacklisting methods in the setup function; which I would rather avoid.

@tbung tbung linked a pull request Feb 14, 2023 that will close this issue
@albertfgu
Copy link

👍 to this - I found the same issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants