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

Wrong formatting with nested lists #1432

Open
2 tasks done
flexagoon opened this issue May 21, 2024 · 2 comments
Open
2 tasks done

Wrong formatting with nested lists #1432

flexagoon opened this issue May 21, 2024 · 2 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@flexagoon
Copy link

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.11.0-dev+18-g63e3a63d2

Neorg setup

    require("neorg").setup({
      load = {
        ["core.defaults"] = {},
        ["core.concealer"] = {},
      },
    })

Actual behavior

Nested lists are formatted to be a single line

Expected behavior

They should be properly wrapped and formatted

Steps to reproduce

Write the following:

- foo
-- bar

Execute gqip

The paragraph will be formatted like this:

- foo -- bar

Potentially conflicting plugins

No response

Other information

No response

Help

No

Implementation help

No response

@flexagoon flexagoon added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label May 21, 2024
@benlubas
Copy link
Contributor

I don't think that neorg sets the format expression anywhere, and there is no norg lsp at the moment (so lsp format expression also wouldn't take effect). So it just falls back to default formatting which is controlled by text width.

Couple paths forward:

  • Just wait for LSP/external formatter to be built
  • implement a custom format expression (I'm already doing this in neorg-conceal-wrap, I could add this logic to that plugin)
  • you can use a custom text object for a list item, and use that instead of ip. This is less than ideal though if you want to format an entire group of bullets

@benlubas
Copy link
Contributor

benlubas commented Jun 7, 2024

I could add this logic to that plugin

I did do this btw, but that plugin also formats based on concealed width obviously. benlubas/neorg-conceal-wrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

2 participants