Comments (11)
can't reproduce it.
from nvim-ufo.
Solved by ufo.
from nvim-ufo.
what's error msg?
from nvim-ufo.
what's error msg?
No error message, just scroll_docs causes strange behavior, cmp.scroll_docs() moves my cursor forward one character, and the autocomplete window goes back to its original state
from nvim-ufo.
I did more testing, and it turns out that the problem has nothing to do with vim.o.foldenable, but with ufo itself!
from nvim-ufo.
can't reproduce it.
Okay, I'll try to make a minimal configuration. There may be other conflicts.
from nvim-ufo.
I'm sorry, using ufo and nvim-cmp minimal configuration did not cause the problem. It should be other plugins and ufo that caused the problem, because if I disable ufo, everything works fine.
I will continue testing.
from nvim-ufo.
In fact, reactive.nvim and ufo have some conflicts, which will cause this problem when they exist at the same time.
I don't know who is the source of the problem.
The minimum configuration is as follows:
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"rasulomaroff/reactive.nvim",
config = function()
require("reactive").setup({
builtin = {
cursorline = true,
cursor = true,
modemsg = true,
},
})
end,
},
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
config = function()
require("mason-tool-installer").setup({
ensure_installed = {
"lua-language-server",
},
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
require("lspconfig").lua_ls.setup({})
end,
},
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
},
config = function()
local cmp = require("cmp")
cmp.setup({
mapping = {
["<C-u>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end),
["<C-e>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end),
["<C-h>"] = cmp.mapping(function(fallback)
if cmp.visible_docs() then
cmp.scroll_docs(-5)
else
fallback()
end
end),
["<C-b>"] = cmp.mapping(function(fallback)
if cmp.visible_docs() then
cmp.scroll_docs(5)
else
fallback()
end
end),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
}),
})
end,
},
{
"nvim-treesitter/nvim-treesitter",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "query" },
})
end,
},
{
"kevinhwang91/nvim-ufo",
dependencies = {
"kevinhwang91/promise-async",
},
config = function()
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
require("ufo").setup({
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
})
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
from nvim-ufo.
The issue is complex. reactive.nvim
fires a redraw, and then ufo invokes vim.api.nvim_win_call
to make the floating window of nvim-cmp
broken.
I'm not sure if there's an issue of vim.api.nvim_set_decoration_provider
used by ufo.
from nvim-ufo.
In which repository do you think this problem would be more simple and elegant to solve? Or should it be solved in conjunction with the reactive.nvim contributors?
from nvim-ufo.
Ha ha ha, let me know if you need any help.
from nvim-ufo.
Related Issues (20)
- Error in latest for `treesitter` provider HOT 2
- Folding Hides Function Names with ufo.nvim HOT 1
- [Ques] Folds are open after formatting HOT 2
- `zM` and `zR` sometimes do change `foldlevel` (nvchad config) HOT 5
- go if err != nil, fold to the back of the previous line HOT 8
- Toggle fold level numbers for nested folds HOT 2
- "UnhandledPromiseRejection: expected table, got nil" in nightly NeoVim HOT 1
- UFO fails to initialize in buffer when the buffer is loaded while hidden then opened (Harpoon) HOT 4
- index out of bounds HOT 1
- Treesitter provider doesn't respect foldnestmax option
- Visual mode highlight only applies to ctermbg
- Make neovim's `foldline` look like the github web code editor HOT 1
- Question: Changing or disabling folded line highlighting HOT 3
- UfoFoldedFg and UfoFoldedBg color setting not working HOT 1
- TreeSitter provider segfaults on NVIM v0.10.0 on WSL2 HOT 15
- cursor get stucked when type zm to fold all in a file which lines over 10k HOT 5
- Nothing displayed at the first line after folded HOT 8
- foldlevel-like functionality HOT 1
- Setting ufo's highlight groups to None doesn't remove folding hightlights HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-ufo.