Commit graph

62 commits

Author SHA1 Message Date
Gaetan Lepage
6e39178dd3 helpers/mkDefaultOpt: make 'global' parameter optional 2024-01-14 22:35:27 +01:00
Gaetan Lepage
f1c8f9a8d2 helpers/mkPlugin: remove useless 'value' parameter 2024-01-14 22:35:27 +01:00
Gaetan Lepage
22fb5df657 helpers/mkPlugin: remove useless bool conversion 2024-01-14 22:35:27 +01:00
Gaetan Lepage
e3ef5dae2b helpers/mkPlugin: add default value for description (use name) 2024-01-14 22:35:27 +01:00
Gaetan Lepage
97fb6d6a29 helpers/mkPlugin: add extraConfig option 2024-01-14 22:35:27 +01:00
Gaetan Lepage
a40a0c679c helpers: add mkNullOrStr 2024-01-06 18:33:39 +01:00
Gaetan Lepage
f0b487a10c helpers: expose maybeRaw for wider use 2024-01-06 16:45:17 +01:00
traxys
8aa4b7e4ce
helpers: Add option helpers for types that are either a lua str or a value (#876)
Those types needed the following code in apply:

if builtins.isString value
then mkRaw value
else value

This commit avoids this boilerplate, and clarifies that the `str` is lua
code in the documentation.
2024-01-02 00:30:10 +01:00
traxys
8b8a1c0f4b
fix: Remove missed mentions of rawType (#875) 2024-01-02 00:26:41 +01:00
traxys
4d14c098b6 helpers: Add types for lua function & lua code
This allows to display `lua function string` and `lua code string` in
the documentation for related options.
2024-01-02 00:15:30 +01:00
Gaetan Lepage
f88ff0a82e helpers: borderType -> nixvimTypes.border 2024-01-01 23:55:27 +01:00
Gaetan Lepage
d88a30fba6 helpers: highlightType -> nixvimTypes.highlight 2024-01-01 23:55:27 +01:00
traxys
af41ea2d80
helpers: move rawType to helpers.nixvimTypes (#871)
This is done in preparation of adding new (lua) types to help the
documentation.
2024-01-01 23:33:53 +01:00
Gaetan Lepage
99ebb5f074 helpers: fix typo 2024-01-01 21:49:35 +01:00
traxys
abd1c4007a
helpers: Add mkLua,mkLuaFn (defaultNullOpts or not) (#866)
This makes it such that defaultNullOpts.mkStr never represents a lua
string, easing documenting where a string is a lua string vs lua code.
2024-01-01 20:28:55 +01:00
traxys
1d8e7906c9
plugins: Introduce helpers.defaultNullOpts.mkLuaFn (#855)
This allows to avoid calling `mkRaw` on lua functions, as they will get
applied automatically.

This could also help in the future to refactor the use of Lua code to
make it more user-friendly.
2023-12-29 15:24:42 +01:00
traxys
e0521dde87
helpers: Allow to set raw lua code in more places (#837)
With this change a user should be able to set raw lua code in more
places than before.

The `mkStr` helper was _not_ changed as a large number of places in
nixvim are using this helper to directly implement raw lua code.

Also note that types of the form `oneOf [submodule <something else>` are
not well rendered in the documentation, and should be avoided (this
includes `listOf [submodule <something else>`, so the helpers should be
avoided in this case)
2023-12-22 16:55:50 +01:00
traxys
2871dc94b4
Allow to add meta options like maintainers (#836) 2023-12-22 15:59:41 +01:00
Gaetan Lepage
a70947a563 lib/helpers: add defaultNullOpts.mkLogLevel 2023-12-22 14:48:15 +01:00
Gaetan Lepage
e49bec3901 lib/helpers: add defaultNullOpts.mkSeverity 2023-12-22 14:48:15 +01:00
Gaetan Lepage
3ff4976eba lib/helpers: mkRaw should output null for empty strings 2023-11-28 14:08:27 +01:00
Gaetan Lepage
8cf2d943d2 lib/helpers: mkRaw now behaves like mkRawIfNonNull 2023-11-23 11:39:41 +01:00
Gaetan Lepage
707054bf23 helpers: factor out borderType 2023-11-16 22:22:18 +01:00
Gaetan Lepage
bbbbfa2774 modules/autocmd: factor out autocmd-helpers 2023-11-14 23:23:30 +01:00
traxys
0b87e5b70c
plugin/persistence: init + tests (#645) 2023-10-16 23:54:41 +02:00
traxys
0a31f39447
plugins/flash: init + tests (#625) 2023-10-15 17:31:03 +02:00
municorn
934bf7e2e3
fix(helpers): use "__unkeyed" prefix instead of "@" in toLuaObject (#632) 2023-10-09 15:50:21 +02:00
Gaetan Lepage
418bf5da17 modules/keymaps: factor out helper functions for use in plugins 2023-10-03 14:18:33 +02:00
Gaetan Lepage
574fb73258 modules/keymaps: refactor + new syntax 2023-10-02 15:23:54 +02:00
traxys
4b3d019eee
lib: Use mkOptionType for rawType (#556)
This allows the type to be rendered as `raw lua code` instead of
`submodule` in the documentation.
2023-08-28 13:32:08 +02:00
Gaetan Lepage
ee2e15b58b helpers: add "__emptyString" special attr name 2023-08-28 09:50:49 +02:00
Gaetan Lepage
d0cbfe92b3 helpers: add defaultNullOpts.mkPositiveInt and mkUnsignedInt 2023-08-25 15:34:55 +02:00
Gaetan Lepage
24350879b1 lib/helpers: remove useless ifNonNull 2023-08-23 11:12:50 +02:00
Gaetan Lepage
36a6ab4ba7 helpers: add highlightType and defaultNullOpts.mkHighlight 2023-08-10 15:27:29 +02:00
Antonín Říha
0d2a436255
plugins/chadtree: init + test (#475)
* plugins/chadtre: init + test

* Update tests/test-sources/plugins/filetrees/chadtree.nix

Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>

* Removed with helpers

* Update tests/test-sources/plugins/filetrees/chadtree.nix

Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>

* Update plugins/filetrees/chadtree.nix

Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>

* retrigger checks

* Update tests/test-sources/plugins/filetrees/chadtree.nix

Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>

---------

Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>
2023-07-12 22:03:09 +02:00
Antonín Říha
27bb28f23e
plugins/diffview: init + test (#457) 2023-07-06 09:01:07 +02:00
Wolbyte
01a45fd033 helpers.defaultNullOpts.mkBorder: Improve indentation & formatting
Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>
2023-06-26 14:01:18 +02:00
Wolbyte
600cd12057 helpers.defaultNullOpts: add mkBorder 2023-06-26 14:01:18 +02:00
Tanish2002
efdcbe225f perform some statix linting and fixes 2023-05-22 23:00:53 +02:00
Gaétan Lepage
bd81037c5f
modules/keymaps: fix bug in keymaps generation (#300) 2023-04-04 18:34:05 +02:00
Gaétan Lepage
35c56b62a1
helpers/lib: toLuaObject ignore empty attrs (#312) 2023-04-03 11:25:37 +02:00
Gaétan Lepage
58b6c74e2f
helpers: add globalPrefix to mkPlugin (#284) 2023-03-24 08:18:45 +01:00
traxys
ff063b27bd
plugins/noice-nvim: init + tests (#272) 2023-03-18 20:27:31 +01:00
Gaétan Lepage
c3821e9924
helpers/keymap: fix noremap bug (#257) 2023-03-15 00:37:49 +01:00
traxys
b3ca52110f
maps: Add the remap option (#256) 2023-03-14 23:44:14 +01:00
Gaétan Lepage
8b21fd5872
lib/helpers: fix typo in mkModeMaps (#238) 2023-03-11 00:25:51 +01:00
Gaétan Lepage
0bd07ee091
helpers: add mkMaps and mkModeMaps (#236) 2023-03-10 13:00:52 +01:00
Gaétan Lepage
f0649334a4
lib/helpers: mkIfNonNull', ifNonNull' and ifNonNull (#230) 2023-03-10 12:06:32 +01:00
Gaétan Lepage
16db74996c
helpers: typo (mkCompositeOptions -> mkCompositeOption) (#226) 2023-03-07 15:53:22 +00:00
Gaétan Lepage
f3ec786baa
helpers: add mkCompositeOptions (#223) 2023-03-06 23:45:38 +01:00