nvimdots icon indicating copy to clipboard operation
nvimdots copied to clipboard

[migration] Nvim 0.8 Support

Open Jint-lzxy opened this issue 3 years ago • 10 comments

NeoVim 0.8 stable was released two days ago and introduced tons of changes, which would cause multiple plugins to have outdated configurations. However, changing these configurations (or adding new features) will certainly affect users who do not have the ability to update to version 0.8 (e.g., Treesitter [nvim-treesitter/nvim-treesitter#3365], Lspsaga [*#241]). Therefore, we may need to provide two simultaneously maintained configuration files. The current proposal is as follows:

  • File Hierarchy:
[BRANCH] main/
├── .github
├── .gitignore
├── latest/
│   └── lua/
│       └── [[V0.8 Specific / Latest Configs]]
├── legacy/
│   └── lua/
│       └── [[Backward Compatibility]]
├── LICENSE
├── README.md
├── format_disabled_dirs.txt
├── init.lua
└── stylua.toml
  • init.lua (at root)
local init_path = debug.getinfo(1, "S").source:sub(2)
local base_dir = init_path:match("(.*[/\\])"):sub(1, -2)

local function append_rtp(dir)
	if not vim.tbl_contains(vim.opt.rtp:get(), dir) then
		vim.opt.rtp:append(dir)
	end
end

if not vim.g.vscode then
	if vim.version().minor < 8 then -- neovim 0.7 or lower compatibility
		append_rtp(base_dir .. "/legacy")
	else
		append_rtp(base_dir .. "/latest")
	end

	require("core")
end

Besides, many plugins have provided new features specific to 0.8 (such as the generic highlight method of Treesitter and Symbol in Winbar of Lspsaga). Some changes are necessary since they would lead to incorrect behavior (such as the highlight of catppuccin), while others are optional (such as clickable widgets of dapui). This will be collected and discussed below.

  • MANDATORY CHANGES

    • [x] Highlight integration for catppuccin <==> https://github.com/ayamir/nvimdots/pull/243
    • [x] #251
    • [x] #250 <==> https://github.com/ayamir/nvimdots/pull/252
    • [ ] #248
  • NEW FEATURES

    • [x] Symbol in Winbar for lspsaga <==> https://github.com/ayamir/nvimdots/commit/f11d867c831ce26326d4d4a6ff4e2ef2158872fc
    • [x] Control widgets of dapui <==> https://github.com/ayamir/nvimdots/pull/244
    • [x] Refactor install script <==> https://github.com/ayamir/nvimdots/pull/245

@ayamir Shall we discuss the feasibility of the current proposal and make changes when appropriate?

Jint-lzxy avatar Oct 02 '22 08:10 Jint-lzxy

I prefer to use different branches to do this, then 0.8 will be merged into main. Because 0.7 or 0.8 or even 0.9 will be legacy, maintaining all of their specific configs is unrealistic, We'd better keep config with latest nvim version.

ayamir avatar Oct 02 '22 10:10 ayamir

In fact, I encountered some minor problems with 8.0 branch, for example: lualine often refreshes when the cursor moves, and I noticed that when it refreshes, it shows the gps information provided by lspsaga.

jczhang02 avatar Oct 03 '22 06:10 jczhang02

In fact, I encountered some minor problems with 8.0 branch, for example: lualine often refreshes when the cursor moves, and I noticed that when it refreshes, it shows the gps information provided by lspsaga.

My fault, fixed at a48a36df5903f815607a280c27403b933f5a4037

ayamir avatar Oct 03 '22 06:10 ayamir

In fact, I encountered some minor problems with 8.0 branch, for example: lualine often refreshes when the cursor moves, and I noticed that when it refreshes, it shows the gps information provided by lspsaga.

My fault, fixed at a48a36d

It works fine now! Thanks for ayamir's effort!

jczhang02 avatar Oct 03 '22 07:10 jczhang02

Sorry, one more question. I found that configuration in branch 0.8 will cause the problem that:

There is a noticeable stutter in the cursor movement, probably due to some configuration slowing it down. In contrast, with the previous configuration there is no such feeling at all.This would be an important issue.

jczhang02 avatar Oct 05 '22 13:10 jczhang02

Maybe it caused by lspsaga symbol method. link

jczhang02 avatar Oct 05 '22 13:10 jczhang02

@jczhang02 It seems like there is a problem with upstream support for Winbar. Current suggestion is to temporarily disable related features 😕.

Jint-lzxy avatar Oct 06 '22 06:10 Jint-lzxy

@Jint-lzxy Have u experienced this issue?

jczhang02 avatar Oct 06 '22 07:10 jczhang02

yep, everything went fine after I switched to navic again 👍 . @jczhang02

Jint-lzxy avatar Oct 06 '22 07:10 Jint-lzxy

I think maybe it's time to merge 0.8 into main, the rest of new options is less important, and our commits for 0.8 will bring a lot of exciting features and bug fix.

ayamir avatar Oct 11 '22 10:10 ayamir

We're all set 🎉

Jint-lzxy avatar Oct 22 '22 15:10 Jint-lzxy

@Jint-lzxy Have u encounted the problem that metioned in comment.

jczhang02 avatar Oct 22 '22 16:10 jczhang02