Skip to content

Commit

Permalink
feat(ALL): stop support for Neovim 0.7
Browse files Browse the repository at this point in the history
fixup
  • Loading branch information
echasnovski committed Jun 22, 2024
1 parent a3f2746 commit 94db855
Show file tree
Hide file tree
Showing 74 changed files with 156 additions and 845 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Version 0.13.0.9000

- Stop official support of Neovim 0.7.

# Version 0.13.0

## mini.comment
Expand Down
3 changes: 0 additions & 3 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,6 @@ One of the main difficulties in testing Neovim plugins is verifying that somethi
Couple of caveats:

- As is apparent from use of `screenattr()`, these screenshots **can't tell how exactly cell is highlighted**, only **if two cells are highlighted the same**. This is due to the currently lacking functionality in Neovim itself. This might change in the future.
- Due to implementation details of `screenstring()` and `screenattr()` in Neovim<=0.7, this function won't recognize floating windows displayed on screen. It will throw an error if there is a visible floating window. Use Neovim>=0.8 (current nightly) to properly handle floating windows. Details:
- https://github.com/neovim/neovim/issues/19013
- https://github.com/neovim/neovim/pull/19020

To help manage testing screen state, there is a special `MiniTest.expect.reference_screenshot(screenshot, path, opts)` method. It takes screenshot table along with optional path of where to save this screenshot (if not supplied, inferred from test case description and put in 'tests/screenshots' directory). On first run it will automatically create reference screenshot at `path`. On later runs it will compare current screenshot with reference. Will throw informative error with helpful information if they don't match exactly.

Expand Down
1 change: 0 additions & 1 deletion doc/mini-clue.txt
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ Update description of an existing mapping
Notes:
- Uses buffer-local mapping in case there are both global and buffer-local
mappings with same mode and LHS. Similar to |maparg()|.
- Requires Neovim>=0.8.

Parameters ~
{mode} `(string)` Mapping mode (as in `maparg()`).
Expand Down
1 change: 0 additions & 1 deletion doc/mini-deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ Default: "mini-deps-snap" file in "config" standard path (see |stdpath()|).
`path.log` is a string with path containing log of operations done by module.
In particular, it contains all changes done after making an update.
Default: "mini-deps.log" file in "log" standard path (see |stdpath()|).
Note: In Neovim<0.8 it is in "data" standard path.

# Silent ~

Expand Down
2 changes: 0 additions & 2 deletions doc/mini-extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ Notes:
- "references".
- "type_definition".
- "workspace_symbol".
- Requires Neovim>=0.8.
- Directly relies on `vim.lsp.buf` methods which support |lsp-on-list-handler|.
In particular, it means that picker is started only if LSP server returns
list of locations and not a single location.
Expand Down Expand Up @@ -716,7 +715,6 @@ Tree-sitter nodes picker

Pick and navigate to |treesitter| nodes of current buffer.
Notes:
- Requires Neovim>=0.8.
- Requires active tree-sitter parser in the current buffer.

Parameters ~
Expand Down
3 changes: 0 additions & 3 deletions doc/mini-misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ What it does:
to it (using |chdir()|).
- Resets |autochdir| to `false`.

Note: requires |vim.fs| module (present in Neovim>=0.8).

Parameters ~
{names} `(table|function|nil)` Forwarded to |MiniMisc.find_root()|.
{fallback} `(function|nil)` Forwarded to |MiniMisc.find_root()|.
Expand All @@ -150,7 +148,6 @@ It is searched using |vim.fn.find()| with `upward = true` starting from
directory of current buffer file until first occurrence of root file(s).

Notes:
- Requires |vim.fs| module (present in Neovim>=0.8).
- Uses directory path caching to speed up computations. This means that no
changes in root directory will be detected after directory path was already
used in this function. Reload Neovim to account for that.
Expand Down
4 changes: 2 additions & 2 deletions doc/mini-pairs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ mapping (as string) it expects table with pair information:

Using this function instead of |nvim_set_keymap()| allows automatic
registration of pairs which will be recognized by `<BS>` and `<CR>`.
For Neovim>=0.7 it also infers mapping description from `pair_info`.
It also infers mapping description from `pair_info`.

Parameters ~
{mode} `(string)` `mode` for |nvim_set_keymap()|.
Expand All @@ -164,7 +164,7 @@ in |MiniPairs.map|.

Using this function instead of |nvim_buf_set_keymap()| allows automatic
registration of pairs which will be recognized by `<BS>` and `<CR>`.
For Neovim>=0.7 it also infers mapping description from `pair_info`.
It also infers mapping description from `pair_info`.

Parameters ~
{buffer} `(number)` `buffer` for |nvim_buf_set_keymap()|.
Expand Down
4 changes: 2 additions & 2 deletions doc/mini-statusline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ Default values:
use_icons = true,
-- Whether to set Vim's settings for statusline (make it always shown with
-- 'laststatus' set to 2). To use global statusline in Neovim>=0.7.0, set
-- this to `false` and 'laststatus' to 3.
-- 'laststatus' set to 2).
-- To use global statusline, set this to `false` and 'laststatus' to 3.
set_vim_settings = true,
}
<
Expand Down
6 changes: 0 additions & 6 deletions doc/mini-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,6 @@ This basically calls |screenstring()| and |screenattr()| for every visible
cell (row from 1 to 'lines', column from 1 to 'columns').

Notes:
- Due to implementation details of `screenstring()` and `screenattr()` in
Neovim<=0.7, this function won't recognize floating windows displayed on
screen. It will throw an error if there is a visible floating window. Use
Neovim>=0.8 (current nightly) to properly handle floating windows. Details:
- https://github.com/neovim/neovim/issues/19013
- https://github.com/neovim/neovim/pull/19020
- To make output more portable and visually useful, outputs of
`screenattr()` are coded with single character symbols. Those are taken from
94 characters (ASCII codes between 33 and 126), so there will be duplicates
Expand Down
2 changes: 0 additions & 2 deletions doc/mini.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,5 @@ Considering high number of different scenarios and customization intentions,
writing exact rules for module's buffer local configuration is left to
user. It is done in similar fashion to |mini.nvim-disabling-recipes|.

Note: using function values inside buffer variables requires Neovim>=0.7.


vim:tw=78:ts=8:noet:ft=help:norl:
9 changes: 0 additions & 9 deletions lua/mini/ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,6 @@ local H = {}
---
---@usage `require('mini.ai').setup({})` (replace `{}` with your `config` table)
MiniAi.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.ai) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniAi = MiniAi

Expand Down
9 changes: 0 additions & 9 deletions lua/mini/align.lua
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,6 @@ local H = {}
---
---@usage `require('mini.align').setup({})` (replace `{}` with your `config` table)
MiniAlign.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.align) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniAlign = MiniAlign

Expand Down
37 changes: 9 additions & 28 deletions lua/mini/animate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ local H = {}
---
---@usage `require('mini.animate').setup({})` (replace `{}` with your `config` table)
MiniAnimate.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.animate) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniAnimate = MiniAnimate

Expand Down Expand Up @@ -1364,7 +1355,7 @@ H.track_scroll_state_partial = function()
-- a proper state tracking
if H.cache.scroll_is_active then return end

H.cache.scroll_state.cursor = { line = vim.fn.line('.'), virtcol = H.virtcol('.') }
H.cache.scroll_state.cursor = { line = vim.fn.line('.'), virtcol = vim.fn.virtcol('.') }
end

H.on_cmdline_leave = function()
Expand Down Expand Up @@ -1446,7 +1437,7 @@ end

H.get_cursor_state = function()
-- Use virtual column to respect position outside of line width and tabs
return { buf_id = vim.api.nvim_get_current_buf(), pos = { vim.fn.line('.'), H.virtcol('.') } }
return { buf_id = vim.api.nvim_get_current_buf(), pos = { vim.fn.line('.'), vim.fn.virtcol('.') } }
end

H.draw_cursor_mark = function(line, virt_col, buf_id)
Expand Down Expand Up @@ -1610,7 +1601,7 @@ H.get_scroll_state = function()
buf_id = vim.api.nvim_get_current_buf(),
win_id = vim.api.nvim_get_current_win(),
view = vim.fn.winsaveview(),
cursor = { line = vim.fn.line('.'), virtcol = H.virtcol('.') },
cursor = { line = vim.fn.line('.'), virtcol = vim.fn.virtcol('.') },
scrolloff = H.cache.scroll_is_active and H.cache.scroll_state.scrolloff or vim.wo.scrolloff,
virtualedit = H.cache.scroll_is_active and H.cache.scroll_state.virtualedit or vim.wo.virtualedit,
}
Expand Down Expand Up @@ -2133,24 +2124,14 @@ end

H.convex_point = function(x, y, coef) return H.round((1 - coef) * x + coef * y) end

-- `virtcol2col()` is only present in Neovim>=0.8. Earlier Neovim versions will
-- have troubles dealing with multibyte characters and tabs.
if vim.fn.exists('*virtcol2col') == 1 then
H.virtcol2col = function(line, virtcol)
local col = vim.fn.virtcol2col(0, line, virtcol)

-- Current for virtual column being outside of line's last virtual column
local virtcol_past_lineend = vim.fn.virtcol({ line, '$' })
if virtcol_past_lineend <= virtcol then col = col + virtcol - virtcol_past_lineend + 1 end

return col
end
H.virtcol2col = function(line, virtcol)
local col = vim.fn.virtcol2col(0, line, virtcol)

H.virtcol = vim.fn.virtcol
else
H.virtcol2col = function(_, col) return col end
-- Current for virtual column being outside of line's last virtual column
local virtcol_past_lineend = vim.fn.virtcol({ line, '$' })
if virtcol_past_lineend <= virtcol then col = col + virtcol - virtcol_past_lineend + 1 end

H.virtcol = vim.fn.col
return col
end

H.is_select_mode = function() return ({ s = true, S = true, ['\19'] = true })[vim.fn.mode()] end
Expand Down
33 changes: 11 additions & 22 deletions lua/mini/base16.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,6 @@ local H = {}
---@usage `require('mini.base16').setup({})` (replace `{}` with your `config`
--- table; `config.palette` should be a table with colors)
MiniBase16.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.base16) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniBase16 = MiniBase16

Expand Down Expand Up @@ -640,19 +631,17 @@ H.apply_palette = function(palette, use_cterm)
hi('LspCodeLensSeparator', {link='Comment'})

-- Tree-sitter
if vim.fn.has('nvim-0.8') == 1 then
-- Sources:
-- - `:h treesitter-highlight-groups`
-- - https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights
-- Included only those differing from default links
hi('@keyword.return', {fg=p.base08, bg=nil, attr=nil, sp=nil})
hi('@symbol', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
hi('@variable', {fg=p.base05, bg=nil, attr=nil, sp=nil})

hi('@text.strong', {fg=nil, bg=nil, attr='bold', sp=nil})
hi('@text.emphasis', {fg=nil, bg=nil, attr='italic', sp=nil})
hi('@text.strike', {fg=nil, bg=nil, attr='strikethrough', sp=nil})
end
-- Sources:
-- - `:h treesitter-highlight-groups`
-- - https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights
-- Included only those differing from default links
hi('@keyword.return', {fg=p.base08, bg=nil, attr=nil, sp=nil})
hi('@symbol', {fg=p.base0E, bg=nil, attr=nil, sp=nil})
hi('@variable', {fg=p.base05, bg=nil, attr=nil, sp=nil})

hi('@text.strong', {fg=nil, bg=nil, attr='bold', sp=nil})
hi('@text.emphasis', {fg=nil, bg=nil, attr='italic', sp=nil})
hi('@text.strike', {fg=nil, bg=nil, attr='strikethrough', sp=nil})

-- Semantic tokens
if vim.fn.has('nvim-0.9') == 1 then
Expand Down
9 changes: 0 additions & 9 deletions lua/mini/basics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,6 @@ local H = {}
---
---@usage `require('mini.basics').setup({})` (replace `{}` with your `config` table)
MiniBasics.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.basics) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniBasics = MiniBasics

Expand Down
11 changes: 1 addition & 10 deletions lua/mini/bracketed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@ local H = {}
---
---@usage `require('mini.bracketed').setup({})` (replace `{}` with your `config` table)
MiniBracketed.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.bracketed) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniBracketed = MiniBracketed

Expand Down Expand Up @@ -1824,7 +1815,7 @@ end
-- Treesitter -----------------------------------------------------------------
if vim.fn.has('nvim-0.9') == 1 then
H.get_treesitter_node = function(row, col) return vim.treesitter.get_node({ pos = { row, col } }) end
elseif vim.fn.has('nvim-0.8') == 1 then
else
H.get_treesitter_node = function(row, col) return vim.treesitter.get_node_at_pos(0, row, col, {}) end
end

Expand Down
9 changes: 0 additions & 9 deletions lua/mini/bufremove.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ local H = {}
---
---@usage `require('mini.bufremove').setup({})` (replace `{}` with your `config` table)
MiniBufremove.setup = function(config)
-- TODO: Remove after Neovim<=0.7 support is dropped
if vim.fn.has('nvim-0.8') == 0 then
vim.notify(
'(mini.bufremove) Neovim<0.8 is soft deprecated (module works but not supported).'
.. ' It will be deprecated after next "mini.nvim" release (module might not work).'
.. ' Please update your Neovim version.'
)
end

-- Export module
_G.MiniBufremove = MiniBufremove

Expand Down
Loading

0 comments on commit 94db855

Please sign in to comment.