381 Commits

Author SHA1 Message Date
Charly Delay
babc57c62b
fixup: fix diff component default colors (#83)
Rationalizes the default colors used by the `diff` component.  These colors are based of the original fork (https://github.com/hoob3rt/lualine.nvim/blob/master/lua/lualine/components/diff.lua#L17-L21), but the assignment differs (so that added defaults to green, modified defaults to orange, and removed defaults to red).
2021-10-12 11:37:32 +06:00
Shadman
7d15304449
Merge pull request refactor: components (#81)
* 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

* enhance: allow components to be functions too (#81)

Some components like hostname, progress are so simple that
the component class setup is just unnecessary boilerplate.
Allowing them to be function simplifies things.
With this you can put your regular component functions in
~/.config/nvim/lua/lualine/components/ folder and treat then as
regular lualine components just like 'mode' or 'branch'.
Hopefully this will help lualine plugins grow.

* refactor: allow components, extensions, themes to be multi file module
(#81)

utilize that to split tabs & buffers components into smaller files

* 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

* chore: remove deprecation notices and deprecated options from #24

+ fix tests

* refactor: split diagnostics component (#81)

* refactor: split branch component (#81)

* refactor: split diff component (#81)
2021-10-11 19:17:06 +06:00
shadmansaleh
6b9e9352be refactor: split diff component (#81) 2021-10-11 19:07:38 +06:00
shadmansaleh
cc64ec3f7c refactor: split branch component (#81) 2021-10-11 19:07:38 +06:00
shadmansaleh
0b599b0ace refactor: split diagnostics component (#81) 2021-10-11 17:43:49 +06:00
shadmansaleh
1e2b735aee chore: remove deprecation notices and deprecated options from #24
+ fix tests
2021-10-11 17:10:24 +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
6e936efe06 refactor: allow components, extensions, themes to be multi file module
(#81)

utilize that to split tabs & buffers components into smaller files
2021-10-11 16:42:57 +06:00
shadmansaleh
c8750a35e0 enhance: allow components to be functions too (#81)
Some components like hostname, progress are so simple that
the component class setup is just unnecessary boilerplate.
Allowing them to be function simplifies things.
With this you can put your regular component functions in
~/.config/nvim/lua/lualine/components/ folder and treat then as
regular lualine components just like 'mode' or 'branch'.
Hopefully this will help lualine plugins grow.
2021-10-11 16:41:25 +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
zeertzjq
a564019d95
feat: add support for mode nt (#79)
Following https://github.com/neovim/neovim/pull/15878
2021-10-10 08:43:50 +06:00
shadmansaleh
6aa103def8 doc: fix color docs for diff & diagnostics component
fixes #39
closes #78
2021-10-09 16:08:22 +06:00
Shadman
da9447fd49
fixup: fix link in README. 2021-10-09 08:12:18 +06:00
shadmansaleh
014a80d138 doc: let users know about wiki in README 2021-10-09 00:05:26 +06:00
shadmansaleh
9bf5ecc2bb fixup: fix bugs in tabs component
- fix options nil error upon deleting and creating tab
- fix only single tab being rendered after deleting and recreating tabs
2021-10-08 20:30:05 +06:00
shadmansaleh
98b43ba3a1 fix: left sections taking over entire stl when xyz is absent
- now %= applied even when x,y,z is absent
- newly added always_divide_middle option cal be set to false to avood %=
2021-10-08 04:46:38 +06:00
shadmansaleh
6faaa05ae5 Revert "fix(extension): fix some extension showing a section in whole line"
This reverts commit 846e5bdabfc2bb49407a1e32ed5deec1375c3b08.
2021-10-08 03:57:05 +06:00
zeertzjq
90e1dc074f
feat: add support for modes Rvc and Rvx (#75)
Following https://github.com/neovim/neovim/pull/15886
2021-10-04 07:36:20 +06:00
shadmansaleh
b7c0a2aeb1 fix: handle nil error in diff component
closes #74
2021-10-02 15:08:33 +06:00
shadmansaleh
846e5bdabf fix(extension): fix some extension showing a section in whole line
For now use a dummy component to lualine_x on extensions that only define
lualine_a. This will let the renderer know right sections do exist.

closes #73
2021-10-01 19:54:57 +06:00
Jim Tittsler
05314de43a
fix doc typos (#72) 2021-09-28 14:05:10 +06:00
github-actions[bot]
4353afd1de
chore: formated with stylua (#69)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-09-27 18:06:25 +06:00
CantoroMC
05d6a13369
enhance: improved notices.show_notices (#70)
- Prefer use of lua functions instead of vim.cmd
 - Added buffer and window options
 - Moved from append to appendbufline
2021-09-27 18:04:54 +06:00
shadmansaleh
20a87ac78c fix: typo + make notice buffer not modifiable
closes #68
2021-09-27 14:44:44 +06:00
shadmansaleh
69b5351147 enhance: use a smaller icon for modified buffer in buffers component 2021-09-26 06:22:26 +06:00
Glenn Waters
5785d4b47f
enhance: use table to map mode to hl group (#67)
I believe a hash is more efficient than a multiple comparison if. The code is also drier, no replication of the concatenation line of code.
2021-09-26 06:15:22 +06:00
Shadman
d24beddcb6
chore: update README.md 2021-09-25 15:51:46 +06:00
Shadman
6dd1a0d862
chore(gituub): update stale labels 2021-09-24 23:19:49 +06:00
shadmansaleh
8f647f7e5a chore: add contributors to README.md 2021-09-23 13:29:41 +06:00
shadmansaleh
1143dc184a chore: add config for generated-files-bot 2021-09-23 12:50:54 +06:00
shadmansaleh
d786e1816d chore: add config for github stale 2021-09-23 12:19:00 +06:00
shadmansaleh
ceec01bc6c enhance: set default diagnostics source to nvim-lsp & coc
doc: update docs for options.
2021-09-21 12:30:19 +06:00
shadmansaleh
07d3df01a1 doc: update README 2021-09-21 09:52:12 +06:00
shadmansaleh
d8b960fc34 doc: introduce lua-heredoc for configuring through viml 2021-09-20 22:03:10 +06:00
shadmansaleh
cdc574c9b0 fix: nil error with Alpha on buffers component 2021-09-20 21:47:57 +06:00
shadmansaleh
904f9df637 refactor: replace rtp_searcher with nvim_get_runtime_file (#65) 2021-09-20 20:35:14 +06:00
shadmansaleh
aea5d8b90c chore: fix typos 2021-09-20 19:40:47 +06:00
Dheepak Krishnamurthy
4ca1a8fd00
Add buffers and tabs component (#42)
* feat: Add tabs component  
* feat: Add buffers component 

Now you can have traditional tabline/bufferline directly with lualine.

Special thanks to @kdheepak for making it happen.

Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
2021-09-20 19:11:41 +06:00
shadmansaleh
9f556fdf37 chore: add license statements and update benchmarks 2021-09-20 17:48:22 +06:00
Dheepak Krishnamurthy
df1ac83a96
chore: Fix typo in github issue template ♻️ (#64) 2021-09-20 10:28:43 +06:00
zeertzjq
fa3f8c33ca
feat: add support for modes vs, Vs, CTRL-Vs (#62) 2021-09-20 09:57:41 +06:00
github-actions[bot]
28d89472e3
chore: generated vimdoc (#61)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-09-19 16:42:25 +06:00
zeertzjq
ee4e69ba24
doc: document toggleterm extension (#60) 2021-09-19 16:13:02 +06:00
shadmansaleh
260133ce63 fix: wrong highlights on inactive mode with last commit 2021-09-19 12:20:07 +06:00
shadmansaleh
7147989f5f enhance: color middle of left and right statusline with lualine_c color even when section c and x are absent 2021-09-19 11:52:42 +06:00
Zachary Churchill
ebea516ac7
fix: theme not loading in neovim-nightly (#59) 2021-09-19 08:25:08 +06:00
shadmansaleh
c5cb601a6a feat(diagnostics): Add support for nvims diagnostic API
- neovim added new diagnostics api in https://github.com/neovim/neovim/pull/15585.
  So I've added a new diagnostics source named `nvim` (Yes I couldn't
  find a name for it :P) that shows diagnostics from that api.
  In neovim nightly with vim.diagnostics you can consider source
  `nvim_lsp` obsolete.
- Diagnostics source `vim_lsp` was removed in a mistake now it's
  restored.
2021-09-17 18:50:32 +06:00
shadmansaleh
f7702d8841 enhance: check for new diagnostics highlight groups
- Now DiagnosticError, DiagnosticWarn, DiagnosticInfo, DiagnosticHint
  are also consider3d for default highlight in diagnostics component.
- Moved getHl from auto theme to utils as extract_color_from_hllist

closes #56
2021-09-17 15:28:30 +06:00
shadmansaleh
b76c410dba fixup: fixes issues in diagnostics component
- typo diagnostic_color -> diagnostics_color
- typo hin -> hint
- warning -> warn since that's what's used everywhere
- change default diagnostics colors slightly

fixes #55
2021-09-17 15:27:57 +06:00
shadmansaleh
8f866213e7 fix: typos 2021-09-17 08:59:48 +06:00