mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 10:48:35 +02:00
core: show warnings for deprecated or changed options (#129)
* moved helpers to lib folder * Created proxy file for helpers.nix * wrappers: removed code duplication * null-ls: fix wrong name of variable * added warnings module * Added assertions * bufferline: deprecated option * nvim-tree: renamed options * Fixed mkRenamedOption * Bufferline: added new options * Fixed deprecated option Co-authored-by: Pedro Alves <pta2002@pta2002.com>
This commit is contained in:
parent
5fac9be0ab
commit
63c256dc3d
10 changed files with 369 additions and 206 deletions
|
@ -1,10 +1,23 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ pkgs, config, lib, ... }@args:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.nvim-tree;
|
||||
helpers = import ../helpers.nix { lib = lib; };
|
||||
optionWarnings = import ../../lib/option-warnings.nix args;
|
||||
basePluginPath = [ "plugins" "nvim-tree" ];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(optionWarnings.mkRenamedOption {
|
||||
option = basePluginPath ++ [ "updateCwd" ];
|
||||
newOption = basePluginPath ++ [ "syncRootWithCwd" ];
|
||||
})
|
||||
(optionWarnings.mkRenamedOption {
|
||||
option = basePluginPath ++ [ "updateFocusedFile" "updatedCwd" ];
|
||||
newOption = basePluginPath ++ [ "updateFocusedFile" "updateRoot" ];
|
||||
})
|
||||
];
|
||||
|
||||
options.plugins.nvim-tree = {
|
||||
enable = mkEnableOption "nvim-tree";
|
||||
|
||||
|
@ -54,8 +67,7 @@ in
|
|||
description = "Hijack cursor";
|
||||
};
|
||||
|
||||
# TODO: change this to it's new definition sync_root_with_cwd
|
||||
updateCwd = mkOption {
|
||||
syncRootWithCwd = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
};
|
||||
|
@ -106,8 +118,7 @@ in
|
|||
default = null;
|
||||
};
|
||||
|
||||
# TODO: change this to it's new definition update_root
|
||||
updateCwd = mkOption {
|
||||
updateRoot = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
};
|
||||
|
@ -225,7 +236,7 @@ in
|
|||
ignore_ft_on_setup = cfg.ignoreFtOnSetup;
|
||||
open_on_tab = cfg.openOnTab;
|
||||
hijack_cursor = cfg.hijackCursor;
|
||||
update_cwd = cfg.updateCwd;
|
||||
sync_root_with_cwd = cfg.syncRootWithCwd;
|
||||
respect_buf_cwd = cfg.respectBufCwd;
|
||||
update_to_buf_dir = {
|
||||
enable = cfg.updateToBufDir.enable;
|
||||
|
@ -234,7 +245,7 @@ in
|
|||
diagnostics = cfg.diagnostics;
|
||||
update_focused_file = {
|
||||
enable = cfg.updateFocusedFile.enable;
|
||||
update_cwd = cfg.updateFocusedFile.updateCwd;
|
||||
update_root = cfg.updateFocusedFile.updateRoot;
|
||||
ignore_list = cfg.updateFocusedFile.ignoreList;
|
||||
};
|
||||
system_open = cfg.systemOpen;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue