Skip to content

Commit

Permalink
chore: add compatibility layer for nvim API deprecated in nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 3, 2024
1 parent aae1f89 commit 071cbe8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.3] - 2024-05-04
### Changed
- Add compatibility layers for Neovim API that has been
deprecated in Neovim nightly.

## [1.0.2] - 2024-02-29
### Fixed
- Remove `vim.print` statement.

## [1.0.2] - 2024-02-29
### Fixed
- Remove `vim.print` statement.
Expand Down
16 changes: 8 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@
type-check-nightly = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
lua-ls.enable = true;
};
settings = {
lua-ls.config = luarc-nightly;
lua-ls = {
enable = true;
settings.configuration = luarc-nightly;
};
};
};

type-check-stable = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
lua-ls.enable = true;
};
settings = {
lua-ls.config = luarc-stable;
lua-ls = {
enable = true;
settings.configuration = luarc-stable;
};
};
};

Expand Down
5 changes: 5 additions & 0 deletions lua/telescope-manix/compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ compat.system = vim.system
return systemObj
end

---@type fun(tbl:table):table
compat.tbl_flatten = vim.iter and function(tbl)
return vim.iter(tbl):flatten():totable()
end or vim.tbl_flatten

return compat
2 changes: 1 addition & 1 deletion lua/telescope-manix/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ local manix = {}
local function mk_manix_cmd(opts)
local search_arg = opts.cword and vim.fn.expand("<cword>") or ""
local args = opts.manix_args or {}
return vim.tbl_flatten({ "manix", search_arg, args })
return compat.tbl_flatten({ "manix", search_arg, args })
end

---@param str string
Expand Down

0 comments on commit 071cbe8

Please sign in to comment.