Skip to content

Commit 4676712

Browse files
committed
chore: Remove support for NeoVim 0.9
Generally, we maintain a policy of the current stable version and the one before.
1 parent 541e8f1 commit 4676712

File tree

8 files changed

+10
-55
lines changed

8 files changed

+10
-55
lines changed

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
fail-fast: false
6161
matrix:
6262
os: [ubuntu-latest, macos-latest]
63-
neovim_branch: ["v0.9.5", "stable", "nightly"]
63+
neovim_branch: ["v0.10.4", "stable", "nightly"]
6464

6565
steps:
6666
- uses: actions/checkout@v4

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ the NeoVim generation. It:
6565

6666
## Installation
6767

68-
**Requires NeoVim 0.9+.**
68+
**Requires NeoVim 0.10+.**
6969

7070
Example for [`lazy.nvim`](https://github.com/folke/lazy.nvim):
7171

@@ -76,8 +76,7 @@ return {
7676
-- opts = { … },
7777

7878
dependencies = {
79-
"echasnovski/mini.nvim" -- Needed for :ToggleCommentDebugPrints(NeoVim 0.9 only)
80-
-- and line highlighting (optional)
79+
"echasnovski/mini.nvim" -- Needed for line highlighting (optional)
8180
},
8281

8382
lazy = false, -- Required to make line highlighting work before debugprint is first used

lazy.lua

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
local spec = {
1+
return {
22
url = "https://github.com/andrewferrier/debugprint.nvim",
33
}
4-
5-
if vim.fn.has("nvim-0.10") == 0 then
6-
-- Mini is needed to enable :ToggleCommentDebugPrints for NeoVim 0.9
7-
--
8-
-- It's also needed to enable line highlighting, but since this is an
9-
-- optional cosmetic extra only, we're not going to include it here so it's
10-
-- not forced on the user.
11-
12-
spec.dependencies = {
13-
"echasnovski/mini.nvim",
14-
}
15-
end
16-
17-
return spec

lua/debugprint/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ M.add_custom_filetypes = function(filetypes)
423423
vim.tbl_deep_extend("force", global_opts.filetypes, filetypes)
424424
end
425425

426-
if vim.fn.has("nvim-0.9.0") ~= 1 then
426+
if vim.fn.has("nvim-0.10.0") ~= 1 then
427427
vim.notify_once(
428-
"WARNING: debugprint.nvim is only compatible with NeoVim 0.9+",
428+
"WARNING: debugprint.nvim is only compatible with NeoVim 0.10+",
429429
vim.log.levels.WARN
430430
)
431431

lua/debugprint/utils/buffer.lua

+3-19
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,9 @@ end
5151
---@param line integer
5252
---@return nil
5353
M.toggle_comment_line = function(line)
54-
if vim.fn.has("nvim-0.10.0") == 1 then
55-
local pos = vim.api.nvim_win_get_cursor(0)
56-
vim.api.nvim_cmd(
57-
{ range = { line }, cmd = "normal", args = { "gcc" } },
58-
{}
59-
)
60-
vim.api.nvim_win_set_cursor(0, pos)
61-
else
62-
local status, comment = pcall(require, "mini.comment")
63-
64-
if status == true then
65-
comment.toggle_lines(line, line, {})
66-
else
67-
vim.notify_once(
68-
"mini.nvim is required to toggle comment debugprint lines prior to NeoVim 0.10",
69-
vim.log.levels.ERROR
70-
)
71-
end
72-
end
54+
local pos = vim.api.nvim_win_get_cursor(0)
55+
vim.api.nvim_cmd({ range = { line }, cmd = "normal", args = { "gcc" } }, {})
56+
vim.api.nvim_win_set_cursor(0, pos)
7357
end
7458

7559
---@return string|false|nil

lua/debugprint/utils/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ M.get_effective_filetypes = function()
8989

9090
local filetypes = vim.treesitter.language.get_filetypes(treesitter_lang)
9191
-- The order in which filetypes are provided seems to be semi-random
92-
-- (esp on NeoVim 0.9.5) so we are sorting them to at least give some
92+
-- (at least prior to v0.10) so we are sorting them to at least give some
9393
-- stability.
9494
table.sort(filetypes)
9595
assert(vim.tbl_count(filetypes) > 0)

tests/debugprint.lua

-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ vim.opt.runtimepath:prepend(
88
)
99
vim.opt.runtimepath:prepend("../nvim-treesitter")
1010

11-
if vim.fn.has("nvim-0.10.0") == 0 then
12-
vim.opt.runtimepath:prepend(
13-
vim.fn.stdpath("data") .. "/site/pack/vendor/start/mini.nvim"
14-
)
15-
vim.opt.runtimepath:prepend("../mini.nvim")
16-
end
17-
1811
vim.cmd("runtime! plugin/nvim-treesitter.lua")
1912

2013
local install_parser_if_needed = function(filetype)

tests/run.lua

-7
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,4 @@ vim.opt.runtimepath:append(
33
)
44
vim.opt.runtimepath:append("../plenary.nvim")
55

6-
if vim.fn.has("nvim-0.10.0") ~= 1 then
7-
vim.opt.runtimepath:append(
8-
"~/.local/share/nvim/site/pack/vendor/start/mini.nvim"
9-
)
10-
vim.opt.runtimepath:append("../mini.nvim")
11-
end
12-
136
require("plenary.test_harness").test_file("tests/debugprint.lua")

0 commit comments

Comments
 (0)