Skip to content
New issue

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

After upgrade to 3.8.3 config, an error occurs with old nightly Neovim versions #936

Closed
mei28 opened this issue Oct 29, 2024 · 28 comments
Closed
Labels
wontfix This will not be worked on

Comments

@mei28
Copy link

mei28 commented Oct 29, 2024

Problem

After upgraded to 3.8.3, this happens


Failed to run `config` for indent-blankline.nvim
.../share/nvim/lazy/indent-blankline.nvim/lua/ibl/utils.lua:22: type: expected function: 0x0100a91ac0, got string (HIGHLIGHT_SETUP)
# stacktrace:
  - vim/shared.lua:0 _in_ **validate**
  - /indent-blankline.nvim/lua/ibl/utils.lua:22 _in_ **validate**
  - /indent-blankline.nvim/lua/ibl/hooks.lua:61 _in_ **register**
  - ~/.config/nvim/lua/plugin/indent.lua:25 _in_ **config**

Steps to reproduce

  {
    "lukas-reineke/indent-blankline.nvim",
    main = "ibl",
    version = 'v3.8.3',
    event = { 'BufNewFile', 'BufRead' },
    config = function()
      vim.opt.list = true
      vim.opt.listchars:append "space: "
      -- vim.opt.listchars:append "eol:↴"
      local highlight = {
        "RainbowRed",
        "RainbowYellow",
        "RainbowBlue",
        "RainbowOrange",
        "RainbowGreen",
        "RainbowViolet",
        "RainbowCyan",
      }

      local hooks = require "ibl.hooks"
      -- create the highlight groups in the highlight setup hook, so they are reset
      -- every time the colorscheme changes
      hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
        vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
        vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
        vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
        vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
        vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
        vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
        vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
      end)

      local status, ibl = pcall(require, 'ibl')
      if not status then
        return
      end
      ibl.setup {
        indent = {
          char = "¦",
          highlight = highlight,
        },
      }
    end,
  },

Expected behavior

"The settings worked well in v3.8.2, but an error occurs in v3.8.3."

Neovim version (nvim -v)

NVIM v0.11.0-nightly+852954f

@mei28 mei28 added the bug Something isn't working label Oct 29, 2024
@calvinchoy
Copy link

Not sure what the correct solution is, but you can temporary comment out:

indent = {
          char = "¦",
          highlight = highlight,
        },

to use the default indent options and prevent the error from showing up.

@exzolink
Copy link

same for hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)

@nifoc
Copy link

nifoc commented Oct 29, 2024

I guess the faster version of vim.validate is causing this

cc @MariaSolOs

@sinkr
Copy link

sinkr commented Oct 29, 2024

Same here.

@mei28
Copy link
Author

mei28 commented Oct 29, 2024

did it cause by this commit #934 ?

@dzintars
Copy link

Same. For now just tagged previous version.

return {
  'lukas-reineke/indent-blankline.nvim',
  tag = 'v3.8.2',
  enabled = true,
  main = 'ibl',
  opts = {},
  dependencies = {
    { 'HiPhish/rainbow-delimiters.nvim', lazy = true },
  },

  config = function(_)
    local highlight = {
      'RainbowRed',
      'RainbowYellow',
      'RainbowBlue',
      'RainbowOrange',
      'RainbowGreen',
      'RainbowViolet',
      'RainbowCyan',
      'CursorColumn',
      'WhiteSpace',
    }
    local hooks = require 'ibl.hooks'
    hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
      vim.api.nvim_set_hl(0, 'RainbowRed', { fg = '#E06C75' })
      vim.api.nvim_set_hl(0, 'RainbowYellow', { fg = '#E5C07B' })
      vim.api.nvim_set_hl(0, 'RainbowBlue', { fg = '#61AFEF' })
      vim.api.nvim_set_hl(0, 'RainbowOrange', { fg = '#D19A66' })
      vim.api.nvim_set_hl(0, 'RainbowGreen', { fg = '#98C379' })
      vim.api.nvim_set_hl(0, 'RainbowViolet', { fg = '#C678DD' })
      vim.api.nvim_set_hl(0, 'RainbowCyan', { fg = '#56B6C2' })
    end)

    vim.g.rainbow_delimiters = { highlight = highlight }

    require('ibl').setup {
      indent = {
        highlight = highlight,
        char = '',
        tab_char = '|',
      },
      scope = {
        enabled = true,
        show_start = false,
        show_end = false,
        highlight = highlight,
      },
      whitespace = {
        remove_blankline_trail = false,
      },
      exclude = {
        filetypes = {
          'NvimTree',
          'Trouble',
          'dashboard',
          'git',
          'help',
          'markdown',
          'notify',
          'packer',
          'sagahover',
          'terminal',
          'undotree',
        },
        buftypes = { 'terminal', 'nofile', 'prompt', 'quickfix' },
      },
    }
  end,
}

@BigJayToDaIzo
Copy link

BigJayToDaIzo commented Oct 29, 2024

Same. For now just tagged previous version.

return {
  'lukas-reineke/indent-blankline.nvim',
  tag = 'v3.8.2',
  enabled = true,
 ...
}

Not to cloud the thread with 'me too!''s but adding the tag ala the quote is a tremendous temp fix till it's sorted! 🚀

@guilhas07
Copy link

Can't reproduce this problem with the current nightly version. When using nightly, make sure to update it frequently.

@MariaSolOs
Copy link
Contributor

Sorry for breaking you guys, but as @guilhas07, this shouldn't happen if you're using the tippy top of nightly!

@nifoc
Copy link

nifoc commented Oct 29, 2024

Sorry for breaking you guys, but as @guilhas07, this shouldn't happen if you're using the tippy top of nightly!

Thanks for clarifying.

I understand it's not your problem, but because of other changes nix/NixOS users can't update to the latest nightly atm.

@sinkr
Copy link

sinkr commented Oct 29, 2024

My LazyVim installation is just the default behavior; no version, tag, etc.

Whatever is going on shouldn't break default behavior.

@MariaSolOs
Copy link
Contributor

My LazyVim installation is just the default behavior; no version, tag, etc.

Whatever is going on shouldn't break default behavior.

I mean your Neovim version, not ibl version. Lazyvim doesn't install Neovim for you.

@MariaSolOs
Copy link
Contributor

I understand it's not your problem, but because of other changes nix/NixOS users can't update to the latest nightly atm.

@nifoc I didn't mean for my comment to sound as if "this isn't my problem", because it is. I didn't want to break anyone's setup but fix a deprecation in one of my favorite plugins.

This should only happen if you have nvim 0.11 (something after the latest release) installed but you're not keeping up to date with the latest nightly. If you're using any nvim version after the latest stable, it should be what's on master.

I do understand that this isn't always possible though, so I'll try to fix it later today after my day job.

@dzintars
Copy link

I personally don't mind to tag previous version until I will decide to rebuild my nightly. I'm just lazy today to do the build. :) So... no issue for me at least.

@nifoc
Copy link

nifoc commented Oct 29, 2024

I didn't mean for my comment to sound as if "this isn't my problem", because it is.

@MariaSolOs It absolutely didn't, sorry if my comment came across as "passive aggressive" - it absolutely wasn't intended to be.

I just wanted to add a comment for other Nix users that might come across this issue. The nightly overlay is currently stuck on a roughly two week old commit, because some changes in the way lpeg is built (on macOS only?) have to be adapted/worked around.

In no way do I expect you to find a workaround for this. "Normal" nightly users can just update to the latest commit and be done with it.

@dzintars
Copy link

Ok. So... on NVIM v0.11.0-dev-ff93ccc (latest) it works just fine. So... I think, tagging is fine as temporary solution for those who sit on nightly, but can't update it RN.

@MariaSolOs
Copy link
Contributor

@nifoc thank you for the clarification. I also apologize if I was a bit aggressive with my reply. I truly apologize for disrupting people's workflows and I'll do my best to address the people having issues.

Still glad to know that there's a workaround.

@lukas-reineke
Copy link
Owner

We maybe should have waited a bit with this until places like Nix are up to date, sorry about that. I don't use Nix, I wasn't aware of this issue.

But generally, only the latest nightly build is supported!

If you are using nightly, I would always recommend to only update plugins and Neovim together.
If you don't want to have to deal with issues like this, use stable Neovim instead.

@lukas-reineke lukas-reineke changed the title After upgrade to 3.8.3 config, an error occurs After upgrade to 3.8.3 config, an error occurs with old nightly Neovim versions Oct 30, 2024
mars90226 added a commit to mars90226/dotvim that referenced this issue Oct 30, 2024
Ref: [After upgrade to 3.8.3 config, an error occurs with old nightly Neovim versions · Issue 936 · lukas-reineke/indent-blankline.nvim](lukas-reineke/indent-blankline.nvim#936)
@MariaSolOs
Copy link
Contributor

MariaSolOs commented Oct 30, 2024

@lukas-reineke I again apologize for causing all this trouble 😅

Perhaps it would be a good idea to pin this issue for a bit? I can also create a PR to pcall vim.validate to have a better error message when this issue happens.

@lukas-reineke lukas-reineke pinned this issue Oct 30, 2024
@lukas-reineke
Copy link
Owner

It's not your fault, all good.
I pinned the issue. We don't need to change the code.

@mei28
Copy link
Author

mei28 commented Oct 30, 2024

Thank you for the discussion. I was able to resolve this issue. I'll wait for the nightly version update in Nix.

@lukas-reineke Should I close this issue, or would it be better to keep it open?

@lukas-reineke
Copy link
Owner

Let's keep it open until Nix is caught up with the nightly build.

@BigJayToDaIzo
Copy link

image
image

I was under the impression that the neovim-git AUR package was building off of nightly, but I pulled the tag out of the plugin table that was holding it back to it's 3.8.2 state and it's still tossing errors at me. So I guess Arch users are sitting right alongside Nix waiting on our package managers to get caught up.

@lukas-reineke
Copy link
Owner

lukas-reineke commented Oct 31, 2024

AUR -git packages don't work like normal packages. The version is not updated every time upstream changes, but when you build the package, it will download the latest version from GitHub.
You just need to explicitly install it again.

https://wiki.archlinux.org/title/Arch_User_Repository#What_is_the_difference_between_foo_and_foo-git_packages%3F

@BigJayToDaIzo
Copy link

BigJayToDaIzo commented Oct 31, 2024

AUR -git packages don't work like normal packages. ...
https://wiki.archlinux.org/title/Arch_User_Repository#What_is_the_difference_between_foo_and_foo-git_packages%3F

I've been using Arch and the AUR for over a year and was today years old when this nuance finally clicked, with your very astute assistance. 😁 Thank you for bridging the gap in my understanding! Great repo by the way! <3

EDIT: JUST incase someone gets back here and makes it this far, I found this incredibly helpful plugin so I can stop worrying about any package manager to grab the latest nightly for me. Now I'm just a :NVUpdateNeovim away! Impeccably documented.
image

https://github.com/rootiest/nvim-updater.nvim

akotro added a commit to akotro/nvim that referenced this issue Nov 1, 2024
commented out some indent_blankline config, waiting for lukas-reineke/indent-blankline.nvim#936
zidhuss added a commit to zidhuss/dotfiles that referenced this issue Nov 1, 2024
Tagging `indent-blankline.nvim` to a specific version to avoid error:
lukas-reineke/indent-blankline.nvim#936
@muhammadzkralla
Copy link

Is this fixed yet? If not, is there a temporary fix for it?

@mei28
Copy link
Author

mei28 commented Nov 1, 2024

@muhammadzkralla
A temporary fix way is to downgrade.

return {
  'lukas-reineke/indent-blankline.nvim',
  tag = 'v3.8.2',

@lukas-reineke lukas-reineke added wontfix This will not be worked on and removed bug Something isn't working labels Nov 2, 2024
@lukas-reineke
Copy link
Owner

Looks like Nix has fixed their issue NixOS/nixpkgs#351423

Everyone should be able to update now, so I'll close this.

TLDR for everyone seeing this later

Only Neovim stable, and the latest Neovim nightly build are supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests