doom-neovim / doom-nvim

A Neovim configuration for the advanced martian hacker
GNU General Public License v2.0
1.01k stars 107 forks source link

[BUG] Update minimum neovim version to 0.7 #375

Closed connorgmeehan closed 2 years ago

connorgmeehan commented 2 years ago

Current Behavior:

User can use neovim <= 0.6 which is unsupported.

Expected Behavior:

Doom-nvim should warn user if they're using an unsupported neovim version. The install script should also warn user if they need to update.

Steps To Reproduce:

Logs

Check Health Output
Doom Report Output

Anything else:

edwintorok commented 2 years ago

This is how it fails on Ubuntu 22.04 with Neovim v0.6.1

E5113: Error while calling lua chunk: /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:152: attempt to index field 'keymap' (a nil value)
stack traceback:
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:152: in function 'handler'
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:196: in function 'traverse'
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:172: in function 'traverse'
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:200: in function 'traverse'
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:172: in function 'traverse'
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:200: in function 'traverse'
    /home/edwin/.config/nvim/lua/doom/services/keymaps.lua:221: in function 'applyKeymaps'
    /home/edwin/.config/nvim/lua/doom/core/modules.lua:149: in function 'load_modules'
    /home/edwin/.config/nvim/lua/doom/core/init.lua:58: in main chunk
    [C]: in function 'require'
    /home/edwin/.config/nvim/init.lua:24: in main chunk%

The latest version available in a released version of Ubuntu is 0.6.1: https://packages.ubuntu.com/search?keywords=neovim&searchon=names&suite=all&section=all

Ubuntu 22.10 will have 0.7.2, but that obviously isn't released yet, so it'd be nice if doom-nvim could be made to work with 0.6.x for a little while longer. (Some other distributions like Fedora 36 do have Neovim 0.7 available though).

As a workaround newer versions of Neovim can be installed from a PPA: https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable

connorgmeehan commented 2 years ago

This has been resolved in commit https://github.com/NTBBloodbath/doom-nvim/commit/ec17813cd89eaf9c4dd4e09f1c006b59c57ff455 and https://github.com/NTBBloodbath/doom-nvim/commit/94ca0100d4a43d384fb77cbbfdbf27541689ee14. Just repeating the relevant part of my comment on #370, I tried adding backwards compatibility but too many plugins require v0.7.0 right now and I don't think it will be feasible to maintain backwards compatibility on these versions. I did, however, improve the messaging when users are running an incompatible nvim version and link to a update guide in docs if there is an issue.

I think in the future it could be cool to modify the modules api to define packages like the following but it would be very unreliable and difficult to make sure everything's working. My goal right now is to make the current stable neovim version work without error and not spread ourselves too thin.

  ["nvim-cmp"] = {
    "hrsh7th/nvim-cmp",
    commit = {
      ["latest"] = "706371f1300e7c0acb98b346f80dad2dd9b5f679", -- Only if neovim meets default requirements in `lua/init.lua`
      ["0.6.0"] = { commit = "other commit" }, -- Fallback until a compatible neovim version is found
      ["0.5.0"] = { branch = "v0.5_branch", commit = "other commit" }
    },
    requires = {
      "L3MON4D3/LuaSnip",
      commit = "53e812a6f51c9d567c98215733100f0169bcc20a",
      module = "luasnip",
    },
  },