File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 11-- This file should contain all commands meant to be used by mappings.
22local cc = require (" neo-tree.sources.common.commands" )
3+ local manager = require (" neo-tree.sources.manager" )
34
45local vim = vim
56
@@ -13,6 +14,10 @@ M.example_command = function(state)
1314 print (string.format (" example_command: id=%s, name=%s" , id , name ))
1415end
1516
17+ M .refresh = function (state )
18+ manager .refresh (" example" , state )
19+ end
20+
1621M .show_debug_info = function (state )
1722 print (vim .inspect (state ))
1823end
Original file line number Diff line number Diff line change @@ -62,22 +62,26 @@ M.navigate = function(state, path)
6262 id = " 1" ,
6363 name = " root" ,
6464 type = " directory" ,
65+ stat_provider = " example-custom" ,
6566 children = {
6667 {
6768 id = " 1.1" ,
6869 name = " child1" ,
6970 type = " directory" ,
71+ stat_provider = " example-custom" ,
7072 children = {
7173 {
7274 id = " 1.1.1" ,
7375 name = " child1.1 (you'll need a custom renderer to display this properly)" ,
7476 type = " custom" ,
77+ stat_provider = " example-custom" ,
7578 extra = { custom_text = " HI!" },
7679 },
7780 {
7881 id = " 1.1.2" ,
7982 name = " child1.2" ,
80- type = " file"
83+ type = " file" ,
84+ stat_provider = " example-custom" ,
8185 },
8286 },
8387 },
9195--- @param config table Configuration table containing any keys that the user
9296-- wants to change from the defaults. May be empty to accept default values.
9397M .setup = function (config , global_config )
98+ -- redister or custom stat provider to override the default libuv one
99+ require (" neo-tree.utils" ).register_stat_provider (" example-custom" , M .get_node_stat )
94100 -- You most likely want to use this function to subscribe to events
95101 if config .use_libuv_file_watcher then
96102 manager .subscribe (M .name , {
You can’t perform that action at this time.
0 commit comments