Commit Graph

85 Commits

Author SHA1 Message Date
shadmansaleh b3c5c4403c feat: add new filesize component 2021-09-03 16:16:10 +06:00
shadmansaleh ba1efb2a00 Remove deprecated feature: string color option bering treated as fg 2021-08-30 06:35:06 -07: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 2b90200998 enahce: sync diff&branch component to buffer based of bufnr instead of BufEnter 2021-08-30 12:18:08 +06:00
shadmansaleh 0a032cf43e fix: Properly disable internal diff when source is given 2021-08-30 12:03:07 +06:00
shadmansaleh 276ba5d19e feat: Support indexing dictionaries in var components 2021-08-28 00:32:44 +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 fa1f001207 fix: branch assumes git file will be correctly formated 2021-08-26 17:09:18 +06:00
shadmansaleh 1cbf0686b4 fix: branch incorrectly assumes .git/ without .git/HEAD to be valid
fixes high cpu uses on windows in projects with empty .git folder.
2021-08-26 17:09:18 +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 33defeffb5 feat: Allow function as diagnostics source 2021-08-17 00:17:56 +06:00
shadmansaleh d360039969 fix(filename): include window_width to space estimation & expose
shorting_target option

setting shorting target to 0 disables path shorting
closes #8

Co-authored-by: NullVoxPopuli <LPSego3+dev@gmail.com>
2021-08-14 21:24:48 +06:00
shadmansaleh 0f3ad7e248 fix: Branch stuck in infinite loop in windows
Solution: Using poll-watch instead of event-watch on windows.
Additionally now gitdir paths are cached as optimization

Special thanks to @Shatur for raising the issue and for testing patches.
closes #2
2021-08-09 22:44:38 +06:00
shadmansaleh edb8c344f7 Fix: branch and diff disappearing with diagnostics.goto_next())
I've added a workaround to re sync those components when they
go out of sync . Until upstream issue is addressed this should
prevent this issue from occurring in lualine.
2021-08-09 15:11:50 +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 ea2432cc1e feat: Add source option to diff
It allows you to easily integrate external source for diff count.
If user has some other plugin keeping track of diff counts. There's
no reason for lualine to make same calculations again . It can just
reuse them. But lualine knows nothing about how other plugin exposes
their api so user will have to glue them together with this option.
2021-08-03 17:41:37 +06:00
shadmansaleh e7b8b42089 Fix: Branch not working on directory with whilespace 2021-08-03 15:28:05 +06:00
shadmansaleh ac9a9e0a8b fix: Possible fix to diff sometimws not apearing 2021-08-03 12:19:12 +06:00
shadmansaleh 51daaf6f5a fix: Fixes bug diff somtimes doubled 2021-08-03 09:56:07 +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 f60bec0969 feat: Add update_in_insert option to diagnostics component 2021-07-25 13:48:50 +06:00
shadmansaleh c57cb43c4d feat:Add component evaluation for inactive sections 2021-07-25 12:52:52 +06:00
shadmansaleh 1d40e34aef Refactor: filetype icon and add disable_text option 2021-07-25 12:39:20 +06:00
Tim Bedard 2aaf434094
feat: add separate hint diagnostic (#241)
* add separate hint diagnostic

* change to lightbulb icon
2021-05-25 22:13:43 +02:00
shadmansaleh a560209c24 Refractor filetype and add disable_text option 2021-05-21 11:23:09 +06:00
shadmansaleh ef47235330 Add component evaluation for inactive sections 2021-05-21 11:11:25 +06:00
Hubert Pelczarski 3702e682ac
refactor: remove filename warning (#228) 2021-05-18 17:13:13 +02:00
Hubert Pelczarski 292609e3ad
docs: vimscript removal prep (#243) 2021-05-13 23:19:11 +02:00
JL Bas 1ee99e0473
enhancement: show diff when component is loaded (#234) 2021-05-13 12:24:51 +02:00
Shadman 33aaabe672
Fix filename error message (#237) 2021-05-12 15:27:37 +06:00
Jonathan Gin bfae320155
feat: color filetype icons when using nvim-devicons (#222) 2021-05-11 14:55:18 +02:00
Hubert Pelczarski 73a6c8fadf
feat: dynamic shortening for filetype (#224)
* feat: dynamic shortening for filetype

* feat: redraw statusline on VimResized

Co-authored-by: NullVoxPopuli <LPSego3+dev@gmail.com>
Co-authored-by: shadmansaleh <shadmansaleh3@gmail.com>
2021-05-11 12:47:09 +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
Folke Lemaitre c8b96850c9
fix: try LspDiagnostics colors first before fallling back to Diff colors (#216) 2021-05-07 13:03:11 +02:00
Shadman 2f17e432ee
fix: typo functon -> function (#191) 2021-04-22 21:09:34 +02:00
Tim Bedard e6cc09c2e9
feat(filename): add support for custom filename symbols (modified, readonly) (#185)
* feat(filename): add support for custom filename symbols (modified, readonly)

* update docs
2021-04-20 22:25:25 +06:00
Tim Bedard 96938c5db2
style: Spell fix instence -> instance (#184) 2021-04-20 09:02:21 +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 aa844a9555
BugFix: Fix function component not working (#175)
When the provided function takes an optional argument the previous
implementation causes error.
2021-04-13 23:09:01 +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 7eacdb787f
fix: hostname component not working (#170) 2021-04-12 14:04:43 +02: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
Jaekyeom Kim 7f1d7ba3fb
fix: displaying relative paths. (#155) 2021-03-31 16:47:38 +02:00
Yusei Ueno a2721e5ada
feat: add diagnostic sources option vim_lsp (#151) 2021-03-29 16:53:19 +02:00
Shadman 78b8260084
Feat: Adding readonly to filestatus (#149) 2021-03-28 03:38:47 +02:00