@@ -5,6 +5,7 @@ local vim = vim
5
5
local renderer = require (" neo-tree.ui.renderer" )
6
6
local manager = require (" neo-tree.sources.manager" )
7
7
local events = require (" neo-tree.events" )
8
+ local utils = require (" neo-tree.utils" )
8
9
9
10
local M = {
10
11
-- This is the name our source will be referred to as
@@ -14,6 +15,39 @@ local M = {
14
15
display_name = " 留Example"
15
16
}
16
17
18
+
19
+ --- Returns the stats for the given node in the same format as `vim.loop.fs_stat`
20
+ --- @param node table NuiNode to get the stats for.
21
+ --- Example return value:
22
+ ---
23
+ --- {
24
+ --- birthtime {
25
+ --- sec = 1692617750 -- seconds since epoch
26
+ --- },
27
+ --- mtime = {
28
+ --- sec = 1692617750 -- seconds since epoch
29
+ --- },
30
+ --- size = 11453, -- size in bytes
31
+ --- }
32
+ --
33
+ --- @class StatTime
34
+ --- @field sec number
35
+ ---
36
+ --- @class StatTable
37
+ --- @field birthtime StatTime
38
+ --- @field mtime StatTime
39
+ --- @field size number
40
+ ---
41
+ --- @return StatTable Stats for the given node.
42
+ M .get_node_stat = function (node )
43
+ -- This is just fake data, you'll want to replace this with something real
44
+ return {
45
+ birthtime = { sec = 1692617750 },
46
+ mtime = { sec = 1692617750 },
47
+ size = 11453 ,
48
+ }
49
+ end
50
+
17
51
--- Navigate to the given path.
18
52
--- @param path string Path to navigate to. If empty , will navigate to the cwd.
19
53
M .navigate = function (state , path )
0 commit comments