File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # A Directory Manager for [ Neorg] ( https://github.com/nvim-neorg/neorg )
2+
3+ The ` neorg-dirman ` crate is a core module which provides a basic interface for workspaces.
4+
5+ Workspaces are the backbone of [ Neorg] ( https://github.com/nvim-neorg/neorg ) - they are
6+ a directory with an assigned name whose files are ` .norg ` notes belonging to a specific
7+ area of focus.
8+
9+ This crate exposes a
10+ [ ` Workspace ` ] ( https://docs.rs/neorg-dirman/latest/neorg_dirman/workspace/struct.Workspace.html )
11+ struct as well as a
12+ [ ` WorkspaceManager ` ] ( https://docs.rs/neorg-dirman/latest/neorg_dirman/workspace/struct.WorkspaceManager.html )
13+ to easily keep track of many workspaces as well as the current ("active")
14+ workspace. A
15+ [ ` files() ` ] ( https://docs.rs/neorg-dirman/latest/neorg_dirman/workspace/struct.Workspace.html#method.files )
16+ function is also provided to enumerate all files within a given workspace.
Original file line number Diff line number Diff line change @@ -132,9 +132,16 @@ mod tests {
132132 path : "~/another/path" . into ( ) ,
133133 } ;
134134
135- let mut workspace_manager = WorkspaceManager :: new ( vec ! [ & workspace1, & workspace2] , & workspace1. name ) . expect ( "Workspace 1 not found!" ) ;
136- workspace_manager. set_current_workspace ( & workspace2. name ) . expect ( "Unable to set the current workspace" ) ;
137-
138- assert_eq ! ( & workspace_manager. get_current_workspace( ) . name, & workspace2. name) ;
135+ let mut workspace_manager =
136+ WorkspaceManager :: new ( vec ! [ & workspace1, & workspace2] , & workspace1. name )
137+ . expect ( "Workspace 1 not found!" ) ;
138+ workspace_manager
139+ . set_current_workspace ( & workspace2. name )
140+ . expect ( "Unable to set the current workspace" ) ;
141+
142+ assert_eq ! (
143+ & workspace_manager. get_current_workspace( ) . name,
144+ & workspace2. name
145+ ) ;
139146 }
140147}
You can’t perform that action at this time.
0 commit comments