mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
modules/autocmd: better handling of 'desc' option rename
This commit is contained in:
parent
3fa81dd063
commit
85abc48714
1 changed files with 21 additions and 7 deletions
|
@ -17,13 +17,6 @@ with lib; let
|
||||||
};
|
};
|
||||||
|
|
||||||
autoCmdOption = types.submodule {
|
autoCmdOption = types.submodule {
|
||||||
imports = [
|
|
||||||
(
|
|
||||||
# TODO remove this deprecation warning in December 2023
|
|
||||||
mkRenamedOptionModule
|
|
||||||
["description"] ["desc"]
|
|
||||||
)
|
|
||||||
];
|
|
||||||
options = {
|
options = {
|
||||||
event = helpers.mkNullOrOption (types.either types.str (types.listOf types.str)) ''
|
event = helpers.mkNullOrOption (types.either types.str (types.listOf types.str)) ''
|
||||||
The event or events to register this autocommand.
|
The event or events to register this autocommand.
|
||||||
|
@ -42,6 +35,12 @@ with lib; let
|
||||||
Cannot be used with `pattern`.
|
Cannot be used with `pattern`.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Introduced early October 2023.
|
||||||
|
# TODO remove in early December 2023.
|
||||||
|
description = helpers.mkNullOrOption types.str ''
|
||||||
|
DEPRECATED, please use `desc`.
|
||||||
|
'';
|
||||||
|
|
||||||
desc = helpers.mkNullOrOption types.str ''
|
desc = helpers.mkNullOrOption types.str ''
|
||||||
A textual description of this autocommand.
|
A textual description of this autocommand.
|
||||||
'';
|
'';
|
||||||
|
@ -114,6 +113,21 @@ in {
|
||||||
inherit (config) autoGroups autoCmd;
|
inherit (config) autoGroups autoCmd;
|
||||||
in
|
in
|
||||||
mkIf (autoGroups != {} || autoCmd != {}) {
|
mkIf (autoGroups != {} || autoCmd != {}) {
|
||||||
|
# Introduced early October 2023.
|
||||||
|
# TODO remove in early December 2023.
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion =
|
||||||
|
all
|
||||||
|
(x: x.description == null)
|
||||||
|
autoCmd;
|
||||||
|
message = ''
|
||||||
|
RENAMED OPTION: `autoCmd[].description` has been renamed `autoCmd[].desc`.
|
||||||
|
Please update your configuration.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
extraConfigLuaPost =
|
extraConfigLuaPost =
|
||||||
(optionalString (autoGroups != {}) ''
|
(optionalString (autoGroups != {}) ''
|
||||||
-- Set up autogroups {{
|
-- Set up autogroups {{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue