We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
NVIM v0.10.0-dev-2296+gcca8a78ea
Windows 11 (WSL)
I don't have any repro.lua but I can show a video of the problem followed by my UFO config.
wrap
false
Video :
Ufo config :
local handler = function(virtText, lnum, endLnum, width, truncate) local newVirtText = {} local suffix = (" %d "):format(endLnum - lnum) local sufWidth = vim.fn.strdisplaywidth(suffix) local targetWidth = width - sufWidth local curWidth = 0 for _, chunk in ipairs(virtText) do local chunkText = chunk[1] local chunkWidth = vim.fn.strdisplaywidth(chunkText) if targetWidth > curWidth + chunkWidth then table.insert(newVirtText, chunk) else chunkText = truncate(chunkText, targetWidth - curWidth) local hlGroup = chunk[2] table.insert(newVirtText, { chunkText, hlGroup }) chunkWidth = vim.fn.strdisplaywidth(chunkText) -- str width returned from truncate() may less than 2nd argument, need padding if curWidth + chunkWidth < targetWidth then suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) end break end curWidth = curWidth + chunkWidth end table.insert(newVirtText, { suffix, "MoreMsg" }) return newVirtText end return { "kevinhwang91/nvim-ufo", event = "BufReadPost", opts = { provider_selector = function(bufnr, filetype, buftype) return { "treesitter", "indent" } end, fold_virt_text_handler = handler, preview = { win_config = { winhighlight = "Normal:Folded", winblend = 0, }, mappings = { scrollU = "<C-u>", scrollD = "<C-d>", jumpTop = "[", jumpBot = "]", }, }, }, dependencies = { { "kevinhwang91/promise-async" }, { "luukvbaal/statuscol.nvim", opts = { foldfunc = "builtin", setopt = true, relculright = true, }, config = function(_, opts) require("statuscol").setup(vim.tbl_deep_extend("force", opts, { segments = { { text = { "%s" }, click = "v:lua.ScSa" }, { text = { require("statuscol.builtin").lnumfunc, " " }, click = "v:lua.ScLa" }, { text = { require("statuscol.builtin").foldfunc, " " }, click = "v:lua.ScFa" }, }, })) end, }, }, }
1 - Fold a function 2 - Move horizontally 3 - Fold is staying at its position
1 - Fold a function 2 - Move horizontally 3 - Fold is following cursor horizontal moovements
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Neovim version (nvim -v | head -n1)
NVIM v0.10.0-dev-2296+gcca8a78ea
Operating system/version
Windows 11 (WSL)
How to reproduce the issue
I don't have any repro.lua but I can show a video of the problem followed by my UFO config.
EDIT : Happens when vim option
wrap
is set tofalse
Video :
ufo.mp4
Ufo config :
Expected behavior
1 - Fold a function
2 - Move horizontally
3 - Fold is staying at its position
Actual behavior
1 - Fold a function
2 - Move horizontally
3 - Fold is following cursor horizontal moovements
The text was updated successfully, but these errors were encountered: