Commit Graph

97 Commits

Author SHA1 Message Date
shadmansaleh e8294ac56a feat: allow lualine to be temporarily completely disabled
Adds `lualine.hide()`

closes #776
2022-08-03 21:35:31 +06:00
zeertzjq e37d5d325d
feat: add support for mode ntT (#775) 2022-08-02 19:10:33 +06:00
shadmansaleh c880c8cfed chore: autogen (vimdocs+formating) 2022-07-31 17:11:58 +00:00
shadmansaleh bd52d2d77e fix: notice not being shown in lualine if it doesn't end with \n 2022-07-31 23:10:56 +06:00
shadmansaleh aeeefcef98 fix: don't show notification for empty LualineNotice
Previously even if config error was resolved in following setup call
notification for LualineNotice was displayed and when user opened
LualineNotice it'll be empty leaving users confused.

Now we'll wait for 2s before sending notification for LualineNotice so
if successive calls to setup fixed the config error the notification
will not be shown.
2022-07-28 13:07:44 +06:00
shadmansaleh 669a7d63ca chore: bump stylua version to 14.1 in CI 2022-07-22 19:48:20 +06:00
shadmansaleh d7386bbab3 chore: autogen (vimdocs+formating) 2022-07-22 13:30:37 +00:00
Shadman 53aa3d82d9
feat: refresh lualine based on timer + winbar support. (#736)
* feat: refresh lualine based on timer.

* fix config test

* fix lag on win change issue

* handle errors in timer callback

* feat: add winbar support

Pull in winbar changes form pr #689 and adapt them
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>

* make winbar disapear when winbar evals empty

* only update stl of curwin with globalstatus

* properly clear win local stl and wbr opts

* add version guards for winbar feature

* only add winbar if height > 1

* fix tests?

* refresh lualine on ModeChanged event

* ignore floating windows for refresh

* properply restore options to previous state

* fix stl not updating in cmd mode + some optimizations

* fix tests on <nvim-0.7

* merge status_dispatch & winbar_dispatch + winbar support for extensions

* fix globalstatus option not live updating

* update docs

* feat: allow disabling winbar and statusline separately

* fix tests

* fix: winbar some times oddly throwing errors

about not having space in floating windows.

This implements a temporary workaround the issue(https://github.com/neovim/neovim/issues/19464)
until the bug in neovim gets fixed.

Co-authored-by: Diego Fujii <android.mxdiego9@gmail.com>
2022-07-22 19:29:55 +06:00
shadmansaleh 8d956c1825 chore: autogen (vimdocs+formating) 2022-07-20 13:29:21 +00:00
Shadman 0ac721d376
feat: add on_click option to interact with mouse (#742)
* feat: add on_click option to interact with mouse

closes #706
2022-07-20 19:28:49 +06:00
shadmansaleh c15e3b4c9e chore: autogen (vimdocs+formating) 2022-07-06 14:37:55 +00:00
shadmansaleh d5002d95a1 fix: reuse component ids while reloading all components
fixes #722
2022-07-06 20:36:07 +06:00
Daemon b61afc44e6
docs: cleanup formatting and comment typos (#696)
* docs: fix typo in component notice

* refactor: rename typo param 'pattern'

* docs: fix comments typos across project files

Cleanup misspellings and wording in comment lines.

* docs: improve readability of `CONTRIBUTING.md`

* docs: improve readability of `README.md`

- Minor typos
- Clarify information
- Separate sections from paragraphs

* docs: add newline below headers in `THEMES.md`

Aim's to be consistent with other documents.

* docs: fix unname tabpage command reference

* docs: reword 'directly bused' for `setup_theme()`

* docs: fix extra indent in contribution list

* docs: more separation in readme/tabs, remove extra backtick

* docs: further improve wording for `setup_theme`

* docs: improve wording for `setup` function

* docs: missing underscore in lualine/config
2022-05-30 20:25:05 +06:00
zeertzjq de2c4beaf5
fix: make escape sequences compatible with Lua 5.1 (#663)
Escape sequences starting with `\x` are supported by Lua 5.2 and LuaJIT, but not by Lua 5.1
2022-04-24 13:12:03 +06:00
HE7086 43c69a3479
Use escape sequence instead of raw binaries (#662)
* Fix: use escape sequence instead of binary chars

binary data will confuse some programs e.g. file and treat the code as "data" instead of "text"

* Fix: remove redundant binary character "0x1a"
2022-04-24 11:29:53 +06:00
shadmansaleh 1e3cfc691f fix: persistent notices getting wrongly triggered 2022-03-07 18:10:32 +06:00
shadmansaleh 531b2f8a4b fix: transitional hl throwing errors for nil fg/bg in colors
fixes #600
2022-03-07 17:39:09 +06:00
Shadman 37a314b9e3
feat: add support for dynamic color with functions in color options (#566)
* feat: allow functions in color options.

* update_evilline

* docs: document color functions

* remove unnecesery stuff

* add dynamic color supoort for themes

* chore: autogen (vimdocs+formating)

* fix dynamic colors not working as color fallback

* fix transitional separators not updating for dynamic colors dynamic colors

* fix failing tests

* apply format

* Allow cases where theme doesn't even define nornal color for some mode

* allow color function to return nil

* some enhancements

* more enhancements

* code cleanup

* if we don't have even normal in theme we should just nvim highlight it with it's ususal stl colors

* not sure how it get here . It should be in different pr

* keep only c of lualine_c in component section name

* use sh to run docgen

* fix filetype component not respecting color option properly

* fix section x,y,z not falling back to correct colors

* auto format

* actually fix xyz not falling back to correct mode

* fix comp sep not correctly removed properly on function hl

* pass only section in color fn

* more enhancements

* update docs

* update create_comp_hl call locations

* enhancements+fixes

* fix broken hls in tabline

* Fix function color options not inheriting right colors

* some enhancements

* fix tests

* tweek docs

Co-authored-by: shadmansaleh <shadmansaleh@users.noreply.github.com>
2022-03-02 19:37:08 +06:00
shadmansaleh 40849728b6 fix: % not properly escaped in other components too.
Now following components escapes results of external souces
- buffers
- tabs
- hostname
- branch
- filetype

fixes #579
2022-02-15 23:17:05 +06:00
shadmansaleh a69251d52b fix: % in filename not escaped properly.
fixes #579
2022-02-15 22:54:29 +06:00
shadmansaleh 6f28adb21f chore: autogen (vimdocs+formating) 2022-02-01 08:04:03 +00:00
github-actions[bot] dc31077bc5
chore: formated with stylua (#564)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-31 23:36:06 +06:00
Shadman e6e75f5e92
fix: lualine crashing because of keyboard interrupt. (#534)
* fix: lualine crashing because of keyboard interrupt.

If keyboard interrupt occurs while lualine is evaluating statusline
lualine crashes completely. Since keyboard interrupt isn't something
we can handle try to mitigate the issue by retrying to evaluate the
statusline on error.Now lualine will retry 3 times before giving
up on an runtime error.

* Make last retry unprotected call
2022-01-31 23:34:53 +06:00
shadmansaleh 750a94baef chore: remove older deprecation notices 2022-01-12 22:35:17 +06:00
kylo252 4b68b8dd2a
fix: use nvim-api to avoid win_getid exceptions (#525) 2022-01-04 07:22:52 +06:00
shadmansaleh b18b7ee8ac chore: Use paranthesis for function calls. No paran can trip new lua users 2022-01-02 17:38:39 +06:00
shadmansaleh b7cf506785 enhache: support inlined custom component in extensions too 2021-11-25 13:44:15 +06:00
shadmansaleh c030a380ef feat: add support for inline custom components 2021-11-25 12:57:00 +06:00
shadmansaleh df46c1e70a enhance: add notice for invalid types of component 2021-11-11 16:52:27 +06:00
Shadman 08d1340ec9
doc: improve code documentation (#82) 2021-10-12 20:04:47 +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
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
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 904f9df637 refactor: replace rtp_searcher with nvim_get_runtime_file (#65) 2021-09-20 20:35:14 +06:00
shadmansaleh 9f556fdf37 chore: add license statements and update benchmarks 2021-09-20 17:48:22 +06:00
zeertzjq fa3f8c33ca
feat: add support for modes vs, Vs, CTRL-Vs (#62) 2021-09-20 09:57:41 +06:00
shadmansaleh 260133ce63 fix: wrong highlights on inactive mode with last commit 2021-09-19 12:20:07 +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
Shadman 2f801ed622
Refactor: simplify options (#24)
* Deprecate upper & lower option.

These does not make much sense and `format` option can provide same results

* Unify padding options

* Add persistent notices

* Make separators use left/right keys to specify left right instead of
sequence

* Rename format -> fmt

* Rename condition -> cond

* Rename disable_text -> icon_only

* Unify color_error,warning,info,hint under diagnostics_color

* Unify color_added,modified,removed hint under diff_color
2021-09-14 21:14:23 +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
Shadman 4042e837f8
chore: use stylua for formating
* Switch to stylua for formating

* Change lua-format ignore to stylua ignore.

* Add workflow for formating with stylua
2021-09-04 00:20:34 +06:00
shadmansaleh b2fcf50742 enhance: Reload lualine for ColorScheme so auto can self update 2021-09-03 20:16:54 +06:00
shadmansaleh e409e9fc32 Enhace: add a faster fallback for lualine_require for requiring files out of repo
If that fails it still falls back to original require a last resort
2021-08-30 23:58:23 +06:00