Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b3bd6c013 | |||
31c40573db | |||
9cc5d3df50 | |||
6761d8efc8 | |||
0d05715411 | |||
dd5a5fb4cd | |||
9f98b0a01e | |||
b74db85447 | |||
c155b2e965 | |||
6a07e6522a | |||
26254487fb | |||
f9697cbf17 | |||
7eac9a854b | |||
4947802191 | |||
60d472a569 | |||
252197f659 | |||
e29ad4a14e | |||
1b34b481c8 | |||
bedeb66fa9 |
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,15 +0,0 @@
|
||||
## What is this PR for?
|
||||
|
||||
<!-- Describe the big picture of your changes to communicate to the maintainers
|
||||
why we should accept this pull request. -->
|
||||
|
||||
## Does this PR fix an existing issue?
|
||||
|
||||
<!--
|
||||
If this PR fixes any issues, please link to the issue here.
|
||||
Fixes #<issue_number>
|
||||
-->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
|
42
CHANGELOG.md
42
CHANGELOG.md
@ -1,47 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## [12.12.0](https://github.com/LazyVim/LazyVim/compare/v12.11.0...v12.12.0) (2024-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **extras:** added fzf-lua ([#3555](https://github.com/LazyVim/LazyVim/issues/3555)) ([6ab4041](https://github.com/LazyVim/LazyVim/commit/6ab404134db6004aab13dcf956e200ff063b2d42))
|
||||
* **fzf:** better scrollbars ([8bb6538](https://github.com/LazyVim/LazyVim/commit/8bb653876c38518e4befb496b78659e76ed7afee))
|
||||
* **fzf:** ignore current line for some lsp pickers ([c481861](https://github.com/LazyVim/LazyVim/commit/c4818616d541e4456850d1982be39b8151bd0f2a))
|
||||
* **fzf:** prettier document symbols ([ba3aec7](https://github.com/LazyVim/LazyVim/commit/ba3aec7b4876e36a9f9fd3cce1d204c23c0fe24f))
|
||||
* **lualine:** show readonly icon ([#3567](https://github.com/LazyVim/LazyVim/issues/3567)) ([21617a9](https://github.com/LazyVim/LazyVim/commit/21617a9d602f2400c8e9813490958e106cb88ca8))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **dap:** set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577) ([9b8a393](https://github.com/LazyVim/LazyVim/commit/9b8a393edc8b9a12a39f712163f6476c084a7f71))
|
||||
* **extras.copilot-chat:** small ui fix for which-key in visual mode ([#3573](https://github.com/LazyVim/LazyVim/issues/3573)) ([43afed1](https://github.com/LazyVim/LazyVim/commit/43afed121195df6591d0e941b913b98f849c8af3))
|
||||
* **fzf:** lowercase symbols ([d1d24fa](https://github.com/LazyVim/LazyVim/commit/d1d24fa077add680bc532e08fd68aaa0841a14dc))
|
||||
* **neo-tree:** use last window for preview ([#3560](https://github.com/LazyVim/LazyVim/issues/3560)) ([caaa6c4](https://github.com/LazyVim/LazyVim/commit/caaa6c440d5c3b80c03cad1dfd93989b852bb875))
|
||||
* **php:** formatting and linting ([#3540](https://github.com/LazyVim/LazyVim/issues/3540)) ([f5dc867](https://github.com/LazyVim/LazyVim/commit/f5dc867ac29e31f833442006ebe3daf7540d1f69))
|
||||
* **pick:** recent files in cwd. Fixes [#3580](https://github.com/LazyVim/LazyVim/issues/3580) ([d541069](https://github.com/LazyVim/LazyVim/commit/d541069fdffcf5ffaf2a7f161fd87bb68094c8cf))
|
||||
* **sql:** make sure edgebars exist. Fixes [#3578](https://github.com/LazyVim/LazyVim/issues/3578) ([bd29f45](https://github.com/LazyVim/LazyVim/commit/bd29f4515307f59437995d5cc0ba601eb02b5baa))
|
||||
* **util:** ensure unique cache keys in LazyVim.memoize ([#3576](https://github.com/LazyVim/LazyVim/issues/3576)) ([3354872](https://github.com/LazyVim/LazyVim/commit/335487282a128d6df7ea021a75b31f07a2b9ccfd))
|
||||
|
||||
## [12.11.0](https://github.com/LazyVim/LazyVim/compare/v12.10.0...v12.11.0) (2024-06-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **octo:** re-open octo windows when restoring session + cleanup ([7793942](https://github.com/LazyVim/LazyVim/commit/7793942ebafd32ef90f79e28979898f8013976ff))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **extra-lang-angular:** add BufNew event to attach angular treesitter ([#3522](https://github.com/LazyVim/LazyVim/issues/3522)) ([fbb1276](https://github.com/LazyVim/LazyVim/commit/fbb1276ffd45683d4d64a2d99907bdbd3421c16f))
|
||||
* **extras:** +prefix in which-key panel for visual mode ([#3537](https://github.com/LazyVim/LazyVim/issues/3537)) ([5185404](https://github.com/LazyVim/LazyVim/commit/51854046dbb0bacf690ddc217cc76bf98c8ec1aa))
|
||||
* **helm:** missing dependency ([#3546](https://github.com/LazyVim/LazyVim/issues/3546)) ([02dd65c](https://github.com/LazyVim/LazyVim/commit/02dd65cdea1ae34cdf4ca00b20760dbb3cfcd72b))
|
||||
* **lang:** neotest not loading rust tests ([#3544](https://github.com/LazyVim/LazyVim/issues/3544)) ([0567b37](https://github.com/LazyVim/LazyVim/commit/0567b37f61d5ad997793b950c38a6c8f73de3b9b))
|
||||
* **luasnip:** disable nvim-snippets when luasnip is enabled. Fixes [#3547](https://github.com/LazyVim/LazyVim/issues/3547) ([aa059e0](https://github.com/LazyVim/LazyVim/commit/aa059e0d496e570f898644d3f18bc344ca179d38))
|
||||
* **rust:** make neotest optional ([547dc76](https://github.com/LazyVim/LazyVim/commit/547dc76a12309d4dafc970ae08832140eae51cba))
|
||||
* **typescript:** clean up configuration of the vscode dap extension ([#3556](https://github.com/LazyVim/LazyVim/issues/3556)) ([1c46f54](https://github.com/LazyVim/LazyVim/commit/1c46f544328b084753327a81b92e2b57ab568321))
|
||||
* **typescript:** implemented move to new file. Fixes [#3534](https://github.com/LazyVim/LazyVim/issues/3534) ([d90930b](https://github.com/LazyVim/LazyVim/commit/d90930b13e4515a5f4e4f3892ac9f7c392c4f20c))
|
||||
|
||||
## [12.10.0](https://github.com/LazyVim/LazyVim/compare/v12.9.0...v12.10.0) (2024-06-07)
|
||||
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
# Contributing to LazyVim
|
||||
|
||||
## General Guidelines
|
||||
|
||||
- Avoid using Vim plugins whenever possible.
|
||||
- If an extra requires a Vim plugin, explain why in the PR description.
|
||||
- Ensure all configurations are overridable by the user, using Lazy's specs.
|
||||
- Tag specs as `optional` if they should only be enabled when the user has them installed.
|
||||
- Implement proper lazy-loading for every plugin added in an extra.
|
||||
- Understand how Lazy's dependencies work. For Lua dependencies, do not specify
|
||||
them in the `dependencies` field. Instead, add them as a separate spec with `lazy=true`.
|
||||
|
||||
## Contributing an Extra Plugin
|
||||
|
||||
- The plugin should be well-known and require significant configuration.
|
||||
- Simple specs containing just the plugin with some options will not be accepted.
|
||||
|
||||
## Contributing an Extra Language
|
||||
|
||||
- You should be familiar with the language you are adding.
|
||||
- You should have experience with the language's ecosystem, including formatters,
|
||||
linters, and LSP servers.
|
||||
- The extra should include the setup most widely used by the community.
|
||||
- Include Tree-sitter parsers that are not yet the default.
|
||||
- Include the most widely used LSP server setup.
|
||||
- Avoid the need for LSP wrapper packages whenever possible.
|
||||
- Only add a formatter if it is typically used by the community instead of the LSP formatter.
|
||||
- Only add extra linters if the community typically uses them instead of just the LSP linters.
|
||||
- Every language extra requires a `recommended` section as part of the extra.
|
||||
Check lspconfig server configurations for the proper filetypes and root directories.
|
||||
Refer to other extras for creating the `recommended` section.
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 11
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 09
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -89,7 +89,6 @@ return {
|
||||
end,
|
||||
desc = "Open with System Application",
|
||||
},
|
||||
["P"] = { "toggle_preview", config = { use_float = false } },
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
@ -190,7 +189,7 @@ return {
|
||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||
{ "<leader>fR", LazyVim.pick("oldfiles"), desc = "Recent (cwd)" },
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Status" },
|
||||
@ -471,7 +470,7 @@ return {
|
||||
"folke/todo-comments.nvim",
|
||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||
event = "LazyFile",
|
||||
opts = {},
|
||||
config = true,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
|
||||
|
@ -22,7 +22,7 @@ return {
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>a", "", desc = "+ai", mode = { "n", "v" } },
|
||||
{ "<leader>a", "", desc = "+ai" },
|
||||
{
|
||||
"<leader>aa",
|
||||
function()
|
||||
|
@ -66,14 +66,6 @@ return {
|
||||
|
||||
return vim.tbl_deep_extend("force", opts, defaults, {
|
||||
fzf_colors = true,
|
||||
fzf_opts = {
|
||||
["--no-scrollbar"] = true,
|
||||
},
|
||||
winopts = {
|
||||
preview = {
|
||||
scrollchars = { "┃", "" },
|
||||
},
|
||||
},
|
||||
files = {
|
||||
cwd_prompt = false,
|
||||
actions = {
|
||||
@ -88,17 +80,6 @@ return {
|
||||
["alt-h"] = { actions.toggle_hidden },
|
||||
},
|
||||
},
|
||||
lsp = {
|
||||
symbols = {
|
||||
symbol_hl = function(s)
|
||||
return "TroubleIcon" .. s
|
||||
end,
|
||||
symbol_fmt = function(s)
|
||||
return s:lower() .. "\t"
|
||||
end,
|
||||
child_prefix = false,
|
||||
},
|
||||
},
|
||||
formatters = {
|
||||
path = {
|
||||
hl = {
|
||||
@ -135,7 +116,7 @@ return {
|
||||
{ "<leader>fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fg", "<cmd>FzfLua git_files<cr>", desc = "Find Files (git-files)" },
|
||||
{ "<leader>fr", "<cmd>FzfLua oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
|
||||
{ "<leader>fR", LazyVim.pick("oldfiles", { root = false }), desc = "Recent (cwd)" },
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>FzfLua git_commits<CR>", desc = "Commits" },
|
||||
{ "<leader>gs", "<cmd>FzfLua git_status<CR>", desc = "Status" },
|
||||
@ -198,12 +179,16 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function()
|
||||
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
-- stylua: ignore
|
||||
vim.list_extend(Keys, {
|
||||
{ "gd", "<cmd>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto Definition", has = "definition" },
|
||||
{ "gr", "<cmd>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<cr>", desc = "References", nowait = true },
|
||||
{ "gI", "<cmd>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto Implementation" },
|
||||
{ "gy", "<cmd>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<cr>", desc = "Goto T[y]pe Definition" },
|
||||
{
|
||||
"gd",
|
||||
"<cmd>FzfLua lsp_definitions jump_to_single_result=true<cr>",
|
||||
desc = "Goto Definition",
|
||||
has = "definition",
|
||||
},
|
||||
{ "gr", "<cmd>FzfLua lsp_references jump_to_single_result=true<cr>", desc = "References", nowait = true },
|
||||
{ "gI", "<cmd>FzfLua lsp_implementations jump_to_single_result=true<cr>", desc = "Goto Implementation" },
|
||||
{ "gy", "<cmd>FzfLua lsp_typedefs jump_to_single_result=true<cr>", desc = "Goto T[y]pe Definition" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
@ -1,6 +1,14 @@
|
||||
return {
|
||||
"echasnovski/mini.files",
|
||||
opts = {
|
||||
mappings = {
|
||||
toggle_hidden = "g.",
|
||||
change_cwd = "gc",
|
||||
go_in_horizontal = "<C-w>s",
|
||||
go_in_vertical = "<C-w>v",
|
||||
go_in_horizontal_plus = "<C-w>S",
|
||||
go_in_vertical_plus = "<C-w>V",
|
||||
},
|
||||
windows = {
|
||||
preview = true,
|
||||
width_focus = 30,
|
||||
@ -82,22 +90,17 @@ return {
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
opts.mappings and opts.mappings.toggle_hidden or "g.",
|
||||
opts.mappings.toggle_hidden,
|
||||
toggle_dotfiles,
|
||||
{ buffer = buf_id, desc = "Toggle hidden files" }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
opts.mappings and opts.mappings.change_cwd or "gc",
|
||||
files_set_cwd,
|
||||
{ buffer = args.data.buf_id, desc = "Set cwd" }
|
||||
)
|
||||
vim.keymap.set("n", opts.mappings.change_cwd, files_set_cwd, { buffer = args.data.buf_id, desc = "Set cwd" })
|
||||
|
||||
map_split(buf_id, opts.mappings and opts.mappings.go_in_horizontal or "<C-w>s", "horizontal", false)
|
||||
map_split(buf_id, opts.mappings and opts.mappings.go_in_vertical or "<C-w>v", "vertical", false)
|
||||
map_split(buf_id, opts.mappings and opts.mappings.go_in_horizontal_plus or "<C-w>S", "horizontal", true)
|
||||
map_split(buf_id, opts.mappings and opts.mappings.go_in_vertical_plus or "<C-w>V", "vertical", true)
|
||||
map_split(buf_id, opts.mappings.go_in_horizontal, "horizontal", false)
|
||||
map_split(buf_id, opts.mappings.go_in_vertical, "vertical", false)
|
||||
map_split(buf_id, opts.mappings.go_in_horizontal_plus, "horizontal", true)
|
||||
map_split(buf_id, opts.mappings.go_in_vertical_plus, "vertical", true)
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -123,7 +123,7 @@ return {
|
||||
if not dap.adapters["codelldb"] then
|
||||
require("dap").adapters["codelldb"] = {
|
||||
type = "server",
|
||||
host = "127.0.0.1",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "codelldb",
|
||||
|
@ -121,7 +121,7 @@ return {
|
||||
},
|
||||
{
|
||||
"leoluz/nvim-dap-go",
|
||||
opts = {},
|
||||
config = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -104,7 +104,7 @@ return {
|
||||
port = 5005,
|
||||
args = {},
|
||||
projectRoot = vim.fn.getcwd,
|
||||
hostName = "127.0.0.1",
|
||||
hostName = "localhost",
|
||||
timeout = 2000,
|
||||
},
|
||||
}
|
||||
|
@ -18,23 +18,12 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"phpcs",
|
||||
"php-cs-fixer",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
opts = { ensure_installed = {
|
||||
"php-debug-adapter",
|
||||
} },
|
||||
opts = { ensure_installed = { "php-debug-adapter" } },
|
||||
},
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
@ -46,32 +35,4 @@ return {
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.formatting.phpcsfixer)
|
||||
table.insert(opts.sources, nls.builtins.diagnostics.phpcs)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
php = { "phpcs" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
php = { "php-cs-fixer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -75,7 +75,6 @@ return {
|
||||
"folke/edgy.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.right = opts.right or {}
|
||||
table.insert(opts.right, {
|
||||
title = "Database",
|
||||
ft = "dbui",
|
||||
@ -86,7 +85,6 @@ return {
|
||||
end,
|
||||
})
|
||||
|
||||
opts.bottom = opts.bottom or {}
|
||||
table.insert(opts.bottom, {
|
||||
title = "DB Query Result",
|
||||
ft = "dbout",
|
||||
|
@ -49,7 +49,7 @@ return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
{ "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} },
|
||||
{ "roobert/tailwindcss-colorizer-cmp.nvim", config = true },
|
||||
},
|
||||
opts = function(_, opts)
|
||||
-- original LazyVim kind icon formatter
|
||||
|
@ -194,7 +194,7 @@ return {
|
||||
if not dap.adapters["pwa-node"] then
|
||||
require("dap").adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "127.0.0.1",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "node",
|
||||
|
@ -12,5 +12,5 @@ require("lazyvim.config").init()
|
||||
|
||||
return {
|
||||
{ "folke/lazy.nvim", version = "*" },
|
||||
{ "LazyVim/LazyVim", priority = 10000, lazy = false, opts = {}, cond = true, version = "*" },
|
||||
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" },
|
||||
}
|
||||
|
@ -269,18 +269,17 @@ for _, level in ipairs({ "info", "warn", "error" }) do
|
||||
end
|
||||
end
|
||||
|
||||
local cache = {} ---@type table<(fun()), table<string, any>>
|
||||
local cache = {} ---@type table<string, any>
|
||||
---@generic T: fun()
|
||||
---@param fn T
|
||||
---@return T
|
||||
function M.memoize(fn)
|
||||
return function(...)
|
||||
local key = vim.inspect({ ... })
|
||||
cache[fn] = cache[fn] or {}
|
||||
if cache[fn][key] == nil then
|
||||
cache[fn][key] = fn(...)
|
||||
if cache[key] == nil then
|
||||
cache[key] = fn(...)
|
||||
end
|
||||
return cache[fn][key]
|
||||
return cache[key]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -72,7 +72,7 @@ function M.format(component, text, hl_group)
|
||||
return component:format_hl(lualine_hl_group) .. text .. component:get_default_hl()
|
||||
end
|
||||
|
||||
---@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?, modified_sign: string?, readonly_icon: string?, length: number?}
|
||||
---@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?}
|
||||
function M.pretty_path(opts)
|
||||
opts = vim.tbl_extend("force", {
|
||||
relative = "cwd",
|
||||
@ -80,7 +80,6 @@ function M.pretty_path(opts)
|
||||
directory_hl = "",
|
||||
filename_hl = "Bold",
|
||||
modified_sign = "",
|
||||
readonly_icon = " ",
|
||||
length = 3,
|
||||
}, opts or {})
|
||||
|
||||
@ -121,12 +120,7 @@ function M.pretty_path(opts)
|
||||
dir = table.concat({ unpack(parts, 1, #parts - 1) }, sep)
|
||||
dir = M.format(self, dir .. sep, opts.directory_hl)
|
||||
end
|
||||
|
||||
local readonly = ""
|
||||
if vim.bo.readonly then
|
||||
readonly = M.format(self, opts.readonly_icon, opts.modified_hl)
|
||||
end
|
||||
return dir .. parts[#parts] .. readonly
|
||||
return dir .. parts[#parts]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
describe("Should not have", function()
|
||||
it("dd()", function()
|
||||
local out = vim.fn.system([[/bin/grep --line-number -r '\\bdd(' lua]])
|
||||
assert(vim.v.shell_error == 1, "Should not have dd()\n" .. out)
|
||||
end)
|
||||
end)
|
@ -1,36 +0,0 @@
|
||||
---@module "luassert"
|
||||
|
||||
local LazyVim = require("lazyvim.util")
|
||||
|
||||
describe("util", function()
|
||||
local t = 0
|
||||
local fn = function(a)
|
||||
t = t + 1
|
||||
return a
|
||||
end
|
||||
|
||||
local m = LazyVim.memoize(fn)
|
||||
|
||||
it("should memoize a function", function()
|
||||
local a = m(1)
|
||||
local b = m(1)
|
||||
local c = m(2)
|
||||
assert.are.equal(a, b)
|
||||
assert.are.equal(a, 1)
|
||||
assert.are.equal(c, 2)
|
||||
assert.are.equal(t, 2)
|
||||
assert.are_not.equal(a, c)
|
||||
end)
|
||||
|
||||
local f1 = LazyVim.memoize(function()
|
||||
return 1
|
||||
end)
|
||||
local f2 = LazyVim.memoize(function()
|
||||
return 2
|
||||
end)
|
||||
|
||||
it("should memoize based on the correct key", function()
|
||||
assert.are.equal(f1(), 1)
|
||||
assert.are.equal(f2(), 2)
|
||||
end)
|
||||
end)
|
Reference in New Issue
Block a user