mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-03 05:44:31 +02:00
neo-tree: Allow other plugins to insert their sources (#249)
Some plugins define neo-tree sources. For theese plugins having an option 'neoTreeIntegration = true' would be useful. The problem is that if we set the plugins.neo-tree.sources to ["<source>"] then we ditch the default values of ["filesystem" ...]. The idea here is to define an internal extraSources option that takes care of the following: - If sources is null set it to the default sources - Concatenate sources and extraSources
This commit is contained in:
parent
32d79dee7a
commit
5a69dc4712
1 changed files with 13 additions and 1 deletions
|
@ -40,6 +40,10 @@ in {
|
|||
The name used here must be the same name you would use in a require() call.
|
||||
'';
|
||||
|
||||
extraSources = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||
Extra sources to be added to the sources. This is an internal nixvim option.
|
||||
'';
|
||||
|
||||
addBlankLineAtTop =
|
||||
helpers.defaultNullOpts.mkBool false
|
||||
"Add a blank line at the top of the tree.";
|
||||
|
@ -945,7 +949,15 @@ in {
|
|||
|
||||
options = with cfg;
|
||||
{
|
||||
inherit (cfg) sources;
|
||||
# Concatenate sources and extraSources, setting sources to it's default value if it is null
|
||||
# and extraSources is not null
|
||||
sources =
|
||||
if (!isNull cfg.extraSources)
|
||||
then
|
||||
if (isNull cfg.sources)
|
||||
then ["filesystem" "git_status" "buffers"] ++ cfg.extraSources
|
||||
else cfg.sources ++ cfg.extraSources
|
||||
else cfg.sources;
|
||||
add_blank_line_at_top = cfg.addBlankLineAtTop;
|
||||
auto_clean_after_session_restore = cfg.autoCleanAfterSessionRestore;
|
||||
close_if_last_window = cfg.closeIfLastWindow;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue