Compare commits

...

103 commits

Author SHA1 Message Date
github-actions[bot]
6c3bda4aca
chore(main): release 11.17.1 (#1927)
🤖 I have created a release *beep* *boop*
---


##
[11.17.1](https://github.com/folke/lazy.nvim/compare/v11.17.0...v11.17.1)
(2025-02-25)


### Bug Fixes

* **bootstrap:** support for older Neovim versions
([1c9ba37](1c9ba37045))
* **meta:** rebuild dirty right after disable. See
[#1889](https://github.com/folke/lazy.nvim/issues/1889)
([d51cf69](d51cf69783))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-25 20:19:57 +01:00
Folke Lemaitre
d51cf69783
fix(meta): rebuild dirty right after disable. See #1889 2025-02-25 20:18:25 +01:00
Folke Lemaitre
1c9ba37045
fix(bootstrap): support for older Neovim versions 2025-02-25 20:02:32 +01:00
github-actions[bot]
96a205c8ce
chore(main): release 11.17.0 (#1877)
🤖 I have created a release *beep* *boop*
---


##
[11.17.0](https://github.com/folke/lazy.nvim/compare/v11.16.2...v11.17.0)
(2025-02-24)


### Features

* **config,render:** allow customizing the debug icon
([#1863](https://github.com/folke/lazy.nvim/issues/1863))
([a9c660d](a9c660d6ef))
* **util:** pass lang to `vim.notify` so that snacks notifier can render
the ft. Closes [#1919](https://github.com/folke/lazy.nvim/issues/1919)
([c6a57a3](c6a57a3534))


### Bug Fixes

* **config:** add missing space on the default debug icon
([#1879](https://github.com/folke/lazy.nvim/issues/1879))
([4df5c4d](4df5c4d65a))
* **meta:** disable top-level specs before the rest. Closes
[#1889](https://github.com/folke/lazy.nvim/issues/1889)
([f81a3fb](f81a3fb7fe))
* **ui:** do not show virt_lines for messages
([#1904](https://github.com/folke/lazy.nvim/issues/1904))
([f15a939](f15a93907d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-25 19:14:41 +01:00
Salomon Popp
a8c6db5da7
style(types): add optional return value for LazyKeysSpec rhs (#1924)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

when `expr=true` the rhs function should return a string.

example

```lua
{
    keys = {
        {
            '<leader>j',
            function()
                return require('dial.map').inc_normal()
            end,
            expr = true,
            desc = 'Increment value',
        }
    }
}
```

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-24 07:20:35 +01:00
Folke Lemaitre
e5e9bf4821
test: fix tests 2025-02-15 23:09:58 +01:00
Folke Lemaitre
f81a3fb7fe
fix(meta): disable top-level specs before the rest. Closes #1889 2025-02-15 23:06:09 +01:00
github-actions[bot]
ac21a639c7 chore(build): auto-generate rockspec mappings 2025-02-15 07:25:07 +00:00
Folke Lemaitre
c6a57a3534
feat(util): pass lang to vim.notify so that snacks notifier can render the ft. Closes #1919 2025-02-15 08:19:49 +01:00
JINNOUCHI Yasushi
f15a93907d
fix(ui): do not show virt_lines for messages (#1904)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

https://github.com/neovim/neovim/pull/31959 has introduced virtual lines
for showing diagnostics. If this is enabled (default value), messages
from lazy.nvim, such as `update available` are shown as virtual lines in
addition to virtual texts.

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

* ***before***
- <img width="592" alt="スクリーンショット 2025-01-27 16 42 27"
src="https://github.com/user-attachments/assets/6994ac84-4862-4532-81ee-80f4015181e5"
/>
* ***after***
- <img width="585" alt="スクリーンショット 2025-01-27 16 42 58"
src="https://github.com/user-attachments/assets/d19f63dc-fb6d-434f-89cf-a0bc49d31c5f"
/>
2025-02-06 07:53:12 +01:00
github-actions[bot]
7527af40dd chore(build): auto-generate rockspec mappings 2025-01-30 19:19:03 +00:00
Folke Lemaitre
5586fda88d
ci: remove debug 2025-01-30 20:14:57 +01:00
Folke Lemaitre
4f30c61b64
ci: check 2025-01-30 20:13:53 +01:00
github-actions[bot]
d8f26efd45 chore(build): auto-generate docs 2025-01-06 20:14:50 +00:00
Eduardo Bray
4df5c4d65a
fix(config): add missing space on the default debug icon (#1879)
## Description

Adds the missing space from a9c660d

## Screenshots

Current:


![imagen](https://github.com/user-attachments/assets/9a3a1a0c-43ad-49f3-8b39-b3250f53ec40)

After:


![imagen](https://github.com/user-attachments/assets/3b3d4dfd-3c03-4db9-8f61-d2bd4f9ed22d)
2025-01-06 21:14:06 +01:00
github-actions[bot]
72aa3a2624 chore(build): auto-generate docs 2025-01-05 05:41:31 +00:00
Shihua Zeng
a9c660d6ef
feat(config,render): allow customizing the debug icon (#1863)
## Description

lazy.nvim allows users to configure all icons except for the debug icon.
This PR enables user to configure the debug icon with `ui.icons.debug`

## Screenshots

Before:


![image](https://github.com/user-attachments/assets/42b02fd9-58e6-4ebc-a1a7-c5e91f07a11a)

After (with config `{ ui = { icons = { debug = ' ' } } }`):


![image](https://github.com/user-attachments/assets/3ade5392-a988-4a10-86fc-f52b41a690c5)
2025-01-05 06:40:44 +01:00
github-actions[bot]
7e6c863bc7
chore(main): release 11.16.2 (#1854)
🤖 I have created a release *beep* *boop*
---


##
[11.16.2](https://github.com/folke/lazy.nvim/compare/v11.16.1...v11.16.2)
(2024-12-13)


### Bug Fixes

* **meta:** when a plugin is both optional and disabled, then just
delete it from the list
([805b85c](805b85c2ea))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-13 19:58:17 +01:00
Folke Lemaitre
805b85c2ea
fix(meta): when a plugin is both optional and disabled, then just delete it from the list 2024-12-13 19:56:52 +01:00
github-actions[bot]
7c493713bc
chore(main): release 11.16.1 (#1844)
🤖 I have created a release *beep* *boop*
---


##
[11.16.1](https://github.com/folke/lazy.nvim/compare/v11.16.0...v11.16.1)
(2024-12-09)


### Bug Fixes

* **types:** ensure all fields for `LazyPluginSpec` are optional
([#1843](https://github.com/folke/lazy.nvim/issues/1843))
([703be1d](703be1dda3)),
closes [#1842](https://github.com/folke/lazy.nvim/issues/1842)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-10 20:12:21 +01:00
github-actions[bot]
b97ee167f5 chore(build): auto-generate docs 2024-12-10 05:18:15 +00:00
Daemon
703be1dda3
fix(types): ensure all fields for LazyPluginSpec are optional (#1843)
> After updating lua_ls to
[v3.13.3](https://github.com/LuaLS/lua-language-server/releases/tag/3.13.3)
noticed my plugin scripts using `@type LazyPluginSpec` now have
`missing-fields` warnings.
It seems they have changed how `missing-fields` diagnostics work with
inherited types:
7b2d58537f.

Duplicate offending fields as optional in type `LazyPluginSpec`

Closes: #1842
2024-12-09 22:40:21 +01:00
github-actions[bot]
014d1d6d78
chore(main): release 11.16.0 (#1838)
🤖 I have created a release *beep* *boop*
---


##
[11.16.0](https://github.com/folke/lazy.nvim/compare/v11.15.0...v11.16.0)
(2024-12-07)


### Features

* **plugin:** added support for virtual plugins. Closes
[#1836](https://github.com/folke/lazy.nvim/issues/1836)
([ee64abc](ee64abc76b))


### Bug Fixes

* **plugin:** don't check if dir exists for virtual plugins
([656cf43](656cf43093))
* **render:** show correct key for home. Fixes
[#1796](https://github.com/folke/lazy.nvim/issues/1796)
([b08dba8](b08dba8107))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-07 21:44:18 +01:00
Folke Lemaitre
656cf43093
fix(plugin): don't check if dir exists for virtual plugins 2024-12-07 11:52:43 +01:00
Folke Lemaitre
b08dba8107
fix(render): show correct key for home. Fixes #1796 2024-12-07 07:57:03 +01:00
Folke Lemaitre
ee64abc76b
feat(plugin): added support for virtual plugins. Closes #1836 2024-12-06 20:28:53 +01:00
github-actions[bot]
3388a26417 chore(build): auto-generate rockspec mappings 2024-12-05 08:11:36 +00:00
github-actions[bot]
a44e9cd165
chore(main): release 11.15.0 (#1835)
🤖 I have created a release *beep* *boop*
---


##
[11.15.0](https://github.com/folke/lazy.nvim/compare/v11.14.2...v11.15.0)
(2024-12-05)


### Features

* **plugin:** show error for local plugins that don't exist. Fixes
[#1773](https://github.com/folke/lazy.nvim/issues/1773)
([9570a5a](9570a5ae7b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-05 09:10:16 +01:00
Folke Lemaitre
9570a5ae7b
feat(plugin): show error for local plugins that don't exist. Fixes #1773 2024-12-05 09:06:28 +01:00
github-actions[bot]
56ead98e05 chore(build): auto-generate rockspec mappings 2024-11-20 08:28:09 +00:00
Folke Lemaitre
7d0fe7615a
ci: docgen fixes 2024-11-20 09:24:28 +01:00
github-actions[bot]
8e11d208d6 chore(build): auto-generate docs 2024-11-20 08:13:59 +00:00
Folke Lemaitre
25749704e4
docs: docgen 2024-11-20 09:11:45 +01:00
Folke Lemaitre
e41dffcbaf
docs: fix hl_group docgen 2024-11-20 09:08:44 +01:00
github-actions[bot]
7967abe557
chore(main): release 11.14.2 (#1730)
🤖 I have created a release *beep* *boop*
---


##
[11.14.2](https://github.com/folke/lazy.nvim/compare/v11.14.1...v11.14.2)
(2024-11-10)


### Bug Fixes

* **bootstrap:** single forward slash. Fixes
[#1747](https://github.com/folke/lazy.nvim/issues/1747)
([aca30f6](aca30f6361))
* **completion:** check if command string is a prefix of Lazy
([#1760](https://github.com/folke/lazy.nvim/issues/1760))
([e9fd76e](e9fd76e239)),
closes [#1758](https://github.com/folke/lazy.nvim/issues/1758)
* **docs:** always update helptags for local plugins
([60cf258](60cf258a9a))
* **luarocks:** try to install from root manifest
([#1687](https://github.com/folke/lazy.nvim/issues/1687))
([591ef40](591ef40f2d))
* **rocks:** add lib64 plugin directory to package.cpath
([#1717](https://github.com/folke/lazy.nvim/issues/1717))
([80da254](80da254e64))
* **rockspec:** allow binary lua files. Fixes
[#1800](https://github.com/folke/lazy.nvim/issues/1800)
([408449a](408449a59a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-11 11:07:59 +01:00
Folke Lemaitre
60cf258a9a
fix(docs): always update helptags for local plugins 2024-11-10 07:28:51 +01:00
github-actions[bot]
b1134ab82e chore(build): auto-generate rockspec mappings 2024-11-04 10:49:21 +00:00
Folke Lemaitre
408449a59a
fix(rockspec): allow binary lua files. Fixes #1800 2024-11-04 11:46:48 +01:00
github-actions[bot]
cf8ecc2c5e chore(build): auto-generate rockspec mappings 2024-10-22 10:47:57 +00:00
Lorenzo Zabot
40dab7450e
style(typos): correct a few typos (#1776)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
This PR just fixes a few typos :)

`dont => don't`
## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2024-10-22 12:43:33 +02:00
github-actions[bot]
1159bdccd8 chore(build): auto-generate rockspec mappings 2024-10-02 07:54:44 +00:00
Luna Saphie Mittelbach
e9fd76e239
fix(completion): check if command string is a prefix of Lazy (#1760)
Problem: Command completion doesn't work if the command name isn't
written in full

Solution: Use vim.startswith to check if the command is a prefix of
'Lazy'

Fixes #1758
2024-10-02 09:52:51 +02:00
github-actions[bot]
460e1cd8f2 chore(build): auto-generate rockspec mappings 2024-09-16 08:17:41 +00:00
Folke Lemaitre
aca30f6361
fix(bootstrap): single forward slash. Fixes #1747 2024-09-16 10:13:11 +02:00
github-actions[bot]
48b52b5cfc chore(build): auto-generate rockspec mappings 2024-08-31 07:03:18 +00:00
Marc Jakobi
591ef40f2d
fix(luarocks): try to install from root manifest (#1687)
## Description

When passing the `--dev` flag to `luarocks`, it will prioritise `dev`
versions when resolving dependencies (treating `dev` or `scm` as greater
than a SemVer version) if the rockspec doesn't specify an upper version
constraint (which is often the case).

Dev packages are often unstable and may cause more problems, especially
for Windows users (an example I've seen is git for windows trying and
failing to checkout submodules).

For now , a good compromise between too many retries and not retrying at
all could be to try `luarocks install` from the root manifest first, but
to keep the `--dev` flag in `luarocks make`.

If that still causes problems, it might be better to fall back to
`luarocks make` without `--dev` first, and then to try `luarocks ---dev
make` as a last resort.
In rocks.nvim, we only fall back to adding the `--dev` flag if the
install error message contains the string `"No results matching query
were found"`; assuming that stable non-dev packages shouldn't depend on
dev packages.
2024-08-31 08:59:45 +02:00
Roger Kim
80da254e64
fix(rocks): add lib64 plugin directory to package.cpath (#1717)
## Description
`package.cpath` is missing the `lib64` directory for plugins that have
luarocks dependencies.

## Context
I found this issue when I was working on my new Neovim plugin on my
Fedora 39 machine. I added the `luasockets` dependency to rockspec file
in my plugin like so:

```
rockspec_format = "3.0"
package = "typeracer.nvim"
version = "scm-1"
source = {
	url = "git+https://github.com/carbon-steel/typeracer.nvim",
}
dependencies = {
	"luasocket",
}
test_dependencies = {
	"nlua",
}
build = {
	type = "builtin",
	copy_directories = {},
}

```

I found that the dynamic libraries from the `luasockets` dependency were
installed like so:
`/home/username/.local/share/nvim/lazy-rocks/typeracer.nvim/lib64/lua/5.1/socket/core.so`.
However, the only entry related to my plugin `typeracer.nvim` was:
`/home/glyph/.local/share/nvim/lazy-rocks/typeracer.nvim/lib/lua/5.1/?.so`.
The issue is that we only have the plugin's `lib` directory in
`package.cpath` and not `lib64`.

I looked through `lazy.nvim`'s code and I think adding the `lib64`
directory should fix the issue. I don't know if we also want to worry
about `lib32` as well, but so far, this change works for me.
2024-08-31 08:58:43 +02:00
Christoph Zirkelbach
014a72b7a8
docs: update dev.path description (#1711)
## Description

In the issue (#1707) I was confused by the description of `dev.path`. I
thought functions must also return the general directory for local
plugins, but it must be the plugin directory.

## Related Issue(s)

#1707
2024-08-31 08:57:58 +02:00
github-actions[bot]
077102c5bf
chore(main): release 11.14.1 (#1680)
🤖 I have created a release *beep* *boop*
---


##
[11.14.1](https://github.com/folke/lazy.nvim/compare/v11.14.0...v11.14.1)
(2024-07-25)


### Bug Fixes

* **plugins:** "Vim:E150: Not a directory" on plugin update
([#1679](https://github.com/folke/lazy.nvim/issues/1679))
([7108809](7108809ab1))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-25 13:38:23 +02:00
Alexander Grebennik
7108809ab1
fix(plugins): "Vim:E150: Not a directory" on plugin update (#1679)
## Description

On plugins update it fails with following error for any plugin.

```
~/.local/share/nvim/lazy/lazy.nvim/manage/task/plugin.lua:95: Vim:E150: Not a directory: ~/.local/share/nvim/lazy/gitsigns.nvim/doc/
```
2024-07-25 12:53:01 +02:00
github-actions[bot]
4496b4cad6
chore(main): release 11.14.0 (#1673)
🤖 I have created a release *beep* *boop*
---


##
[11.14.0](https://github.com/folke/lazy.nvim/compare/v11.13.5...v11.14.0)
(2024-07-24)


### Features

* added `opts.git.cooldown` to allow updating plugins on slow
connections. Fixes
[#1656](https://github.com/folke/lazy.nvim/issues/1656)
([d5686ef](d5686efbd0))
* **plugin:** improve error handling and show better error message
([c02268a](c02268ac6e))


### Bug Fixes

* **plugin:** make .lazy.lua work again
([b4a5a12](b4a5a1209e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-24 07:38:49 +02:00
Folke Lemaitre
b4a5a1209e
fix(plugin): make .lazy.lua work again 2024-07-24 07:23:36 +02:00
Folke Lemaitre
c02268ac6e
feat(plugin): improve error handling and show better error message 2024-07-23 17:24:33 +02:00
Folke Lemaitre
d5686efbd0
feat: added opts.git.cooldown to allow updating plugins on slow connections. Fixes #1656 2024-07-23 13:31:25 +02:00
github-actions[bot]
839f9e78e7
chore(main): release 11.13.5 (#1672)
🤖 I have created a release *beep* *boop*
---


##
[11.13.5](https://github.com/folke/lazy.nvim/compare/v11.13.4...v11.13.5)
(2024-07-22)


### Bug Fixes

* **health:** dont use vim.fn.system to get cmd versions
([7d29719](7d29719ade))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-22 14:41:58 +02:00
Folke Lemaitre
7d29719ade
fix(health): dont use vim.fn.system to get cmd versions 2024-07-22 14:38:00 +02:00
Folke Lemaitre
cc028e77eb
ci: update 2024-07-22 14:24:40 +02:00
github-actions[bot]
16a5c46aa3
chore(main): release 11.13.4 (#1670)
🤖 I have created a release *beep* *boop*
---


##
[11.13.4](https://github.com/folke/lazy.nvim/compare/v11.13.3...v11.13.4)
(2024-07-22)


### Bug Fixes

* **loader:** add plugins whose rtp got loaded early to start plugins
([34b0126](34b0126e5b))
* **loader:** explicitely set package.loaded.modname to nil to prevent
recursive loading errors
([12f2c74](12f2c74244))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-22 09:47:04 +02:00
Folke Lemaitre
12f2c74244
fix(loader): explicitely set package.loaded.modname to nil to prevent recursive loading errors 2024-07-22 09:45:03 +02:00
Folke Lemaitre
34b0126e5b
fix(loader): add plugins whose rtp got loaded early to start plugins 2024-07-22 09:45:03 +02:00
github-actions[bot]
a09c876f6e
chore(main): release 11.13.3 (#1669)
🤖 I have created a release *beep* *boop*
---


##
[11.13.3](https://github.com/folke/lazy.nvim/compare/v11.13.2...v11.13.3)
(2024-07-21)


### Reverts

* fix(loader): add auto loaded module to package.loaded early to prevent
require loops
([a692bf8](a692bf8688))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-21 17:34:22 +02:00
Folke Lemaitre
a692bf8688
revert: fix(loader): add auto loaded module to package.loaded early to prevent require loops
This reverts commit 18d1c1b47e.
2024-07-21 17:32:50 +02:00
github-actions[bot]
8bef0742a2
chore(main): release 11.13.2 (#1668)
🤖 I have created a release *beep* *boop*
---


##
[11.13.2](https://github.com/folke/lazy.nvim/compare/v11.13.1...v11.13.2)
(2024-07-21)


### Bug Fixes

* **loader:** add auto loaded module to package.loaded early to prevent
require loops
([18d1c1b](18d1c1b47e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-21 15:53:27 +02:00
Folke Lemaitre
18d1c1b47e
fix(loader): add auto loaded module to package.loaded early to prevent require loops 2024-07-21 12:41:54 +02:00
github-actions[bot]
9a374a0fb4
chore(main): release 11.13.1 (#1664)
🤖 I have created a release *beep* *boop*
---


##
[11.13.1](https://github.com/folke/lazy.nvim/compare/v11.13.0...v11.13.1)
(2024-07-19)


### Bug Fixes

* **build:** only load the plugin before build for `:` build commands
([5bdb12a](5bdb12a038))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-19 11:50:14 +02:00
Folke Lemaitre
5bdb12a038
fix(build): only load the plugin before build for : build commands 2024-07-19 08:57:37 +02:00
github-actions[bot]
c92c6b5fd2 chore(build): auto-generate docs 2024-07-18 13:57:58 +00:00
Gert Burger
124b864233
docs(commands): fix command ordering for sync (#1661)
## Description

After a discussion on Slack we noticed that the description of the sync
command is a bit vague. Some people, including myself, assumed
`clean`/`install`/`update` referred to build steps being performed per
plugin.

Another person mentioned they thought it referred to the Lazy commands,
which does make more sense.
They also noticed that the order of the commands do not match the source
code.

So this PR corrects the order, assuming it was meant to be ordered, and
mentions that those are commands for clarity.
2024-07-18 15:57:12 +02:00
github-actions[bot]
8f62257511
chore(main): release 11.13.0 (#1660)
🤖 I have created a release *beep* *boop*
---


##
[11.13.0](https://github.com/folke/lazy.nvim/compare/v11.12.0...v11.13.0)
(2024-07-17)


### Features

* **ui:** added mapping descriptions
([6ca90a2](6ca90a2120))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-18 10:47:30 +02:00
Folke Lemaitre
6ca90a2120
feat(ui): added mapping descriptions 2024-07-18 00:40:42 +02:00
github-actions[bot]
5473e3d77c
chore(main): release 11.12.0 (#1655)
🤖 I have created a release *beep* *boop*
---


##
[11.12.0](https://github.com/folke/lazy.nvim/compare/v11.11.1...v11.12.0)
(2024-07-16)


### Features

* **git:** added git network throttle to limit network related git ops
per interval. Closes
[#1635](https://github.com/folke/lazy.nvim/issues/1635)
([d731a6b](d731a6b005))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-17 12:54:53 +02:00
Folke Lemaitre
d731a6b005
feat(git): added git network throttle to limit network related git ops per interval. Closes #1635 2024-07-16 16:50:31 +02:00
github-actions[bot]
9d445ebbd8
chore(update): update repository (#1653)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: folke <292349+folke@users.noreply.github.com>
2024-07-15 17:09:32 +02:00
github-actions[bot]
315191aa9e
chore(update): update repository (#1651)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: folke <292349+folke@users.noreply.github.com>
2024-07-15 11:19:51 +02:00
github-actions[bot]
b02c9eae6a
chore(main): release 11.11.1 (#1643)
🤖 I have created a release *beep* *boop*
---


##
[11.11.1](https://github.com/folke/lazy.nvim/compare/v11.11.0...v11.11.1)
(2024-07-13)


### Bug Fixes

* **config:** check for lib64. Fixes
[#1343](https://github.com/folke/lazy.nvim/issues/1343)
([93499c5](93499c5deb))
* **lockfile:** ensure newline at EOF for lockfile
([#1639](https://github.com/folke/lazy.nvim/issues/1639))
([7ed9f71](7ed9f7173c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-13 22:50:19 +02:00
github-actions[bot]
6e66f8e655
chore(update): update repository (#1648)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: folke <292349+folke@users.noreply.github.com>
2024-07-13 19:29:13 +02:00
Folke Lemaitre
93499c5deb
fix(config): check for lib64. Fixes #1343 2024-07-13 18:07:56 +02:00
github-actions[bot]
788feaf10e
chore(update): update repository (#1644)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: folke <292349+folke@users.noreply.github.com>
2024-07-13 16:16:17 +02:00
github-actions[bot]
58c6bc4ab2
chore(update): update repository (#1638)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Co-authored-by: folke <292349+folke@users.noreply.github.com>
2024-07-13 10:07:17 +02:00
Ethan Wu
7ed9f7173c
fix(lockfile): ensure newline at EOF for lockfile (#1639)
## Description

The lockfile currently does not end with a newline at EOF. Text files
should [end with a newline](https://unix.stackexchange.com/a/18789).
This also lets you manually edit the lockfile in vim without 'fixeol'
creating a spurious change for the added newline.

This change however will create a change in users' lockfiles adding a
newline upon updating, but since the lockfile would be changing anyways
to update lazy.nvim itself, this is likely acceptable.

## Related Issue(s)

*none*

## Screenshots

*N/A*
2024-07-13 09:51:44 +02:00
Folke Lemaitre
54f70c757c
ci: add luassert to minitest for now 2024-07-13 09:45:01 +02:00
github-actions[bot]
070418dca1
chore(main): release 11.11.0 (#1634)
🤖 I have created a release *beep* *boop*
---


##
[11.11.0](https://github.com/folke/lazy.nvim/compare/v11.10.4...v11.11.0)
(2024-07-11)


### Features

* add plugin name to handlers.managed
([17473db](17473db1d7))


### Bug Fixes

* **minit:** add tests to package.path when running busted (helpers.lua
etc)
([fadebdc](fadebdc76b))
* **util:** strip `-lua` in normname
([54b003c](54b003c650))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-13 09:25:55 +02:00
Folke Lemaitre
1d451b4c2c
ci: use mini.test instead of busted 2024-07-11 22:32:11 +02:00
Folke Lemaitre
17473db1d7
feat: add plugin name to handlers.managed 2024-07-11 22:04:06 +02:00
Folke Lemaitre
54b003c650
fix(util): strip -lua in normname 2024-07-11 22:03:53 +02:00
github-actions[bot]
d1de92dffa chore(build): auto-generate docs 2024-07-09 15:26:28 +00:00
Folke Lemaitre
2cb8af1eb1
ci: skip docs on main 2024-07-09 17:25:41 +02:00
folke
159036c576 chore(build): auto-generate docs 2024-07-09 13:03:11 +00:00
Folke Lemaitre
fadebdc76b
fix(minit): add tests to package.path when running busted (helpers.lua etc) 2024-07-09 15:02:18 +02:00
github-actions[bot]
1870238cf9 chore(build): auto-generate docs 2024-07-08 05:53:40 +00:00
github-actions[bot]
f918318d21
chore(main): release 11.10.4 (#1628)
🤖 I have created a release *beep* *boop*
---


##
[11.10.4](https://github.com/folke/lazy.nvim/compare/v11.10.3...v11.10.4)
(2024-07-08)


### Bug Fixes

* **rocks:** try building anyway even when prerequisits have not been
met. (will likely fail)
([f0324de](f0324defdd))
* **ui:** don't treat suspended as headless. Closes
[#1626](https://github.com/folke/lazy.nvim/issues/1626)
([2dfccd7](2dfccd7b94))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-08 07:52:50 +02:00
folke
a4c473cc2d chore(build): auto-generate docs 2024-07-08 05:46:33 +00:00
Folke Lemaitre
f0324defdd
fix(rocks): try building anyway even when prerequisits have not been met. (will likely fail) 2024-07-08 07:45:45 +02:00
github-actions[bot]
0002bfbd9f chore(build): auto-generate docs 2024-07-08 05:28:57 +00:00
Folke Lemaitre
2dfccd7b94
fix(ui): don't treat suspended as headless. Closes #1626 2024-07-08 07:28:02 +02:00
folke
44cd12fa27 chore(build): auto-generate docs 2024-07-07 19:26:10 +00:00
github-actions[bot]
a6daaf68a2
chore(main): release 11.10.3 (#1625)
🤖 I have created a release *beep* *boop*
---


##
[11.10.3](https://github.com/folke/lazy.nvim/compare/v11.10.2...v11.10.3)
(2024-07-07)


### Bug Fixes

* **git:** local plugin fixes
([#1624](https://github.com/folke/lazy.nvim/issues/1624))
([72c0dc9](72c0dc9462))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-07 21:25:12 +02:00
github-actions[bot]
436d09af7d chore(build): auto-generate docs 2024-07-07 15:15:37 +00:00
github-actions[bot]
93c9a3f872 chore(build): auto-generate docs 2024-07-07 15:14:44 +00:00
Andre Toerien
72c0dc9462
fix(git): local plugin fixes (#1624)
## Description

As I described in
https://github.com/folke/lazy.nvim/pull/1512#issuecomment-2212474372,
this makes it so that local plugins will only show as needing updates if
the local branch is behind the upstream branch. This is done by checking
the output of the `git log` command, and only setting `plugin._.updates`
if the output is not empty.

This seems to solve my issue where local plugins with unpushed changes
always show as needing updates, but if there's a easier/better way of
doing it then please feel free to edit/close this. Or if you don't agree
that the current behaviour is a bug, then that's also fine - it's not a
big deal and I can easily just ignore the "updates available" notice.

I also came across a minor issue where the plugin diff view (press `d`)
compares the wrong commits for local plugins, because
[lua/lazy/view/init.lua](c771cf4928/lua/lazy/view/init.lua (L268))
always uses `get_target`. I fixed this by moving `get_local_target` into
`get_target` - I think this is simpler and more straightforward than the
alternative of adding a ternary everywhere `get_target` is called.

This second bugfix is a very small change, so I've just included it
here, but I'm happy to make a second PR if you'd like.

## Related Issue(s)

Related PR: #1512
2024-07-07 17:13:49 +02:00
folke
c771cf4928 chore(build): auto-generate docs 2024-07-07 06:46:59 +00:00
github-actions[bot]
25026d2382 chore(build): auto-generate docs 2024-07-07 06:45:25 +00:00
folke
083f3dfb5e chore(build): auto-generate docs 2024-07-07 06:45:23 +00:00
35 changed files with 2381 additions and 273 deletions

7
.editorconfig Normal file
View file

@ -0,0 +1,7 @@
root = true
[*]
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8

View file

@ -1,3 +1,3 @@
{ {
".": "11.10.2" ".": "11.17.1"
} }

View file

@ -6,7 +6,10 @@ body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
**Before** reporting an issue, make sure to read the [documentation](https://github.com/folke/lazy.nvim) and search [existing issues](https://github.com/folke/lazy.nvim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/folke/lazy.nvim/discussions) and will be closed. **Before** reporting an issue, make sure to read the [documentation](https://github.com/folke/lazy.nvim)
and search [existing issues](https://github.com/folke/lazy.nvim/issues).
Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/folke/lazy.nvim/discussions) and will be closed.
- type: checkboxes - type: checkboxes
attributes: attributes:
label: Did you check docs and existing issues? label: Did you check docs and existing issues?
@ -14,6 +17,8 @@ body:
options: options:
- label: I have read all the lazy.nvim docs - label: I have read all the lazy.nvim docs
required: true required: true
- label: I have updated the plugin to the latest version before submitting this issue
required: true
- label: I have searched the existing issues of lazy.nvim - label: I have searched the existing issues of lazy.nvim
required: true required: true
- label: I have searched the existing issues of plugins related to this issue - label: I have searched the existing issues of plugins related to this issue
@ -57,32 +62,14 @@ body:
label: Repro label: Repro
description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua` description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua`
value: | value: |
-- DO NOT change the paths and don't remove the colorscheme vim.env.LAZY_STDPATH = ".repro"
local root = vim.fn.fnamemodify("./.repro", ":p") load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
-- set stdpaths to use .repro require("lazy.minit").repro({
for _, name in ipairs({ "config", "data", "state", "cache" }) do spec = {
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
-- add any other plugins here -- add any other plugins here
} },
require("lazy").setup(plugins, {
root = root .. "/plugins",
}) })
render: lua
vim.cmd.colorscheme("tokyonight")
-- add anything else here
render: Lua
validations: validations:
required: false required: false

View file

@ -12,3 +12,4 @@ jobs:
with: with:
plugin: lazy.nvim plugin: lazy.nvim
repo: folke/lazy.nvim repo: folke/lazy.nvim
docs: false

View file

@ -5,6 +5,7 @@ on:
- cron: "30 1 * * *" - cron: "30 1 * * *"
jobs: jobs:
ci: stale:
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
uses: folke/github/.github/workflows/stale.yml@main uses: folke/github/.github/workflows/stale.yml@main
secrets: inherit secrets: inherit

View file

@ -7,6 +7,7 @@ on:
- cron: "0 * * * *" - cron: "0 * * * *"
jobs: jobs:
ci: update:
if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner)
uses: folke/github/.github/workflows/update.yml@main uses: folke/github/.github/workflows/update.yml@main
secrets: inherit secrets: inherit

View file

@ -1,5 +1,180 @@
# Changelog # Changelog
## [11.17.1](https://github.com/folke/lazy.nvim/compare/v11.17.0...v11.17.1) (2025-02-25)
### Bug Fixes
* **bootstrap:** support for older Neovim versions ([1c9ba37](https://github.com/folke/lazy.nvim/commit/1c9ba3704564a2e34a22191bb89678680ffeb245))
* **meta:** rebuild dirty right after disable. See [#1889](https://github.com/folke/lazy.nvim/issues/1889) ([d51cf69](https://github.com/folke/lazy.nvim/commit/d51cf6978321d659e68a8bc38ee806bd2517a196))
## [11.17.0](https://github.com/folke/lazy.nvim/compare/v11.16.2...v11.17.0) (2025-02-24)
### Features
* **config,render:** allow customizing the debug icon ([#1863](https://github.com/folke/lazy.nvim/issues/1863)) ([a9c660d](https://github.com/folke/lazy.nvim/commit/a9c660d6ef1b396869d3d951760aa7a3dbfe575f))
* **util:** pass lang to `vim.notify` so that snacks notifier can render the ft. Closes [#1919](https://github.com/folke/lazy.nvim/issues/1919) ([c6a57a3](https://github.com/folke/lazy.nvim/commit/c6a57a3534d3494bcc5ff9b0586e141bdb0280eb))
### Bug Fixes
* **config:** add missing space on the default debug icon ([#1879](https://github.com/folke/lazy.nvim/issues/1879)) ([4df5c4d](https://github.com/folke/lazy.nvim/commit/4df5c4d65a3bbf801edd9ec55fb1ae55cfa72dd0))
* **meta:** disable top-level specs before the rest. Closes [#1889](https://github.com/folke/lazy.nvim/issues/1889) ([f81a3fb](https://github.com/folke/lazy.nvim/commit/f81a3fb7feaf460ec7c8c983682b4a693b18fdd4))
* **ui:** do not show virt_lines for messages ([#1904](https://github.com/folke/lazy.nvim/issues/1904)) ([f15a939](https://github.com/folke/lazy.nvim/commit/f15a93907ddad3d9139aea465ae18336d87f5ce6))
## [11.16.2](https://github.com/folke/lazy.nvim/compare/v11.16.1...v11.16.2) (2024-12-13)
### Bug Fixes
* **meta:** when a plugin is both optional and disabled, then just delete it from the list ([805b85c](https://github.com/folke/lazy.nvim/commit/805b85c2ea3bd6f9506ef22cbd6e3a39172b5b08))
## [11.16.1](https://github.com/folke/lazy.nvim/compare/v11.16.0...v11.16.1) (2024-12-09)
### Bug Fixes
* **types:** ensure all fields for `LazyPluginSpec` are optional ([#1843](https://github.com/folke/lazy.nvim/issues/1843)) ([703be1d](https://github.com/folke/lazy.nvim/commit/703be1dda35e142e76e94e7503cf67d6b98a1d35)), closes [#1842](https://github.com/folke/lazy.nvim/issues/1842)
## [11.16.0](https://github.com/folke/lazy.nvim/compare/v11.15.0...v11.16.0) (2024-12-07)
### Features
* **plugin:** added support for virtual plugins. Closes [#1836](https://github.com/folke/lazy.nvim/issues/1836) ([ee64abc](https://github.com/folke/lazy.nvim/commit/ee64abc76be2b237b95d241a924b0323005b868a))
### Bug Fixes
* **plugin:** don't check if dir exists for virtual plugins ([656cf43](https://github.com/folke/lazy.nvim/commit/656cf4309396b7b8b62984e923bf8d8a0013f7d7))
* **render:** show correct key for home. Fixes [#1796](https://github.com/folke/lazy.nvim/issues/1796) ([b08dba8](https://github.com/folke/lazy.nvim/commit/b08dba8107b5bdaaa007f18cf6c0cc0e0fd576aa))
## [11.15.0](https://github.com/folke/lazy.nvim/compare/v11.14.2...v11.15.0) (2024-12-05)
### Features
* **plugin:** show error for local plugins that don't exist. Fixes [#1773](https://github.com/folke/lazy.nvim/issues/1773) ([9570a5a](https://github.com/folke/lazy.nvim/commit/9570a5ae7b17dcde4718c7458fd986c10f015a99))
## [11.14.2](https://github.com/folke/lazy.nvim/compare/v11.14.1...v11.14.2) (2024-11-10)
### Bug Fixes
* **bootstrap:** single forward slash. Fixes [#1747](https://github.com/folke/lazy.nvim/issues/1747) ([aca30f6](https://github.com/folke/lazy.nvim/commit/aca30f63619a7492ecdea8833a065cf83c80f764))
* **completion:** check if command string is a prefix of Lazy ([#1760](https://github.com/folke/lazy.nvim/issues/1760)) ([e9fd76e](https://github.com/folke/lazy.nvim/commit/e9fd76e239cc18da289f9a3f80f35fa16b003175)), closes [#1758](https://github.com/folke/lazy.nvim/issues/1758)
* **docs:** always update helptags for local plugins ([60cf258](https://github.com/folke/lazy.nvim/commit/60cf258a9ae7fffe04bb31141141a91845158dcc))
* **luarocks:** try to install from root manifest ([#1687](https://github.com/folke/lazy.nvim/issues/1687)) ([591ef40](https://github.com/folke/lazy.nvim/commit/591ef40f2da3a26fbcc0466988cd6fe45ca68cae))
* **rocks:** add lib64 plugin directory to package.cpath ([#1717](https://github.com/folke/lazy.nvim/issues/1717)) ([80da254](https://github.com/folke/lazy.nvim/commit/80da254e645f579c28394ee0f08f75a9c9481744))
* **rockspec:** allow binary lua files. Fixes [#1800](https://github.com/folke/lazy.nvim/issues/1800) ([408449a](https://github.com/folke/lazy.nvim/commit/408449a59adb8c2a31c32fff606676b32ce4552a))
## [11.14.1](https://github.com/folke/lazy.nvim/compare/v11.14.0...v11.14.1) (2024-07-25)
### Bug Fixes
* **plugins:** "Vim:E150: Not a directory" on plugin update ([#1679](https://github.com/folke/lazy.nvim/issues/1679)) ([7108809](https://github.com/folke/lazy.nvim/commit/7108809ab18dc1b1e6f402b29e2e1d35a5d311d5))
## [11.14.0](https://github.com/folke/lazy.nvim/compare/v11.13.5...v11.14.0) (2024-07-24)
### Features
* added `opts.git.cooldown` to allow updating plugins on slow connections. Fixes [#1656](https://github.com/folke/lazy.nvim/issues/1656) ([d5686ef](https://github.com/folke/lazy.nvim/commit/d5686efbd00942b3e38de7c08b8df69d961b02f0))
* **plugin:** improve error handling and show better error message ([c02268a](https://github.com/folke/lazy.nvim/commit/c02268ac6e6aab92249d020d75efc588bd9d24fa))
### Bug Fixes
* **plugin:** make .lazy.lua work again ([b4a5a12](https://github.com/folke/lazy.nvim/commit/b4a5a1209e4c64fa67aedf721a383541a64056d1))
## [11.13.5](https://github.com/folke/lazy.nvim/compare/v11.13.4...v11.13.5) (2024-07-22)
### Bug Fixes
* **health:** dont use vim.fn.system to get cmd versions ([7d29719](https://github.com/folke/lazy.nvim/commit/7d29719ade6f5a269e3b7d08b246641b5b079aaa))
## [11.13.4](https://github.com/folke/lazy.nvim/compare/v11.13.3...v11.13.4) (2024-07-22)
### Bug Fixes
* **loader:** add plugins whose rtp got loaded early to start plugins ([34b0126](https://github.com/folke/lazy.nvim/commit/34b0126e5b3966f1dbe148d6f8450213115e76b2))
* **loader:** explicitely set package.loaded.modname to nil to prevent recursive loading errors ([12f2c74](https://github.com/folke/lazy.nvim/commit/12f2c74244cc768d97c83972aa63722389b5d96d))
## [11.13.3](https://github.com/folke/lazy.nvim/compare/v11.13.2...v11.13.3) (2024-07-21)
### Reverts
* fix(loader): add auto loaded module to package.loaded early to prevent require loops ([a692bf8](https://github.com/folke/lazy.nvim/commit/a692bf86883457f45fe3f773bfc8bc4d9e4b070c))
## [11.13.2](https://github.com/folke/lazy.nvim/compare/v11.13.1...v11.13.2) (2024-07-21)
### Bug Fixes
* **loader:** add auto loaded module to package.loaded early to prevent require loops ([18d1c1b](https://github.com/folke/lazy.nvim/commit/18d1c1b47e175cd58dc12bf4792ef4e9a50505fa))
## [11.13.1](https://github.com/folke/lazy.nvim/compare/v11.13.0...v11.13.1) (2024-07-19)
### Bug Fixes
* **build:** only load the plugin before build for `:` build commands ([5bdb12a](https://github.com/folke/lazy.nvim/commit/5bdb12a038e5a72cc793f38893f1a9c9fb741759))
## [11.13.0](https://github.com/folke/lazy.nvim/compare/v11.12.0...v11.13.0) (2024-07-17)
### Features
* **ui:** added mapping descriptions ([6ca90a2](https://github.com/folke/lazy.nvim/commit/6ca90a21202808796418e46d3cebfbb5a44e54a2))
## [11.12.0](https://github.com/folke/lazy.nvim/compare/v11.11.1...v11.12.0) (2024-07-16)
### Features
* **git:** added git network throttle to limit network related git ops per interval. Closes [#1635](https://github.com/folke/lazy.nvim/issues/1635) ([d731a6b](https://github.com/folke/lazy.nvim/commit/d731a6b005fd239e85e555bd57362382f6c1e461))
## [11.11.1](https://github.com/folke/lazy.nvim/compare/v11.11.0...v11.11.1) (2024-07-13)
### Bug Fixes
* **config:** check for lib64. Fixes [#1343](https://github.com/folke/lazy.nvim/issues/1343) ([93499c5](https://github.com/folke/lazy.nvim/commit/93499c5deb37641c6cf71528a93f101d186b409f))
* **lockfile:** ensure newline at EOF for lockfile ([#1639](https://github.com/folke/lazy.nvim/issues/1639)) ([7ed9f71](https://github.com/folke/lazy.nvim/commit/7ed9f7173cdec71a057053d7e6efc20c2c230b95))
## [11.11.0](https://github.com/folke/lazy.nvim/compare/v11.10.4...v11.11.0) (2024-07-11)
### Features
* add plugin name to handlers.managed ([17473db](https://github.com/folke/lazy.nvim/commit/17473db1d79ea30e06126834be7fd95ca511557b))
### Bug Fixes
* **minit:** add tests to package.path when running busted (helpers.lua etc) ([fadebdc](https://github.com/folke/lazy.nvim/commit/fadebdc76b71a1d3658a88a025c6c8fb4749e0f8))
* **util:** strip `-lua` in normname ([54b003c](https://github.com/folke/lazy.nvim/commit/54b003c650f07b771e61566f7be2629beb2b781f))
## [11.10.4](https://github.com/folke/lazy.nvim/compare/v11.10.3...v11.10.4) (2024-07-08)
### Bug Fixes
* **rocks:** try building anyway even when prerequisits have not been met. (will likely fail) ([f0324de](https://github.com/folke/lazy.nvim/commit/f0324defdd43be8aa14aaf3a794ff3d5581f36ba))
* **ui:** don't treat suspended as headless. Closes [#1626](https://github.com/folke/lazy.nvim/issues/1626) ([2dfccd7](https://github.com/folke/lazy.nvim/commit/2dfccd7b948beb26d8bcff7f9113a3a5c85cbc4a))
## [11.10.3](https://github.com/folke/lazy.nvim/compare/v11.10.2...v11.10.3) (2024-07-07)
### Bug Fixes
* **git:** local plugin fixes ([#1624](https://github.com/folke/lazy.nvim/issues/1624)) ([72c0dc9](https://github.com/folke/lazy.nvim/commit/72c0dc9462ab3bf1a68198afabc1eb4e2940d299))
## [11.10.2](https://github.com/folke/lazy.nvim/compare/v11.10.1...v11.10.2) (2024-07-07) ## [11.10.2](https://github.com/folke/lazy.nvim/compare/v11.10.1...v11.10.2) (2024-07-07)

View file

@ -1,4 +1,4 @@
-- Lay Bootstrapper -- Lazy Bootstrapper
-- Usage: -- Usage:
-- ```lua -- ```lua
-- load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() -- load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
@ -6,19 +6,20 @@
local M = {} local M = {}
function M.setup() function M.setup()
local uv = vim.uv or vim.loop
if vim.env.LAZY_STDPATH then if vim.env.LAZY_STDPATH then
local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p") local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p"):gsub("[\\/]$", "")
for _, name in ipairs({ "config", "data", "state", "cache" }) do for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end end
end end
if vim.env.LAZY_PATH and not vim.uv.fs_stat(vim.env.LAZY_PATH) then if vim.env.LAZY_PATH and not uv.fs_stat(vim.env.LAZY_PATH) then
vim.env.LAZY_PATH = nil vim.env.LAZY_PATH = nil
end end
local lazypath = vim.env.LAZY_PATH or vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.env.LAZY_PATH or vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.env.LAZY_PATH and not (vim.uv or vim.loop).fs_stat(lazypath) then if not vim.env.LAZY_PATH and not uv.fs_stat(lazypath) then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ {
"Cloning lazy.nvim\n\n", "Cloning lazy.nvim\n\n",

View file

@ -294,9 +294,9 @@ SPEC SETUP *lazy.nvim-🔌-plugin-spec-spec-setup*
-------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------
Property Type Description Property Type Description
---------- ----------------------------- --------------------------------------------------------- ---------- ----------------------------- ---------------------------------------------------------
init fun(LazyPlugin) init functions are always executed during. Mostly useful init fun(LazyPlugin) init functions are always executed during startup. Mostly
for setting vim.g.* configuration used by Vim plugins useful for setting vim.g.* configuration used by Vim
startup plugins startup
opts table or opts should be a table (will be merged with parent opts table or opts should be a table (will be merged with parent
fun(LazyPlugin, opts:table) specs), return a table (replaces parent specs) or should fun(LazyPlugin, opts:table) specs), return a table (replaces parent specs) or should
@ -540,9 +540,7 @@ function.
keys = { keys = {
{ "<leader>ft", "<cmd>Neotree toggle<cr>", desc = "NeoTree" }, { "<leader>ft", "<cmd>Neotree toggle<cr>", desc = "NeoTree" },
}, },
config = function() opts = {},
require("neo-tree").setup()
end,
} }
< <
@ -646,24 +644,42 @@ will be added to the plugins spec.
-- then set the below to false. This should work, but is NOT supported and will -- then set the below to false. This should work, but is NOT supported and will
-- increase downloads a lot. -- increase downloads a lot.
filter = true, filter = true,
-- rate of network related git operations (clone, fetch, checkout)
throttle = {
enabled = false, -- not enabled by default
-- max 2 ops every 5 seconds
rate = 2,
duration = 5 * 1000, -- in ms
},
-- Time in seconds to wait before running fetch again for a plugin.
-- Repeated update/check operations will not run again until this
-- cooldown period has passed.
cooldown = 0,
}, },
pkg = { pkg = {
enabled = true, enabled = true,
cache = vim.fn.stdpath("state") .. "/lazy/pkg-cache.lua", cache = vim.fn.stdpath("state") .. "/lazy/pkg-cache.lua",
versions = true, -- Honor versions in pkg sources
-- the first package source that is found for a plugin will be used. -- the first package source that is found for a plugin will be used.
sources = { sources = {
"lazy", "lazy",
"rockspec", "rockspec", -- will only be used when rocks.enabled is true
"packspec", "packspec",
}, },
}, },
rocks = { rocks = {
enabled = true,
root = vim.fn.stdpath("data") .. "/lazy-rocks", root = vim.fn.stdpath("data") .. "/lazy-rocks",
server = "https://nvim-neorocks.github.io/rocks-binaries/", server = "https://nvim-neorocks.github.io/rocks-binaries/",
-- use hererocks to install luarocks?
-- set to `nil` to use hererocks when luarocks is not found
-- set to `true` to always use hererocks
-- set to `false` to always use luarocks
hererocks = nil,
}, },
dev = { dev = {
---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects -- Directory where you store your local plugin projects. If a function is used,
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
---@type string | fun(plugin: LazyPlugin): string
path = "~/projects", path = "~/projects",
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub ---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = {}, -- For example {"folke"} patterns = {}, -- For example {"folke"}
@ -690,6 +706,7 @@ will be added to the plugins spec.
icons = { icons = {
cmd = " ", cmd = " ",
config = "", config = "",
debug = "● ",
event = " ", event = " ",
favorite = " ", favorite = " ",
ft = " ", ft = " ",
@ -715,7 +732,7 @@ will be added to the plugins spec.
-- leave nil, to automatically select a browser depending on your OS. -- leave nil, to automatically select a browser depending on your OS.
-- If you want to use a specific browser, you can define it here -- If you want to use a specific browser, you can define it here
browser = nil, ---@type string? browser = nil, ---@type string?
throttle = 20, -- how frequently should the ui process render events throttle = 1000 / 30, -- how frequently should the ui process render events
custom_keys = { custom_keys = {
-- You can define custom key maps here. If present, the description will -- You can define custom key maps here. If present, the description will
-- be shown in the help menu. -- be shown in the help menu.
@ -730,6 +747,16 @@ will be added to the plugins spec.
desc = "Open lazygit log", desc = "Open lazygit log",
}, },
["<localleader>i"] = {
function(plugin)
Util.notify(vim.inspect(plugin), {
title = "Inspect " .. plugin.name,
lang = "lua",
})
end,
desc = "Inspect Plugin",
},
["<localleader>t"] = { ["<localleader>t"] = {
function(plugin) function(plugin)
require("lazy.util").float_term(nil, { require("lazy.util").float_term(nil, {
@ -740,6 +767,17 @@ will be added to the plugins spec.
}, },
}, },
}, },
-- Output options for headless mode
headless = {
-- show the output from process commands like git
process = true,
-- show log messages
log = true,
-- show task start/end
task = true,
-- use ansi colors
colors = true,
},
diff = { diff = {
-- diff command <d> can be one of: -- diff command <d> can be one of:
-- * browser: opens the github compare view. Note that this is always mapped to <K> as well, -- * browser: opens the github compare view. Note that this is always mapped to <K> as well,
@ -791,7 +829,7 @@ will be added to the plugins spec.
enabled = true, enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme", root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" }, files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs -- only generate markdown helptags for plugins that don't have docs
skip_if_doc_exists = true, skip_if_doc_exists = true,
}, },
state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things
@ -837,6 +875,8 @@ If you dont want to use a Nerd Font, you can replace the icons with Unicode s
----------------------------------------------------------------------- -----------------------------------------------------------------------
Highlight Group Default Group Description Highlight Group Default Group Description
----------------------- ----------------------- ----------------------- ----------------------- ----------------------- -----------------------
LazyBold { bold = true }
LazyButton CursorLine LazyButton CursorLine
LazyButtonActive Visual LazyButtonActive Visual
@ -857,10 +897,16 @@ If you dont want to use a Nerd Font, you can replace the icons with Unicode s
LazyDir @markup.link directory LazyDir @markup.link directory
LazyError DiagnosticError task errors
LazyH1 IncSearch home button LazyH1 IncSearch home button
LazyH2 Bold titles LazyH2 Bold titles
LazyInfo DiagnosticInfo task errors
LazyItalic { italic = true }
LazyLocal Constant LazyLocal Constant
LazyNoCond DiagnosticWarn unloaded icon for a LazyNoCond DiagnosticWarn unloaded icon for a
@ -897,13 +943,13 @@ If you dont want to use a Nerd Font, you can replace the icons with Unicode s
LazySpecial @punctuation.special LazySpecial @punctuation.special
LazyTaskError ErrorMsg task errors
LazyTaskOutput MsgArea task output LazyTaskOutput MsgArea task output
LazyUrl @markup.link url LazyUrl @markup.link url
LazyValue @string value of a property LazyValue @string value of a property
LazyWarning DiagnosticWarn task errors
----------------------------------------------------------------------- -----------------------------------------------------------------------
============================================================================== ==============================================================================

File diff suppressed because it is too large Load diff

View file

@ -34,6 +34,17 @@ M.defaults = {
-- then set the below to false. This should work, but is NOT supported and will -- then set the below to false. This should work, but is NOT supported and will
-- increase downloads a lot. -- increase downloads a lot.
filter = true, filter = true,
-- rate of network related git operations (clone, fetch, checkout)
throttle = {
enabled = false, -- not enabled by default
-- max 2 ops every 5 seconds
rate = 2,
duration = 5 * 1000, -- in ms
},
-- Time in seconds to wait before running fetch again for a plugin.
-- Repeated update/check operations will not run again until this
-- cooldown period has passed.
cooldown = 0,
}, },
pkg = { pkg = {
enabled = true, enabled = true,
@ -56,7 +67,9 @@ M.defaults = {
hererocks = nil, hererocks = nil,
}, },
dev = { dev = {
---@type string | fun(plugin: LazyPlugin): string directory where you store your local plugin projects -- Directory where you store your local plugin projects. If a function is used,
-- the plugin directory (e.g. `~/projects/plugin-name`) must be returned.
---@type string | fun(plugin: LazyPlugin): string
path = "~/projects", path = "~/projects",
---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub ---@type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = {}, -- For example {"folke"} patterns = {}, -- For example {"folke"}
@ -83,6 +96,7 @@ M.defaults = {
icons = { icons = {
cmd = "", cmd = "",
config = "", config = "",
debug = "",
event = "", event = "",
favorite = "", favorite = "",
ft = "", ft = "",
@ -205,7 +219,7 @@ M.defaults = {
enabled = true, enabled = true,
root = vim.fn.stdpath("state") .. "/lazy/readme", root = vim.fn.stdpath("state") .. "/lazy/readme",
files = { "README.md", "lua/**/README.md" }, files = { "README.md", "lua/**/README.md" },
-- only generate markdown helptags for plugins that dont have docs -- only generate markdown helptags for plugins that don't have docs
skip_if_doc_exists = true, skip_if_doc_exists = true,
}, },
state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things state = vim.fn.stdpath("state") .. "/lazy/state.json", -- state info for checker and other things
@ -228,7 +242,7 @@ function M.hererocks()
return M.options.rocks.hererocks return M.options.rocks.hererocks
end end
M.version = "11.10.2" -- x-release-please-version M.version = "11.17.1" -- x-release-please-version
M.ns = vim.api.nvim_create_namespace("lazy") M.ns = vim.api.nvim_create_namespace("lazy")
@ -253,9 +267,10 @@ M.mapleader = nil
---@type string ---@type string
M.maplocalleader = nil M.maplocalleader = nil
local headless = #vim.api.nvim_list_uis() == 0 M.suspended = false
function M.headless() function M.headless()
return headless return not M.suspended and #vim.api.nvim_list_uis() == 0
end end
---@param opts? LazyConfig ---@param opts? LazyConfig
@ -283,6 +298,9 @@ function M.setup(opts)
M.me = debug.getinfo(1, "S").source:sub(2) M.me = debug.getinfo(1, "S").source:sub(2)
M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h")) M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h"))
local lib = vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib"
lib = vim.uv.fs_stat(lib .. "64") and (lib .. "64") or lib
lib = lib .. "/nvim"
if M.options.performance.rtp.reset then if M.options.performance.rtp.reset then
---@type vim.Option ---@type vim.Option
vim.opt.rtp = { vim.opt.rtp = {
@ -290,7 +308,7 @@ function M.setup(opts)
vim.fn.stdpath("data") .. "/site", vim.fn.stdpath("data") .. "/site",
M.me, M.me,
vim.env.VIMRUNTIME, vim.env.VIMRUNTIME,
vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim", lib,
vim.fn.stdpath("config") .. "/after", vim.fn.stdpath("config") .. "/after",
} }
end end
@ -338,6 +356,12 @@ function M.setup(opts)
end end
end, end,
}) })
vim.api.nvim_create_autocmd({ "VimSuspend", "VimResume" }, {
callback = function(ev)
M.suspended = ev.event == "VimSuspend"
end,
})
end, end,
}) })
end end

View file

@ -5,7 +5,7 @@ local Util = require("lazy.core.util")
---@field type LazyHandlerTypes ---@field type LazyHandlerTypes
---@field extends? LazyHandler ---@field extends? LazyHandler
---@field active table<string,table<string,string>> ---@field active table<string,table<string,string>>
---@field managed table<string,string> ---@field managed table<string,string> mapping handler keys to plugin names
---@field super LazyHandler ---@field super LazyHandler
local M = {} local M = {}
@ -114,7 +114,7 @@ function M:add(plugin)
if not self.active[key] then if not self.active[key] then
self.active[key] = {} self.active[key] = {}
self:_add(value) self:_add(value)
self.managed[key] = key self.managed[key] = plugin.name
end end
self.active[key][plugin.name] = plugin.name self.active[key][plugin.name] = plugin.name
end end

View file

@ -11,7 +11,7 @@ local Util = require("lazy.core.util")
---@class LazyKeysSpec: LazyKeysBase ---@class LazyKeysSpec: LazyKeysBase
---@field [1] string lhs ---@field [1] string lhs
---@field [2]? string|fun()|false rhs ---@field [2]? string|fun():string?|false rhs
---@field mode? string|string[] ---@field mode? string|string[]
---@class LazyKeys: LazyKeysBase ---@class LazyKeys: LazyKeysBase

View file

@ -161,7 +161,7 @@ function M.get_start_plugins()
---@type LazyPlugin[] ---@type LazyPlugin[]
local start = {} local start = {}
for _, plugin in pairs(Config.plugins) do for _, plugin in pairs(Config.plugins) do
if plugin.lazy == false and not plugin._.loaded then if not plugin._.loaded and (plugin._.rtp_loaded or plugin.lazy == false) then
start[#start + 1] = plugin start[#start + 1] = plugin
end end
end end
@ -341,7 +341,9 @@ function M._load(plugin, reason, opts)
Util.track({ plugin = plugin.name, start = reason.start }) Util.track({ plugin = plugin.name, start = reason.start })
Handler.disable(plugin) Handler.disable(plugin)
if not plugin.virtual then
M.add_to_rtp(plugin) M.add_to_rtp(plugin)
end
if plugin._.pkg and plugin._.pkg.source == "rockspec" then if plugin._.pkg and plugin._.pkg.source == "rockspec" then
M.add_to_luapath(plugin) M.add_to_luapath(plugin)
@ -353,7 +355,9 @@ function M._load(plugin, reason, opts)
end, "Failed to load deps for " .. plugin.name) end, "Failed to load deps for " .. plugin.name)
end end
if not plugin.virtual then
M.packadd(plugin.dir) M.packadd(plugin.dir)
end
if plugin.config or plugin.opts then if plugin.config or plugin.opts then
M.config(plugin) M.config(plugin)
end end
@ -493,8 +497,11 @@ function M.add_to_luapath(plugin)
local root = Config.options.rocks.root .. "/" .. plugin.name local root = Config.options.rocks.root .. "/" .. plugin.name
local path = root .. "/share/lua/5.1" local path = root .. "/share/lua/5.1"
local cpath = root .. "/lib/lua/5.1" local cpath = root .. "/lib/lua/5.1"
local cpath2 = root .. "/lib64/lua/5.1"
package.path = package.path .. ";" .. path .. "/?.lua;" .. path .. "/?/init.lua;" package.path = package.path .. ";" .. path .. "/?.lua;" .. path .. "/?/init.lua;"
package.cpath = package.cpath .. ";" .. cpath .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";" package.cpath = package.cpath .. ";" .. cpath .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
package.cpath = package.cpath .. ";" .. cpath2 .. "/?." .. (jit.os:find("Windows") and "dll" or "so") .. ";"
end end
function M.source(path) function M.source(path)
@ -552,6 +559,8 @@ function M.loader(modname)
end end
if ret then if ret then
-- explicitly set to nil to prevent loading errors
package.loaded[modname] = nil
M.auto_load(modname, ret.modpath) M.auto_load(modname, ret.modpath)
local mod = package.loaded[modname] local mod = package.loaded[modname]
if type(mod) == "table" then if type(mod) == "table" then

View file

@ -179,6 +179,7 @@ function M:_rebuild(name)
local super = nil local super = nil
plugin.url = nil plugin.url = nil
plugin._.dep = true plugin._.dep = true
plugin._.top = true
plugin.optional = true plugin.optional = true
assert(#plugin._.frags > 0, "no fragments found for plugin " .. name) assert(#plugin._.frags > 0, "no fragments found for plugin " .. name)
@ -195,6 +196,7 @@ function M:_rebuild(name)
plugin._.dep = plugin._.dep and fragment.dep plugin._.dep = plugin._.dep and fragment.dep
plugin.optional = plugin.optional and (rawget(fragment.spec, "optional") == true) plugin.optional = plugin.optional and (rawget(fragment.spec, "optional") == true)
plugin.url = fragment.url or plugin.url plugin.url = fragment.url or plugin.url
plugin._.top = plugin._.top and fragment.pid == nil
-- dependencies -- dependencies
for _, dep in ipairs(fragment.deps or {}) do for _, dep in ipairs(fragment.deps or {}) do
@ -213,6 +215,8 @@ function M:_rebuild(name)
plugin.dir = super.dir plugin.dir = super.dir
if plugin.dir then if plugin.dir then
plugin.dir = Util.norm(plugin.dir) plugin.dir = Util.norm(plugin.dir)
elseif super.virtual then
plugin.dir = Util.norm("/dev/null/" .. plugin.name)
else else
if plugin.dev == nil and plugin.url then if plugin.dev == nil and plugin.url then
for _, pattern in ipairs(Config.options.dev.patterns) do for _, pattern in ipairs(Config.options.dev.patterns) do
@ -300,13 +304,26 @@ end
--- Removes plugins that are disabled. --- Removes plugins that are disabled.
function M:fix_disabled() function M:fix_disabled()
local changes = 0 local changes = 0
local function check(top)
for _, plugin in pairs(self.plugins) do for _, plugin in pairs(self.plugins) do
if (plugin._.top or false) == top then
if plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled()) then if plugin.enabled == false or (type(plugin.enabled) == "function" and not plugin.enabled()) then
changes = changes + 1 changes = changes + 1
if plugin.optional then
self:del(plugin.name)
else
self:disable(plugin) self:disable(plugin)
end end
end
self:rebuild() self:rebuild()
end
end
end
end
-- disable top-level plugins first, since they may have non-top-level frags
-- that disable other plugins
check(true)
-- then disable non-top-level plugins
check(false)
return changes return changes
end end

View file

@ -146,33 +146,43 @@ function Spec:import(spec)
local imported = 0 local imported = 0
---@type (string|(fun():LazyPluginSpec))[] ---@type {modname: string, load: fun():(LazyPluginSpec?, string?)}[]
local modspecs = {} local modspecs = {}
if type(import) == "string" then if type(import) == "string" then
Util.lsmod(import, function(modname, modpath) Util.lsmod(import, function(modname, modpath)
modspecs[#modspecs + 1] = modname modspecs[#modspecs + 1] = {
package.preload[modname] = function() modname = modname,
return loadfile(modpath)() load = function()
end local mod, err = loadfile(modpath)
end) if mod then
table.sort(modspecs) return mod()
else else
modspecs = { spec.import } return nil, err
end
end,
}
end)
table.sort(modspecs, function(a, b)
return a.modname < b.modname
end)
else
modspecs = { { modname = import_name, load = spec.import } }
end end
for _, modspec in ipairs(modspecs) do for _, modspec in ipairs(modspecs) do
imported = imported + 1 imported = imported + 1
local modname = type(modspec) == "string" and modspec or import_name local modname = modspec.modname
Util.track({ import = modname }) Util.track({ import = modname })
self.importing = modname self.importing = modname
-- unload the module so we get a clean slate -- unload the module so we get a clean slate
---@diagnostic disable-next-line: no-unknown ---@diagnostic disable-next-line: no-unknown
package.loaded[modname] = nil package.loaded[modname] = nil
Util.try(function() Util.try(function()
local mod = type(modspec) == "function" and modspec() or require(modspec) local mod, err = modspec.load()
if type(mod) ~= "table" then if err then
self.importing = nil self:error("Failed to load `" .. modname .. "`:\n" .. err)
elseif type(mod) ~= "table" then
return self:error( return self:error(
"Invalid spec module: `" "Invalid spec module: `"
.. modname .. modname
@ -180,21 +190,20 @@ function Spec:import(spec)
.. type(mod) .. type(mod)
.. "` was returned instead" .. "` was returned instead"
) )
end else
self:normalize(mod) self:normalize(mod)
self.importing = nil end
Util.track()
end, { end, {
msg = "Failed to load `" .. modname .. "`", msg = "Failed to load `" .. modname .. "`",
on_error = function(msg) on_error = function(msg)
self:error(msg) self:error(msg)
self.importing = nil
Util.track()
end, end,
}) })
self.importing = nil
Util.track()
end end
if imported == 0 then if imported == 0 then
self:error("No specs found for module " .. spec.import) self:error("No specs found for module " .. vim.inspect(spec.import))
end end
end end
@ -228,12 +237,15 @@ function M.update_state()
or plugin.cmd or plugin.cmd
plugin.lazy = lazy and true or false plugin.lazy = lazy and true or false
end end
if plugin.dir:find(Config.options.root, 1, true) == 1 then if plugin.virtual then
plugin._.is_local = true
plugin._.installed = true -- local plugins are managed by the user
elseif plugin.dir:find(Config.options.root, 1, true) == 1 then
plugin._.installed = installed[plugin.name] ~= nil plugin._.installed = installed[plugin.name] ~= nil
installed[plugin.name] = nil installed[plugin.name] = nil
else else
plugin._.is_local = true plugin._.is_local = true
plugin._.installed = true -- local plugins are managed by the user plugin._.installed = vim.fn.isdirectory(plugin.dir) == 1
end end
end end

View file

@ -66,7 +66,7 @@ end
---@param name string ---@param name string
---@return string ---@return string
function M.normname(name) function M.normname(name)
local ret = name:lower():gsub("^n?vim%-", ""):gsub("%.n?vim$", ""):gsub("%.lua", ""):gsub("[^a-z]+", "") local ret = name:lower():gsub("^n?vim%-", ""):gsub("%.n?vim$", ""):gsub("[%.%-]lua", ""):gsub("[^a-z]+", "")
return ret return ret
end end
@ -270,7 +270,7 @@ function M.get_unloaded_rtp(modname, opts)
local Config = require("lazy.core.config") local Config = require("lazy.core.config")
if Config.spec then if Config.spec then
for _, plugin in pairs(Config.spec.plugins) do for _, plugin in pairs(Config.spec.plugins) do
if not (plugin._.loaded or plugin.module == false) then if not (plugin._.loaded or plugin.module == false or plugin.virtual) then
if norm == M.normname(plugin.name) then if norm == M.normname(plugin.name) then
table.insert(rtp, 1, plugin.dir) table.insert(rtp, 1, plugin.dir)
else else
@ -374,6 +374,7 @@ function M.notify(msg, opts)
local lang = opts.lang or "markdown" local lang = opts.lang or "markdown"
local n = opts.once and vim.notify_once or vim.notify local n = opts.once and vim.notify_once or vim.notify
n(msg, opts.level or vim.log.levels.INFO, { n(msg, opts.level or vim.log.levels.INFO, {
ft = lang,
on_open = function(win) on_open = function(win)
local ok = pcall(function() local ok = pcall(function()
vim.treesitter.language.add("markdown") vim.treesitter.language.add("markdown")

View file

@ -131,7 +131,8 @@ function M.colors(opts)
{ "---", "---", "---" }, { "---", "---", "---" },
} }
Util.foreach(require(opts.modname).colors, function(group, link) Util.foreach(require(opts.modname).colors, function(group, link)
lines[#lines + 1] = { "**" .. opts.name .. group .. "**", "***" .. link .. "***", comments[group] or "" } link = type(link) == "table" and "`" .. vim.inspect(link):gsub("%s+", " ") .. "`" or "***" .. link .. "***"
lines[#lines + 1] = { "**" .. opts.name .. group .. "**", link, comments[group] or "" }
end) end)
return { content = M.table(lines) } return { content = M.table(lines) }
end end

View file

@ -1,4 +1,5 @@
local Config = require("lazy.core.config") local Config = require("lazy.core.config")
local Process = require("lazy.manage.process")
local uv = vim.uv or vim.loop local uv = vim.uv or vim.loop
local M = {} local M = {}
@ -36,11 +37,11 @@ function M.have(cmd, opts)
local found local found
for _, c in ipairs(cmd) do for _, c in ipairs(cmd) do
if vim.fn.executable(c) == 1 then if vim.fn.executable(c) == 1 then
local version = vim.fn.system(c .. " " .. opts.version) or "" local out, exit_code = Process.exec({ c, opts.version })
if vim.v.shell_error ~= 0 then if exit_code ~= 0 then
opts.error(("failed to get version of {%s}\n%s"):format(c, version)) opts.error(("failed to get version of {%s}\n%s"):format(c, table.concat(out, "\n")))
else else
version = vim.trim(vim.split(version, "\n")[1]) local version = vim.trim(out[1] or "")
version = version:gsub("^%s*" .. vim.pesc(c) .. "%s*", "") version = version:gsub("^%s*" .. vim.pesc(c) .. "%s*", "")
if opts.version_pattern and not version:find(opts.version_pattern, 1, true) then if opts.version_pattern and not version:find(opts.version_pattern, 1, true) then
opts.warn(("`%s` version `%s` needed, but found `%s`"):format(c, opts.version_pattern, version)) opts.warn(("`%s` version `%s` needed, but found `%s`"):format(c, opts.version_pattern, version))

View file

@ -35,7 +35,9 @@ end
function M.fast_check(opts) function M.fast_check(opts)
opts = opts or {} opts = opts or {}
for _, plugin in pairs(Config.plugins) do for _, plugin in pairs(Config.plugins) do
if not plugin.pin and not plugin.dev and plugin._.installed then -- don't check local plugins here, since we mark them as needing updates
-- only if local is behind upstream (if the git log task gives no output)
if plugin._.installed and not (plugin.pin or plugin._.is_local) then
plugin._.updates = nil plugin._.updates = nil
local info = Git.info(plugin.dir) local info = Git.info(plugin.dir)
local ok, target = pcall(Git.get_target, plugin) local ok, target = pcall(Git.get_target, plugin)

View file

@ -116,6 +116,12 @@ end
---@param plugin LazyPlugin ---@param plugin LazyPlugin
---@return GitInfo? ---@return GitInfo?
function M.get_target(plugin) function M.get_target(plugin)
if plugin._.is_local then
local info = M.info(plugin.dir)
local branch = assert(info and info.branch or M.get_branch(plugin))
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
end
local branch = assert(M.get_branch(plugin)) local branch = assert(M.get_branch(plugin))
if plugin.commit then if plugin.commit then
@ -144,15 +150,6 @@ function M.get_target(plugin)
} }
end end
end end
---@diagnostic disable-next-line: return-type-mismatch
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
end
---@param plugin LazyPlugin
---@return GitInfo?
function M.get_local_target(plugin)
local info = M.info(plugin.dir)
local branch = assert(info and info.branch or M.get_branch(plugin))
return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) } return { branch = branch, commit = M.get_commit(plugin.dir, branch, true) }
end end

View file

@ -80,6 +80,7 @@ function M.install(opts)
opts = M.opts(opts, { mode = "install" }) opts = M.opts(opts, { mode = "install" })
return M.run({ return M.run({
pipeline = { pipeline = {
"plugin.exists",
"git.clone", "git.clone",
{ "git.checkout", lockfile = opts.lockfile }, { "git.checkout", lockfile = opts.lockfile },
"plugin.docs", "plugin.docs",
@ -108,6 +109,7 @@ function M.update(opts)
opts = M.opts(opts, { mode = "update" }) opts = M.opts(opts, { mode = "update" })
return M.run({ return M.run({
pipeline = { pipeline = {
"plugin.exists",
"git.origin", "git.origin",
"git.branch", "git.branch",
"git.fetch", "git.fetch",
@ -147,6 +149,7 @@ function M.check(opts)
opts = opts or {} opts = opts or {}
return M.run({ return M.run({
pipeline = { pipeline = {
"plugin.exists",
{ "git.origin", check = true }, { "git.origin", check = true },
"git.fetch", "git.fetch",
"git.status", "git.status",

View file

@ -42,7 +42,7 @@ function M.update()
f:write(",\n") f:write(",\n")
end end
end end
f:write("\n}") f:write("\n}\n")
f:close() f:close()
end end

View file

@ -21,16 +21,23 @@ M.clean = {
skip = function(plugin) skip = function(plugin)
return plugin._.is_local return plugin._.is_local
end, end,
run = function(self) ---@param opts? {rocks_only?:boolean}
run = function(self, opts)
opts = opts or {}
local dir = self.plugin.dir:gsub("/+$", "") local dir = self.plugin.dir:gsub("/+$", "")
assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!") assert(dir:find(Config.options.root, 1, true) == 1, self.plugin.dir .. " should be under packpath!")
rm(dir)
local rock_root = Config.options.rocks.root .. "/" .. self.plugin.name local rock_root = Config.options.rocks.root .. "/" .. self.plugin.name
if vim.uv.fs_stat(rock_root) then if vim.uv.fs_stat(rock_root) then
rm(rock_root) rm(rock_root)
end end
if opts.rocks_only then
return
end
rm(dir)
self.plugin._.installed = false self.plugin._.installed = false
end, end,
} }

View file

@ -1,8 +1,54 @@
local Async = require("lazy.async")
local Config = require("lazy.core.config") local Config = require("lazy.core.config")
local Git = require("lazy.manage.git") local Git = require("lazy.manage.git")
local Lock = require("lazy.manage.lock") local Lock = require("lazy.manage.lock")
local Util = require("lazy.util") local Util = require("lazy.util")
local throttle = {}
throttle.running = 0
throttle.waiting = {} ---@type Async[]
throttle.timer = vim.uv.new_timer()
function throttle.next()
throttle.running = 0
while #throttle.waiting > 0 and throttle.running < Config.options.git.throttle.rate do
---@type Async
local task = table.remove(throttle.waiting, 1)
task:resume()
throttle.running = throttle.running + 1
end
if throttle.running == 0 then
throttle.timer:stop()
end
end
function throttle.wait()
if not Config.options.git.throttle.enabled then
return
end
if not throttle.timer:is_active() then
throttle.timer:start(0, Config.options.git.throttle.duration, vim.schedule_wrap(throttle.next))
end
local running = Async.running()
if throttle.running < Config.options.git.throttle.rate then
throttle.running = throttle.running + 1
else
table.insert(throttle.waiting, running)
coroutine.yield("waiting")
running:suspend()
coroutine.yield("")
end
end
---@param plugin LazyPlugin
local function cooldown(plugin)
if not plugin._.last_check then
return false
end
local delta = (vim.uv.now() - plugin._.last_check) / 1000
return delta < Config.options.git.cooldown
end
---@type table<string, LazyTaskDef> ---@type table<string, LazyTaskDef>
local M = {} local M = {}
@ -32,11 +78,13 @@ M.log = {
"--no-show-signature", "--no-show-signature",
} }
local info, target
if opts.updated then if opts.updated then
table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD")) table.insert(args, self.plugin._.updated.from .. ".." .. (self.plugin._.updated.to or "HEAD"))
elseif opts.check then elseif opts.check then
local info = assert(Git.info(self.plugin.dir)) info = assert(Git.info(self.plugin.dir))
local target = assert(self.plugin._.is_local and Git.get_local_target(self.plugin) or Git.get_target(self.plugin)) target = assert(Git.get_target(self.plugin))
if not target.commit then if not target.commit then
for k, v in pairs(target) do for k, v in pairs(target) do
error(k .. " '" .. v .. "' not found") error(k .. " '" .. v .. "' not found")
@ -44,6 +92,7 @@ M.log = {
error("no target commit found") error("no target commit found")
end end
assert(target.commit, self.plugin.name .. " " .. target.branch) assert(target.commit, self.plugin.name .. " " .. target.branch)
if not self.plugin._.is_local then
if Git.eq(info, target) then if Git.eq(info, target) then
if Config.options.checker.check_pinned then if Config.options.checker.check_pinned then
local last_commit = Git.get_commit(self.plugin.dir, target.branch, true) local last_commit = Git.get_commit(self.plugin.dir, target.branch, true)
@ -54,6 +103,7 @@ M.log = {
else else
self.plugin._.updates = { from = info, to = target } self.plugin._.updates = { from = info, to = target }
end end
end
table.insert(args, info.commit .. ".." .. target.commit) table.insert(args, info.commit .. ".." .. target.commit)
else else
vim.list_extend(args, opts.args or Config.options.git.log) vim.list_extend(args, opts.args or Config.options.git.log)
@ -63,6 +113,14 @@ M.log = {
args = args, args = args,
cwd = self.plugin.dir, cwd = self.plugin.dir,
}) })
-- for local plugins, mark as needing updates only if local is
-- behind upstream, i.e. if git log gave no output
if opts.check and self.plugin._.is_local then
if not vim.tbl_isempty(self:get_log()) then
self.plugin._.updates = { from = info, to = target }
end
end
end, end,
} }
@ -72,6 +130,7 @@ M.clone = {
end, end,
---@async ---@async
run = function(self) run = function(self)
throttle.wait()
local args = { local args = {
"clone", "clone",
self.plugin.url, self.plugin.url,
@ -216,11 +275,12 @@ M.status = {
-- fetches all needed origin branches -- fetches all needed origin branches
M.fetch = { M.fetch = {
skip = function(plugin) skip = function(plugin)
return not plugin._.installed or plugin._.is_local return not plugin._.installed or plugin._.is_local or cooldown(plugin)
end, end,
---@async ---@async
run = function(self) run = function(self)
throttle.wait()
local args = { local args = {
"fetch", "fetch",
"--recurse-submodules", "--recurse-submodules",
@ -236,6 +296,11 @@ M.fetch = {
self:spawn("git", { self:spawn("git", {
args = args, args = args,
cwd = self.plugin.dir, cwd = self.plugin.dir,
on_exit = function(ok)
if ok then
self.plugin._.last_check = vim.uv.now()
end
end,
}) })
end, end,
} }
@ -250,6 +315,7 @@ M.checkout = {
---@async ---@async
---@param opts {lockfile?:boolean} ---@param opts {lockfile?:boolean}
run = function(self, opts) run = function(self, opts)
throttle.wait()
local info = assert(Git.info(self.plugin.dir)) local info = assert(Git.info(self.plugin.dir))
local target = assert(Git.get_target(self.plugin)) local target = assert(Git.get_target(self.plugin))
@ -269,7 +335,7 @@ M.checkout = {
end end
end end
-- dont run checkout if target is already reached. -- don't run checkout if target is already reached.
-- unless we just cloned, since then we won't have any data yet -- unless we just cloned, since then we won't have any data yet
if Git.eq(info, target) and info.branch == target.branch then if Git.eq(info, target) and info.branch == target.branch then
self.plugin._.updated = { self.plugin._.updated = {

View file

@ -19,6 +19,9 @@ local B = {}
---@param task LazyTask ---@param task LazyTask
---@param build string ---@param build string
function B.cmd(task, build) function B.cmd(task, build)
if task.plugin.build ~= "rockspec" then
Loader.load(task.plugin, { task = "build" })
end
local cmd = vim.api.nvim_parse_cmd(build:sub(2), {}) --[[@as vim.api.keyset.cmd]] local cmd = vim.api.nvim_parse_cmd(build:sub(2), {}) --[[@as vim.api.keyset.cmd]]
task:log(vim.api.nvim_cmd(cmd, { output = true })) task:log(vim.api.nvim_cmd(cmd, { output = true }))
end end
@ -48,10 +51,6 @@ M.build = {
run = function(self) run = function(self)
vim.cmd([[silent! runtime plugin/rplugin.vim]]) vim.cmd([[silent! runtime plugin/rplugin.vim]])
if self.plugin.build ~= "rockspec" then
Loader.load(self.plugin, { task = "build" })
end
local builders = self.plugin.build local builders = self.plugin.build
-- Skip if `build` is set to `false` -- Skip if `build` is set to `false`
@ -88,14 +87,25 @@ M.build = {
M.docs = { M.docs = {
skip = function(plugin) skip = function(plugin)
return not plugin._.dirty return not plugin._.is_local and not plugin._.dirty
end, end,
run = function(self) run = function(self)
local docs = self.plugin.dir .. "/doc/" local docs = self.plugin.dir .. "/doc"
if Util.file_exists(docs) then if Util.file_exists(docs) then
self:log(vim.api.nvim_cmd({ cmd = "helptags", args = { docs } }, { output = true })) self:log(vim.api.nvim_cmd({ cmd = "helptags", args = { docs } }, { output = true }))
end end
end, end,
} }
M.exists = {
skip = function(plugin)
return not plugin._.is_local or plugin.virtual
end,
run = function(self)
if not Util.file_exists(self.plugin.dir) then
self:error("Local plugin does not exist at `" .. self.plugin.dir .. "`")
end
end,
}
return M return M

View file

@ -25,13 +25,19 @@ function M.setup(opts)
opts = M.extend({ opts = M.extend({
local_spec = false, local_spec = false,
change_detection = { enabled = false }, change_detection = { enabled = false },
dev = {
patterns = vim.env.LAZY_DEV and vim.split(vim.env.LAZY_DEV, ",") or nil,
},
}, opts) }, opts)
local args = {} local args = {}
local is_busted = false local is_busted = false
local is_minitest = false
for _, a in ipairs(_G.arg) do for _, a in ipairs(_G.arg) do
if a == "--busted" then if a == "--busted" then
is_busted = true is_busted = true
elseif a == "--minitest" then
is_minitest = true
else else
table.insert(args, a) table.insert(args, a)
end end
@ -40,6 +46,8 @@ function M.setup(opts)
if is_busted then if is_busted then
opts = M.busted.setup(opts) opts = M.busted.setup(opts)
elseif is_minitest then
opts = M.minitest.setup(opts)
end end
-- set stdpaths to use .tests -- set stdpaths to use .tests
@ -49,7 +57,6 @@ function M.setup(opts)
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end end
end end
vim.o.loadplugins = true vim.o.loadplugins = true
require("lazy").setup(opts) require("lazy").setup(opts)
if vim.g.colors_name == nil then if vim.g.colors_name == nil then
@ -68,6 +75,8 @@ function M.setup(opts)
if is_busted then if is_busted then
M.busted.run() M.busted.run()
elseif is_minitest then
M.minitest.run()
end end
end end
@ -89,6 +98,70 @@ function M.repro(opts)
M.setup(opts) M.setup(opts)
end end
M.minitest = {}
function M.minitest.run()
local Config = require("lazy.core.config")
-- disable termnial output for the tests
Config.options.headless = {}
if not require("lazy.core.config").headless() then
return vim.notify("busted can only run in headless mode. Please run with `nvim -l`", vim.log.levels.WARN)
end
package.path = package.path .. ";" .. vim.uv.cwd() .. "/tests/?.lua"
local Test = require("mini.test")
local expect = Test.expect
local _assert = assert
local Assert = {
__call = function(_, ...)
return _assert(...)
end,
same = expect.equality,
equal = expect.equality,
are = {
equal = expect.equality,
},
is_not = {
same = expect.no_equality,
},
is_not_nil = function(a)
return expect.no_equality(nil, a)
end,
is_true = function(a)
return expect.equality(true, a)
end,
is_false = function(a)
return expect.equality(false, a)
end,
}
Assert.__index = Assert
assert = setmetatable({}, Assert)
assert = require("luassert")
require("mini.test").run()
end
---@param opts LazyConfig
function M.minitest.setup(opts)
return M.extend({
spec = {
"lunarmodules/luassert",
{
"echasnovski/mini.test",
opts = {
collect = {
find_files = function()
return vim.fn.globpath("tests", "**/*_spec.lua", true, true)
end,
},
-- script_path = "tests/minit.lua",
},
},
{ dir = vim.uv.cwd() },
},
rocks = { hererocks = true },
}, opts)
end
M.busted = {} M.busted = {}
function M.busted.run() function M.busted.run()
@ -99,6 +172,7 @@ function M.busted.run()
if not require("lazy.core.config").headless() then if not require("lazy.core.config").headless() then
return vim.notify("busted can only run in headless mode. Please run with `nvim -l`", vim.log.levels.WARN) return vim.notify("busted can only run in headless mode. Please run with `nvim -l`", vim.log.levels.WARN)
end end
package.path = package.path .. ";" .. vim.uv.cwd() .. "/tests/?.lua"
-- run busted -- run busted
return pcall(require("busted.runner"), { return pcall(require("busted.runner"), {
standalone = false, standalone = false,

View file

@ -78,17 +78,16 @@ function M.check(opts)
else else
ok = Health.have(M.python, opts) ok = Health.have(M.python, opts)
ok = Health.have(M.hererocks.bin("luarocks")) and ok ok = Health.have(M.hererocks.bin("luarocks")) and ok
ok = Health.have( Health.have(
M.hererocks.bin("lua"), M.hererocks.bin("lua"),
vim.tbl_extend("force", opts, { vim.tbl_extend("force", opts, {
version = "-v", version = "-v",
version_pattern = "5.1", version_pattern = "5.1",
}) })
) and ok )
end end
else else
ok = Health.have("luarocks", opts) ok = Health.have("luarocks", opts)
ok = (
Health.have( Health.have(
{ "lua5.1", "lua", "lua-5.1" }, { "lua5.1", "lua", "lua-5.1" },
vim.tbl_extend("force", opts, { vim.tbl_extend("force", opts, {
@ -96,7 +95,6 @@ function M.check(opts)
version_pattern = "5.1", version_pattern = "5.1",
}) })
) )
) and ok
end end
return ok return ok
end end
@ -104,8 +102,7 @@ end
---@async ---@async
---@param task LazyTask ---@param task LazyTask
function M.build(task) function M.build(task)
if M.check({
not M.check({
error = function(msg) error = function(msg)
task:error(msg:gsub("[{}]", "`")) task:error(msg:gsub("[{}]", "`"))
end, end,
@ -114,7 +111,8 @@ function M.build(task)
end, end,
ok = function(msg) end, ok = function(msg) end,
}) })
then
if task:has_warnings() then
task:log({ task:log({
"", "",
"This plugin requires `luarocks`. Try one of the following:", "This plugin requires `luarocks`. Try one of the following:",
@ -123,7 +121,11 @@ function M.build(task)
or " - enable `hererocks` with `opts.rocks.hererocks = true`", or " - enable `hererocks` with `opts.rocks.hererocks = true`",
" - disable `luarocks` support completely with `opts.rocks.enabled = false`", " - disable `luarocks` support completely with `opts.rocks.enabled = false`",
}) })
return task:warn("\nWill try building anyway, but will likely fail...")
task:warn("\n" .. string.rep("-", 80) .. "\n")
task:set_level(vim.log.levels.WARN)
end end
if task.plugin.name == "hererocks" then if task.plugin.name == "hererocks" then
@ -170,7 +172,6 @@ function M.build(task)
root, root,
"--server", "--server",
Config.options.rocks.server, Config.options.rocks.server,
"--dev",
"--lua-version", "--lua-version",
"5.1", "5.1",
"install", -- use install so that we can make use of pre-built rocks "install", -- use install so that we can make use of pre-built rocks
@ -187,11 +188,13 @@ function M.build(task)
return return
end end
task:warn("Failed installing " .. rockspec.package .. " with `luarocks`.\nTrying to build from source.") task:warn("Failed installing " .. rockspec.package .. " with `luarocks`.")
task:warn("\n" .. string.rep("-", 80) .. "\n")
task:warn("Trying to build from source.")
-- install failed, so try building from source -- install failed, so try building from source
task:set_level() -- reset level task:set_level() -- reset level
task:spawn(luarocks, { ok = task:spawn(luarocks, {
args = { args = {
"--tree", "--tree",
root, root,
@ -206,6 +209,9 @@ function M.build(task)
cwd = task.plugin.dir, cwd = task.plugin.dir,
env = env, env = env,
}) })
if not ok then
require("lazy.manage.task.fs").clean.run(task, { rocks_only = true })
end
end end
---@param rockspec RockSpec ---@param rockspec RockSpec
@ -218,9 +224,10 @@ end
---@return table? ---@return table?
function M.parse(file) function M.parse(file)
local ret = {} local ret = {}
return pcall(function() local ok = pcall(function()
loadfile(file, "t", ret)() loadfile(file, nil, ret)()
end) and ret or nil end) and ret or nil
return ok and ret or nil
end end
---@param plugin LazyPlugin ---@param plugin LazyPlugin

View file

@ -10,6 +10,7 @@
---@field dirty? boolean ---@field dirty? boolean
---@field build? boolean ---@field build? boolean
---@field frags? number[] ---@field frags? number[]
---@field top? boolean
---@field handlers? LazyPluginHandlers ---@field handlers? LazyPluginHandlers
---@field installed? boolean ---@field installed? boolean
---@field is_local? boolean ---@field is_local? boolean
@ -20,6 +21,7 @@
---@field tasks? LazyTask[] ---@field tasks? LazyTask[]
---@field updated? {from:string, to:string} ---@field updated? {from:string, to:string}
---@field updates? {from:GitInfo, to:GitInfo} ---@field updates? {from:GitInfo, to:GitInfo}
---@field last_check? number
---@field working? boolean ---@field working? boolean
---@field pkg? LazyPkg ---@field pkg? LazyPkg
@ -59,6 +61,7 @@
---@field priority? number Only useful for lazy=false plugins to force loading certain plugins first. Default priority is 50 ---@field priority? number Only useful for lazy=false plugins to force loading certain plugins first. Default priority is 50
---@field dev? boolean If set, then link to the respective folder under your ~/projects ---@field dev? boolean If set, then link to the respective folder under your ~/projects
---@field rocks? string[] ---@field rocks? string[]
---@field virtual? boolean virtual plugins won't be installed or added to the rtp.
---@class LazyPlugin: LazyPluginBase,LazyPluginHandlers,LazyPluginHooks,LazyPluginRef ---@class LazyPlugin: LazyPluginBase,LazyPluginHandlers,LazyPluginHooks,LazyPluginRef
---@field dependencies? string[] ---@field dependencies? string[]
@ -73,6 +76,8 @@
---@field module? false ---@field module? false
---@class LazyPluginSpec: LazyPluginBase,LazyPluginSpecHandlers,LazyPluginHooks,LazyPluginRef ---@class LazyPluginSpec: LazyPluginBase,LazyPluginSpecHandlers,LazyPluginHooks,LazyPluginRef
---@field name? string display name and name used for plugin config files
---@field dir? string
---@field dependencies? string|string[]|LazyPluginSpec[] ---@field dependencies? string|string[]|LazyPluginSpec[]
---@field specs? string|string[]|LazyPluginSpec[] ---@field specs? string|string[]|LazyPluginSpec[]

View file

@ -146,7 +146,7 @@ end
---@return string, string[] ---@return string, string[]
function M.parse(args) function M.parse(args)
local parts = vim.split(vim.trim(args), "%s+") local parts = vim.split(vim.trim(args), "%s+")
if parts[1]:find("Lazy") then if vim.startswith("Lazy", parts[1]) then
table.remove(parts, 1) table.remove(parts, 1)
end end
if args:sub(-1) == " " then if args:sub(-1) == " " then

View file

@ -166,7 +166,7 @@ function M:mount()
self:augroup(true) self:augroup(true)
end, { win = true }) end, { win = true })
self:focus() self:focus()
self:on_key(ViewConfig.keys.close, self.close) self:on_key(ViewConfig.keys.close, self.close, "Close")
self:on({ "BufDelete", "BufHidden" }, self.close) self:on({ "BufDelete", "BufHidden" }, self.close)
if vim.bo[self.buf].buftype == "" then if vim.bo[self.buf].buftype == "" then

View file

@ -85,7 +85,7 @@ function M.create()
require("lazy.manage.process").abort() require("lazy.manage.process").abort()
require("lazy.async").abort() require("lazy.async").abort()
return ViewConfig.keys.abort return ViewConfig.keys.abort
end, { silent = true, buffer = self.buf, expr = true }) end, { silent = true, buffer = self.buf, expr = true, desc = "Abort" })
vim.keymap.set("n", "gx", "K", { buffer = self.buf, remap = true }) vim.keymap.set("n", "gx", "K", { buffer = self.buf, remap = true })
@ -110,7 +110,7 @@ function M.create()
self.state.plugin = open and selected or nil self.state.plugin = open and selected or nil
self:update() self:update()
end end
end) end, "Details")
self:on_key(ViewConfig.keys.next, function() self:on_key(ViewConfig.keys.next, function()
local cursor = vim.api.nvim_win_get_cursor(self.view.win) local cursor = vim.api.nvim_win_get_cursor(self.view.win)
@ -121,7 +121,7 @@ function M.create()
return return
end end
end end
end) end, "Next Plugin")
self:on_key(ViewConfig.keys.prev, function() self:on_key(ViewConfig.keys.prev, function()
local cursor = vim.api.nvim_win_get_cursor(self.view.win) local cursor = vim.api.nvim_win_get_cursor(self.view.win)
@ -132,14 +132,14 @@ function M.create()
return return
end end
end end
end) end, "Prev Plugin")
self:on_key(ViewConfig.keys.profile_sort, function() self:on_key(ViewConfig.keys.profile_sort, function()
if self.state.mode == "profile" then if self.state.mode == "profile" then
self.state.profile.sort_time_taken = not self.state.profile.sort_time_taken self.state.profile.sort_time_taken = not self.state.profile.sort_time_taken
self:update() self:update()
end end
end) end, "Sort Profile")
self:on_key(ViewConfig.keys.profile_filter, function() self:on_key(ViewConfig.keys.profile_filter, function()
if self.state.mode == "profile" then if self.state.mode == "profile" then
@ -159,17 +159,18 @@ function M.create()
end end
end) end)
end end
end) end, "Filter Profile")
for lhs, rhs in pairs(Config.options.ui.custom_keys) do for lhs, rhs in pairs(Config.options.ui.custom_keys) do
if rhs then if rhs then
local handler = type(rhs) == "table" and rhs[1] or rhs local handler = type(rhs) == "table" and rhs[1] or rhs
local desc = type(rhs) == "table" and rhs.desc or nil
self:on_key(lhs, function() self:on_key(lhs, function()
local plugin = self.render:get_plugin() local plugin = self.render:get_plugin()
if plugin then if plugin then
handler(plugin) handler(plugin)
end end
end) end, desc)
end end
end end
@ -219,17 +220,17 @@ function M:setup_patterns()
["(https?://%S+)"] = function(url) ["(https?://%S+)"] = function(url)
Util.open(url) Util.open(url)
end, end,
}, self.hover) }, self.hover, "Hover")
self:on_pattern(ViewConfig.keys.diff, { self:on_pattern(ViewConfig.keys.diff, {
[commit_pattern] = function(hash) [commit_pattern] = function(hash)
self:diff({ commit = hash }) self:diff({ commit = hash })
end, end,
}, self.diff) }, self.diff, "Diff")
self:on_pattern(ViewConfig.commands.restore.key_plugin, { self:on_pattern(ViewConfig.commands.restore.key_plugin, {
[commit_pattern] = function(hash) [commit_pattern] = function(hash)
self:restore({ commit = hash }) self:restore({ commit = hash })
end, end,
}, self.restore) }, self.restore, "Restore")
end end
---@param opts? {commit:string} ---@param opts? {commit:string}
@ -294,7 +295,8 @@ end
---@param key string ---@param key string
---@param patterns table<string, fun(str:string)> ---@param patterns table<string, fun(str:string)>
---@param fallback? fun(self) ---@param fallback? fun(self)
function M:on_pattern(key, patterns, fallback) ---@param desc? string
function M:on_pattern(key, patterns, fallback, desc)
self:on_key(key, function() self:on_key(key, function()
local line = vim.api.nvim_get_current_line() local line = vim.api.nvim_get_current_line()
local pos = vim.api.nvim_win_get_cursor(0) local pos = vim.api.nvim_win_get_cursor(0)
@ -316,7 +318,7 @@ function M:on_pattern(key, patterns, fallback)
if fallback then if fallback then
fallback(self) fallback(self)
end end
end) end, desc)
end end
function M:setup_modes() function M:setup_modes()

View file

@ -94,7 +94,7 @@ function M:update()
diag.lnum = diag.row - 1 diag.lnum = diag.row - 1
return diag return diag
end, self._diagnostics), end, self._diagnostics),
{ signs = false, virtual_text = true, underline = false } { signs = false, virtual_text = true, underline = false, virtual_lines = false }
) )
end end
@ -144,8 +144,6 @@ function M:title()
if mode.name == "home" then if mode.name == "home" then
if self.view.state.mode == "home" then if self.view.state.mode == "home" then
title = " lazy.nvim " .. Config.options.ui.icons.lazy title = " lazy.nvim " .. Config.options.ui.icons.lazy
else
title = " lazy.nvim (H) "
end end
end end
@ -761,7 +759,7 @@ function M:debug()
---@type string[] ---@type string[]
plugins = vim.tbl_values(plugins) plugins = vim.tbl_values(plugins)
table.sort(plugins) table.sort(plugins)
self:append("", "LazySpecial", { indent = 2 }) self:append(Config.options.ui.icons.debug, "LazySpecial", { indent = 2 })
if handler_type == "keys" then if handler_type == "keys" then
for k, v in pairs(Config.plugins[plugins[1]]._.handlers.keys) do for k, v in pairs(Config.plugins[plugins[1]]._.handlers.keys) do
if k == value then if k == value then

View file

@ -1,3 +1,3 @@
#!/bin/env bash #!/bin/env bash
nvim -l tests/minit.lua --busted tests -o utfTerminal "$@" nvim -l tests/minit.lua --minitest

View file

@ -25,6 +25,7 @@ local function clean(plugins)
if plugin._.dep == false then if plugin._.dep == false then
plugin._.dep = nil plugin._.dep = nil
end end
plugin._.top = nil
return plugin return plugin
end, plugins) end, plugins)
end end