Commit Graph

59 Commits

Author SHA1 Message Date
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
shadmansaleh 70d925ab17 Perf: More optimizations 2021-08-30 20:52:49 +06:00
shadmansaleh b0da16addd enhance:Don't load notice module when there are no notices 2021-08-30 19:02:01 +06:00
shadmansaleh 1afc45294a refactor: rename cterm_color.lua -> color_utils.lua 2021-08-30 19:02:01 +06:00
shadmansaleh 1439ba6d37 perf: Improve startup by droping most of the requires + refactors
Important: It's no longer guaranteed that if component/extension
of same name exists in multiple entries in rtp which one will be
loaded. The guarantee is still there for themes . Means other
plugins or users config can overwrite a lualines internal theme
with same file name . I'm droping the guarantee for components
and extensions because there isn't much usecase for it . It's simple
to have a unique name and droping that guarantee allows more
optimizations that speeds up lualine.
2021-08-30 17:54:23 +06:00
shadmansaleh c9b5f364dc Fix various visual bugs in components transitional sep 2021-08-26 18:20:16 +06:00
shadmansaleh 1c57497863 refactor: Improve section separators
- behaviour change now statusline won't be separated with %=
  if you don't have at lest one of lualine_x/y/z
- fixed some bugs
- simplified the transitional separators quite a bit. I think now
  it's understandable . Yay .
- Perf improvements too.
2021-08-26 18:20:16 +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
shadmansaleh 15dcaababd fix: Add '-' to valid filename chars 2021-08-20 10:34:31 +06:00
shadmansaleh 6c99ba6ba7 Fix string component containging ['{] taking long to load 2021-08-20 09:54:18 +06:00
shadmansaleh 849d6acc66 feat: Allow (neo)vim's statusline items to be used as component directly 2021-08-20 08:15:57 +06:00
shadmansaleh 0126ac0cc0 perf: lazy load modules and dalay config loading till status redraw
This should make require'lualine' less expensive and make lualine
have less impact in startuptime
2021-08-16 23:40:27 +06:00
shadmansaleh ee5c56e911 enhance: Allow external sources to overwrite components and extensions
this is like the themes now . If some component/extension found in
both lualine repo and in some other rtp path then the one outside
the repo will be loaded.
+ Added better error handling for extensions.
2021-08-14 20:31:08 +06:00
shadmansaleh 32727039a9 |DEPRECATION| enhance(themes): Auto colorscheme detection and more
- `auto` theme now auto loads available theme for colorschme based on
  g:color_name . If that fails then it generates a theme for that
  colorschme like before.
- Theme from external source is preferred over bundled version in
  lualine . This means if user has a colorschme that provided the same
  theme as lualine the one from colorschme will be loaded.
- Default value of theme is changed to `auto` from `gruvbox`.
- Now when users theme from config fails lualine will fallbavk to
  `auto`. If `auto` fails then lualine will fallback to `gruvbox`
- Some themes have been renamed to their actual name (g:color_name).
  older names have been deprecated. [DEPRECATION]
    oceanicnext -> OceanicNext
    papercolor -> PaperColor
    tomorrow -> Tomorrow
    gruvbox_material -> gruvbox-material
    modus_vivendi -> modus-vivendi
- A few more adaptive themes added (aye, gruvbox, iceberg)
- Updated THEMES.md to reflect changes in theme name
2021-08-14 12:35:08 +06:00
shadmansaleh 967ddcb5ca fix: Reloading config causing extesions to disaprear 2021-08-13 07:29:28 +06:00
shadmansaleh fcb88aebba Fix: quickfix extention not apearing 2021-08-13 07:20:56 +06:00
shadmansaleh f68d81d351 [Deprection] Enhance: Provide an uniform interface for color options
- Now all color related options and themes color definition have same
  semantics. They can either be a table containing values like bg,fg,gui
  or a string. When it's a string it's treated as a highlight group name
  and newly created group is linked to that group.
- Using string values to define foreground colors in options like
  color_error/color_added in diagnostics and diff component has been
  deprecated.
- Added a decent way of notifying affected users of deprecations and
  breaking changes.
2021-08-09 14:03:12 +06:00
shadmansaleh fac96d71cc [Breaking] Refactor: switch to %{%expr%} from %!expr
Huge change to internal mechanics.
- Now %{%expr%} blocks are used for evaluating statusline instead of
  %!expr . Pros for this is statusline is evaluated on current win and
  buf context instead of active win & bufs context.
- Now all components branch & diff(These two are cached) including users
  function components updates on inactive status.
  - now components update status and function components receive an
    argument (is_focused) when called. It indicates whether it's running
    for active or inactive statusline.
- Now lualine no longer aggrasively takes over 'statusline' option.
  instead it sets the global version of statusline option. So it's
  possible to unset it to hide lualine . Or set buffer local version
  of that option to have different statusline then lualine on thay
  buffer
- Switch vim.o to vim.go or vim.opt.
- BugFix autcommands being set everytime an instence of diff or branch
  component is created
- Added new utils functions define_autocmd & is_focused
- Remove utils function lualine_eval
- Removed hacky require cache modification from component.lua
2021-08-08 22:50:17 +06:00
shadmansaleh cb5c4c031e Refactor: async jobs and diff component
- Use neovims job api instead of uv.spawn (Probably a bit less
  performent but should be more stable)
- Fix async jobs leaking pipes
- Fix wrong diff counts .Used to occur because job might not be dead
  after closing it . And that still alive job may send data over stdout
  corrupting the cache.
- lots of variable renames in diff.
- utils/async.lua has been replaced by utils/job.lua
2021-08-08 14:47:20 +06:00
shadmansaleh 66b0736fd4 fix: left section separator not displayed when component begins with a custom highlight 2021-08-05 21:44:22 +06:00
shadmansaleh 62b53c854c feat: Allow extensions to spwcify inactive sections too 2021-08-03 12:08:17 +06:00
shadmansaleh 486be4462f Remove new_async():send() pattern + restructure augroup
This does not load load lualine asyncronasly rather fools the profilers
In addition causes issues like intro disapearing
2021-08-02 21:16:17 +06:00
shadmansaleh 7a45a4f7fe feat: Add support for useing color_name like red and cterm values to set colors in lualine 2021-08-02 20:25:34 +06:00
shadmansaleh c57cb43c4d feat:Add component evaluation for inactive sections 2021-07-25 12:52:52 +06:00
shadmansaleh d8a2a640e0 refactor statusline() function 2021-05-21 11:25:14 +06:00
shadmansaleh f480db58fb Allow transitional separator to be set as component option 2021-05-21 11:25:13 +06:00
shadmansaleh ef47235330 Add component evaluation for inactive sections 2021-05-21 11:11:25 +06:00
hubert 9d9ee2d60e feat: user defined extensions 2021-05-14 20:24:54 +02:00
Hubert Pelczarski f644841206
fix: extensions not loading properly (#232)
* refactor: removed inactive sections from extensions

* fix: extensions not loading properly
2021-05-11 21:40:54 +02:00
Hubert Pelczarski 82826ef661
refactor: moved loading to new module (#182)
* refactor: moved loading to new module
* refactor: check_single_separator
* refactor: simplified separator fixing
* refactor: tests/ -> lua/tests/
* refactor: moved to nvim_err_writeln for errors

* feat: moved config parsing to config.lua
* feat: get config directly from config module
* feat: added load_all function

* tests: config parsing tests

* added assert to luacheck globals
2021-05-09 23:11:18 +02:00
Shadman 141778c953
bugfix: perf improvements (#213)
* Revert "Revert "Performence improvments (#205)" (#212)"

This reverts commit d3cc343053.

* BugFix: All windows having same component state
2021-05-06 13:05:55 +02:00
Hubert Pelczarski d3cc343053
Revert "Performence improvments (#205)" (#212)
This reverts commit 141417de61.
2021-05-06 04:45:07 +02:00
Shadman 141417de61
Performence improvments (#205)
* Only load default config when needed

* Only load default cterm colors when needed

* Async load components and theme

* Rename: util_colors -> cterm_colors
2021-05-04 19:42:26 +02:00
Shadman f2f014e379
Fix: Transitional highlight not found error (#203)
Changes:
- transitional_highlight isn't created when both retrieval of fg or bg
  has failed
- Transitional highlight is not looked for when section separators are
  disabled
- empty section no longer returns highlight group as section data
2021-05-02 10:36:51 +06:00
Shadman e3a558bc1d
Fix component separator not removed for string color (#192) 2021-04-23 17:41:41 +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
Shadman 1b81b0021f
Refactor: Components now use OOP style (#141) 2021-04-11 10:20:41 +02:00
Shadman 37a3b8cc82
feat: enhance theme (#153)
* Enhance Theme

- loaded theme table is nolonger stored in configs and thus not passed
  to components. Insted it's cached in highlights.lua
- Reintroducing clear_highlights turns out themes can still change if
  setup is called more than once

* Add error messege for invalid theme

It stops lualine from crashing in such incedent

* Apply lua-format

* Small tweeks
2021-04-07 02:34:36 +02:00
Shadman 7c8ddf307b
refactor: highlight improvements
* Refactor highlight restoring after ColorScheme

Previously custom highlights/ component highlights had to call
expand_set_theme to make them restored . That's unintuative . Now any
highlight created by lualine.highlight.highlight() will be restored :)

* Renamed component -> var_name | Proper BugFix
2021-03-22 15:29:37 +01:00