kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.23k stars 44 forks source link

type `O` under folded line in normal mode may make fold color disabled #34

Closed kevinhwang91 closed 2 years ago

kevinhwang91 commented 2 years ago

Neovim version (nvim -v | head -n1)

master

Operating system/version

ArchLinux

How to reproduce the issue

local function level1()
    local function level2()

    end
end
  1. 2ggzczc
  2. O

Expected behavior

image

Actual behavior

image

kevinhwang91 commented 2 years ago

Caused by level1 and level2 both have folded, can't identify level1 have been become line 2 and skip to refresh its virtual text in the decorator.

Solution: Get the text per line and use textLine as a field to compare. But we should use a buf lines model to cache the result, otherwise using vim.api.nvim_buf_get_lines directly will get obvious perf regression.

kevinhwang91 commented 2 years ago

fixed.