Commit Graph

12 Commits

Author SHA1 Message Date
Shadman 08d1340ec9
doc: improve code documentation (#82) 2021-10-12 20:04:47 +06:00
shadmansaleh d25a37fea0 refactor: rename component type luae and vimf
- rename luae -> lua_expr
- rename vimf -> vim_fun
luae & vimf were too vague and hand to understand.

BREAKING_CHANGE
2021-10-11 17:09:07 +06:00
shadmansaleh 61ac665774 refactor: separate the child creation and initialization (#81)
- includes modified class implementation from https://github.com/rxi/classic/blob/master/classic.lua
- now base component class is created from classic.
- change to how component classes are created.
  - Don't overwrite new method to initialize a component.
    Overwrite the init method. new is responsible for
    creating class object and calling init on it.
    Unlike previous new overwrite you don't need to create
    the class (table) and return it. Instead you will recive
    the object as self and do required manipulation on that
    just like any most other oop langs. Also don't need to
    return anything from init. init's job is to initialize.
    remember to call classes init before running your operations
    unfortunately lua isn't full fledged oop lang and I don't
    how to automate this.
- changes how super classes are accesed.
  - rename Component._parent -> Component.super
  - methods on super classes now ran through super class instead
    of objects _parent self._parent as that can lead to recursive inf loop.
  See branch, diff, tabs, buffer classes call to init for example
  on pattern.
- All components updated to reflect current logic
- component loader updated to use new initialization procedure.
- updated tests
- updated BREAKING_CHANGES.md
- plus quite a bit of formatting changes in the components
  - comp.method = function(self, ...) -> function M:method(...)
BREAKING_CHANGE
2021-10-11 16:41:19 +06:00
shadmansaleh 9f556fdf37 chore: add license statements and update benchmarks 2021-09-20 17:48:22 +06:00
github-actions[bot] db448f41e6
chore: formated with stylua (#32)
Apply initial stylua format

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-09-04 00:28:20 +06:00
shadmansaleh 2348eaea2f enhace: Use nvim_call_function instead of vim.fn so vim.fn does not get populated 2021-08-28 00:13:50 +06:00
shadmansaleh c9c5e3f9d1 feat: Add type option to hint what type of component is the string
String values for component are way too overloaded . This means lualine
has to make lots of checks to understand how to load a string value
as a component . With type option users can specify exactly what they
want.
2021-08-22 13:54:05 +06:00
Shadman 2a222d7ad6
Better fix to nil on vimfunc (#178) 2021-04-14 18:25:34 +06:00
Shadman dac7a290df
BugFix: fix vim functions displaying nil (#177) 2021-04-14 10:07:19 +06:00
Shadman 4f53d053a1
Refactor: Remove cterm from hlighlight extractor (#174)
- remove cterm color extraction
- fix lint issues
- apply lua-format
2021-04-13 18:36:51 +06:00
shadmansaleh 77c4c47482 Enhance: Cleanup eval_lua component and document it 2021-04-12 21:59:55 +06:00
Shadman 1b81b0021f
Refactor: Components now use OOP style (#141) 2021-04-11 10:20:41 +02:00