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+ # 📐 Architecture
2+
3+ This document describes how the various modules are structured & how they interact with each other under the hood.
4+
5+ <!-- GRAPH -->
6+
7+ Each module is composed of 2 files,
8+
9+ 1 . A ` <module>.lua ` which holds all the commands & set/reset functions.
10+ 2 . A ` components/<module>.lua ` which holds all the components.
11+
12+ For example, the ` statusline ` module uses the following files,
13+
14+ - [ ../lua/bars/statusline.lua] ( https://github.com/OXY2DEV/bars.nvim/blob/main/lua/bars/statusline.lua )
15+ - [ ../lua/bars/components/statusline.lua] ( https://github.com/OXY2DEV/bars.nvim/blob/main/lua/bars/components/statusline.lua )
16+
17+ # ` <module>.lua `
18+
19+ This file holds,
20+
21+ + A configuration table(` module.config ` ).
22+ + Module state(` module.state ` ).
23+ + A renderer(` module.render ` ). This will be used as the content of the specific bar/line.
24+ + Helper functions such as,
25+ + A start function(` module.start() ` ). Usually called during ` VimEnter ` or via commands.
26+ + A window attach function(` module.attach(win: integer) ` ) for attaching to windows.
27+ + A window detach function(` module.detach(win: integer) ` ) for detaching from windows.
28+ + A style updater(` module.update_style(win: integer) ` ) to change which style is used. Usually called when setting ` filetype ` & ` buftype ` .
29+ + A setup function(` module.setup(config: table) ` ).
30+
31+ And optionally some commands(e.g. ` module.Enable() ` , the function name should start with a ** capital letter** ).
32+
You can’t perform that action at this time.
0 commit comments