luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
270 stars 20 forks source link

Allow wrapping on words in Floating Window #7

Closed parmardiwakar150 closed 1 year ago

parmardiwakar150 commented 1 year ago

This is my config for devdocs

require("nvim-devdocs").setup({
    dir_path = vim.fn.stdpath("data") .. "/devdocs",
    telescope = {},
    telescope_alt = {
        layout_config = {
            width = 75,
        },
    },
    float_win = {
        relative = "editor",
        height = math.floor(vim.o.lines * 0.7),
        width = math.floor(vim.o.columns * 0.8),
        border = "rounded",
    },
    wrap = true,
    ensure_installed = {},
})

I am opening DevDocs in a floating window, but some lines contain more characters than it can fit on the screen, causing the text to be hidden. By enabling the wrap = truesetting, I am able to view the complete text, but it is wrapping based on the characters.

image

I would like the text to wrap based on words. If I run set linebreak for the floating window, then it fixes the issues.

image

Is there any way to set this by default for the floating window? If there isn't any, can you please add some config parameter for it?

luckasRanarison commented 1 year ago

Thanks for the report, I didn't know that wrap worked that way, it'd make sense to add linebreak by default if wrap is set to true. I'll change this right away.

luckasRanarison commented 1 year ago

I fixed it in aa884e3

parmardiwakar150 commented 1 year ago

Thanks a lot