Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lualine fork while @hoob3rt is absent #311

Closed
wants to merge 171 commits into from
Closed

lualine fork while @hoob3rt is absent #311

wants to merge 171 commits into from

Conversation

shadmansaleh
Copy link
Member

@shadmansaleh shadmansaleh commented Jul 25, 2021

@hoob3rt hasn't been arround for a while . So I've decided to fork lualine and fix it's issues . I recommend to use this fork until @hoob3rt comes back .

If you have any issues, request or want to contribute to this branch please open issue/pr here

Resolved

fixes #157
fixes #233
fixes #305
fixes #314
fixes #299
fixes #309
fixes #263
fixes #276
fixes #302
fixes #283
fixes #251
fixes #301
fixes #303
fixes #286
fixes #320
fixes #230
fixes #280
fixes #310
fixes #340
fixes #349
fixes #350

Additional Issues that are to be closed
closes #316
closes #290
closes #288
closes #287
closes #281
closes #275
closes #307
closes #267
closes #317
closes #319
closes #321
closes #326
closes #341

Prs that have been addressed
#278
#308
#304
#300
#295
#265
#279
#322
#323

Additional features worth mentioning.

  • evaluates components in inactive sections

  • adds option to only show icon for filetype component without text.

  • allows transitional separator to be used on component basis.

  • update_in_insert option for diagnostics component

  • allow live update to lualine config with successive calls to setup.

  • allow named colors like red/blue/gray and cterm colors (0-255) for color option and themes.

  • allow highlight group name as color value in themes. (Note color option was already supported)

  • inactive section for extensions

  • allow external source for diff component with source option.

  • allow users to configure diagnostics source as function . So users can intrigate any unsupported source easily.

  • expose current active config with require'lualine'.get_config()

  • update lualine after colorscheme or background option is set so themes can adapt.

  • color options in diff & diagnostics uses same semantics as global color option.

  • auto theme now first tries to set theme based on colorscheme & if theme for the colorscheme not found tries to create one.

  • fast startup with lazyloading and custom require.

  • shorting_target option for filename

  • add direct support for vims stl elememts. like '%p', '%='

  • add global type option to specify component type

  • lualine now passes self & is_focused arg to function component. like component.update_status

  • now lualine.statusline can take an arg to specify whether to draw active or inactive status. You can see what lualine is returning with :lua print(require'lualine'.statusline(true)) to see what active statusline looks like.

  • add toggleterm extension

  • support indexing dictionaries in var components

  • add powerline_dark theme

  • allow transitional hl to be applied at begining and end of stl

  • add new bubbles config example and move evil_lualine example in repo.

  • add filesize component

  • add workflow for formating with stylua. (dev feat)

  • add pywal theme based on dylanaraps/pywal.

  • When more then one theme/component/extension is found with same name inside and outside of lualine repo that it is now guaranteed that

    • external theme will be loaded. Here the location that comes first will be prioritized . In short take it as user_config > colorscheme_plugin > lualine_plugin. So colorschemes can overwrite themes in lualine repo.
    • internal component/extension will be loaded.

    Previously there was no guarantee and require just loaded one at random

  • Added support for new vim.diagnostic api

  • vimdoc is now generated from README.md with panvimdoc (Dev feature)

  • added tabs & buffers component for more traditional tabline/bufferline support

… hl_tag

This is necessary so color option from inactive and active sections do not conflict
@shadmansaleh shadmansaleh mentioned this pull request Jul 27, 2021
2 tasks
@winston0410
Copy link

Good job!

When setting theme to 'auto' and using the default colorscheme, lualine
would report "theme not found, defaulting to gruvbox". Fixed by checking
that we get an actual color back when calling utils.extract_highlight_colors
before attempting to apply a brightness modifier.

* Fix brightness_modifier application.

The brightness_modifer() should only be applied when a normal color was
found.

* Apply brightness modifier when normal color not nil.

Moved application of brightness_modifier outside the if statement that
negates the brightness modifier. The modifier will now be applied when
get_color_brightness returns < 0.5.
@oblitum
Copy link

oblitum commented Aug 1, 2021

Maybe fix #276 too? Would be nice.

@stevenocchipinti
Copy link

Thanks @shadmansaleh, using your fork until this is merged in - appreciate your effort!

Breaking Change: Now subsequent call to lualine.setup modifies old setup
instead of configuring from scratch
@shadmansaleh
Copy link
Member Author

https://github.com/shadmansaleh/lualine.nvim/pull/81

has lots of code changes so high chance of some bug getting introduced . Would appreciate if you tave time to test that branch out before merge.

- 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
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.
(#81)

utilize that to split tabs & buffers components into smaller files
- rename luae -> lua_expr
- rename vimf -> vim_fun
luae & vimf were too vague and hand to understand.

BREAKING_CHANGE
* 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)
0xcharly and others added 5 commits October 12, 2021 11:37
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).
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@shadmansaleh
Copy link
Member Author

@shadmansaleh shadmansaleh mentioned this pull request Oct 20, 2021
@shadmansaleh
Copy link
Member Author

shadmansaleh/lualine.nvim has been transfered to nvim-lualine/lualine.nvim .

@hoob3rt you're welcome to join the org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment