nvimdev / indentmini.nvim

A minimal and blazing fast indentline plugin
MIT License
171 stars 12 forks source link

enabling indentmin blocks nvim #4

Closed Ultra-Code closed 1 year ago

Ultra-Code commented 1 year ago

after enabling this plugin I am unable to open and edit a file, nvim gets stack opening the file.

NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3

I use lazy as my plugin manager

glepnir commented 1 year ago

idk what's meaning ? what's problem you get ?

Ultra-Code commented 1 year ago

After adding indentmini to my plugins, nvim hangs when opening files that contain indentations. Using indent-blankline work but I want to use indentmini.

glepnir commented 1 year ago

for my daily usage it works fine T.T

Ultra-Code commented 1 year ago

Can you give me pointers as to how to debug the plugin during nvim startup so that I can get more conclusive information that will help fix this bug? I tried running nvim with --startuptime option but since it hangs the whole terminal, I have to kill the terminal instance thereby prevent me from getting any information.

Kindly test it out with my configuration,replace the indent-blankline's configuration with below and see if you have any issues.

{
        "nvimdev/indentmini.nvim",
        event = { "BufReadPost", "BufNewFile" },
        opts = {
            char = "│",
            exclude = {
                "help",
                "alpha",
                "dashboard",
                "neo-tree",
                "Trouble",
                "lazy",
                "mason",
                "notify",
                "toggleterm",
                "lazyterm",
            },
        },
    },

System Info:

OS: Arch Linux on Windows 10 x86_64 
Kernel: 5.15.90.1-microsoft-standard-WSL2 
Uptime: 18 mins 
Packages: 255 (pacman) 
Shell: zsh 5.9 
DE: sway 
Terminal: Neovim Terminal 
CPU: 11th Gen Intel i5-1135G7 (8) @ 2.419GHz 
GPU: cbde:00:00.0 Microsoft Corporation Basic Render Driver 
Memory: 1318MiB / 3783MiB 

When I get home I will try on my Archlinux box and see if I get the same behavior.

glepnir commented 1 year ago

could you try use event ='BufEnter ?

Ultra-Code commented 1 year ago

@glepnir I tried BufEnter before using "BufReadPost", "BufNewFile" but same behavior

glepnir commented 1 year ago

touch min.lua and put these lines . nvim --clean -u min.lua edit file . try this test..

vim.opt.rtp:append('path/to/indentmini.nvim')
require('indentmini').setup({})
Ultra-Code commented 1 year ago

The above min repro also hangs nvim.

glepnir commented 1 year ago

hmm it's wired test case and some people usage also good ..

Ultra-Code commented 1 year ago

Manually debugging the sources, I have been able to narrow it down to the loop in the on_line fn in indentline fn.

glepnir commented 1 year ago

it should not hang your neovim. which file can you share with me or some reproduce code ?

Ultra-Code commented 1 year ago

basically opening any file with indentation hangs it, sample file.

using vim.fn.shiftwidth() instead of vim.bo[bufnr].sw as the loop step variable fixes this issue for me.

Ultra-Code commented 1 year ago

I will do a pr for this fix if you are in agreement. Or we could use the suggestion in the [shiftwidth()](https://neovim.io/doc/user/builtin.html#shiftwidth()) documentation.

But now, I have another issue, the lines aren't faint as with indent-blankline, Is there a way to make the lines faint so that they are not distracting?

glepnir commented 1 year ago

only highlight current in my plan recently will write.

Ultra-Code commented 1 year ago

@glepnir what are you opinion about using shiftwidth() in place of vim.bo[bufnr].sw since one is buffer-local and the other is the effective shift. In my instance, shiftwidth is always the same value as vim.bo[vim.fn.bufnr()].sw