Commit Graph

474 Commits

Author SHA1 Message Date
shadmansaleh 3cf45404d4 chore: autogen (vimdocs+formating) 2022-08-22 05:13:35 +00:00
Keith Plant b87e47e1de
enhance: refresh lualine on CursorMovedI event (#809) 2022-08-22 11:13:03 +06:00
shadmansaleh 9076378ac1 chore: autogen (vimdocs+formating) 2022-08-20 15:51:32 +00:00
John Fred Fadrigalan 5d8fbf2943
fix component(filetype) to return default icon instead of nothing (#800) 2022-08-20 21:50:53 +06:00
shadmansaleh c0510ddec8 chore: autogen (vimdocs+formating) 2022-08-09 07:08:23 +00:00
Hongbo Liu 7b4b864af7
[filename] avoid new file status for unnamed (#795) 2022-08-09 13:07:55 +06:00
Plato 03bcf015d1
More user-friendly LualineBuffersJump (#780)
* buffers: user friendly LualineBuffersJump version

LualineBuffersJump throws an error when an attempt to jump to a
non-existent buffer index is made. It's expected from users to
trigger this error by accident while attempting to switch buffers.
To deal with this add <bang> support to LualineBuffersJump.

Signed-off-by: Plato Kiorpelidis <kioplato@gmail.com>

* chore: autogen (vimdocs+formating)

Co-authored-by: kioplato <kioplato@users.noreply.github.com>
2022-08-08 21:52:28 +06:00
shadmansaleh 4b5048aee1 chore: autogen (vimdocs+formating) 2022-08-08 10:11:17 +00:00
shadmansaleh de778faf81 enhance: for command ModeChanged event refresh lualine in autocmd context
closes #791
2022-08-08 16:08:13 +06:00
shadmansaleh 664c688974 enhance: refresh lualine on CursorMoved event
closes #792
2022-08-08 12:01:52 +06:00
Hongbo Liu 679e9e71de
[filename] support detect new file status (#785)
* [filename] support detect new file status

* update readme about new file status

* add definition for new file
2022-08-08 11:59:33 +06:00
shadmansaleh e22c7b3c9b Revert: "Revert fix: don't call redrawstatus/tabline they have a ton of side effects"
This commit reverts b1042d3184

Yeah calling redraw still causes too many issues like #781 #788

fixes #788
2022-08-07 20:34:09 +06:00
shadmansaleh f40db9a224 fixup: prevent wildmode=list from disapearing
don't call redrawstatus on command mode if wildmode is set to list
fixes #781
2022-08-07 12:33:39 +06:00
shadmansaleh b1042d3184 Revert "fix: don't call redrawstatus/tabline they have a ton of side effects"
This reverts commit 6fbc35b3e0.
The statusline flashing issue in #747 doesn't seem to occur any more as we
aren't updating in autocmd context . But we still have statusline
not updating in cmdline mode. So lets try reintroducing the redraw
commands.
2022-08-04 19:23:38 +06:00
shadmansaleh d2a727da9f fixup: globalstatus hidden in floating windows + flickering
fixes #774
2022-08-04 18:33:16 +06:00
shadmansaleh 136a92cb97 fixup: fix all winbars being evaluated in curwins context with globarstatus
fixes #779
2022-08-04 18:05:05 +06:00
shadmansaleh f50ce0f9f6 fixup: statusline not refreshing when winbar or inactive_winbar is set
fixes #777
2022-08-03 21:45:52 +06:00
shadmansaleh 93b2f4af62 chore: autogen (vimdocs+formating) 2022-08-03 15:36:17 +00:00
shadmansaleh e8294ac56a feat: allow lualine to be temporarily completely disabled
Adds `lualine.hide()`

closes #776
2022-08-03 21:35:31 +06:00
shadmansaleh b80ba74d4c enhance/doc: rename refresh_opts.kind to scope.
document lualine.refresh()
apply defaults to refresh_opts
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
Shadman 6d11f9f508
feat: allow lualine to ignore focus on specific filetypes. (#767)
* feat: allow lualine to ignore focus on specific filetypes.

closes #710

* fix: extensions on ingnored_focus

* perf: reuse api call results & use local variables instead of vim.g

* make location & progress components behave in ingnored filetypes

* fix: crash when last_focused win gets closed

* fix: location & progress related broken tests
2022-07-29 16:54:31 +06:00
shadmansaleh 788805771c fixup: escape results of vim_var components 2022-07-28 13:30:17 +06:00
shadmansaleh c6d7485114 fixup: allow refresh option to be set individually 2022-07-28 13:14:55 +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 e9b05e7f35 fixup: don't take over stl/wbr/tbl opts in ingnored filetypes 2022-07-28 11:22:54 +06:00
shadmansaleh b378660841 chore: autogen (vimdocs+formating) 2022-07-27 18:03:53 +00:00
Yohanes Bandung Bondowoso 0521ada344
feat: add workspace diagnostics source (#618)
* feat: add workspace diagnostics source

* doc: add nvim_workspace_diagnostics to list of sources

Co-authored-by: Shadman <13149513+shadmansaleh@users.noreply.github.com>
2022-07-28 00:02:58 +06:00
shadmansaleh 33f03620c3 chore: autogen (vimdocs+formating) 2022-07-27 16:03:32 +00:00
shadmansaleh 2d6108e07f fix flickering while working one enter=false floats
some of them are caused by https://github.com/neovim/neovim/issues/15300
some are https://github.com/neovim/neovim/issues/19464
and other unknown bugs too

So as workaround don't update statusline in autocmd context immediately
instead defer the refresh to 50ms later in timer context.

fixes #751 #753 #755
2022-07-27 22:01:15 +06:00
shadmansaleh fb9a0ebbd4 fix: refresh lualine on filetype change 2022-07-23 12:53:30 +06:00
shadmansaleh 292c6bbcce enhance: blend statusline with background when lualine is disabled 2022-07-23 12:53:30 +06:00
shadmansaleh 6fbc35b3e0 fix: don't call redrawstatus/tabline they have a ton of side effects
closes #747
2022-07-23 08:45:18 +06:00
shadmansaleh bf7dfb5dab fix: on_click messing up highlights
solution seems to be keeping hl defs out of on_click wrap.
2022-07-22 20:17:02 +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 655411fb7a chore: autogen (vimdocs+formating) 2022-07-15 11:53:29 +00:00
Benedikt Rips 8f75e65878
feat(extension): Extension for the Mundo plugin (#740)
* Add an extension for the mundo plugin

* List the mundo extension
2022-07-15 17:52: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
shadmansaleh 5113cdb32f chore: autogen (vimdocs+formating) 2022-06-21 11:06:47 +00:00
kaiv2 ddbbdec27a
feat: add nvim-dap-ui extension (#711)
* Extension for nvim-dap-ui

* Add nvim-dap-ui extension to README.md

* sort

* Set file_status option to false
2022-06-21 17:06:07 +06:00
Andy Freeland 00e98d207c
feat: Add an extension for man pages (#714)
This will be used with Neovim's built-in `:Man` command and `man`
filetype.
2022-06-21 02:40:52 +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
shadmansaleh d64152cf5c chore: autogen (vimdocs+formating) 2022-05-20 00:48:48 +00:00
Marc Jakobi 36bf6963ae
Add option to show buffer number + alternate file icon (#669)
* Add option to show buffer number + alternate file icon

* Address PR comments

* Adjust existing tests for buffer bufnr mode additions

* Revert "Adjust existing tests for buffer bufnr mode additions"

This reverts commit f8422d9f38b4b437a2330101e13c3a4bc50ed920.

* Add missing case for buffers mode == 0

* Fix some test cases for alternate file icon + modified icon

* Add test cases for modes 3 & 4

* Correct typo in README

* Fix buffers component mode can change layout specs

* Detect buffer numbers in lualine_spec bufnr tests

* Minor change to test descriptions

* Delete unnamed buffer for consistent test results between nvim versions

* Add test case for alternate buffer when switching buffers

* Extend switching buffers test

Co-authored-by: Marc Jakobi <marc.jakobi@tiko.energy>
Co-authored-by: Marc Jakobi <mrcjk@p40yoga.localdomain>
2022-05-20 06:48:18 +06:00
Jackson Cooper 180f5de5b8
Support tilde as home path in the absolute file paths (#676)
* Support tile as home path in the absolute file paths
2022-05-13 11:28:03 +06:00
David van Munster 619ededcff
fix: large file lag with filesize component (partially reverts #649) (#675) 2022-05-07 09:53:33 +06:00
Hennadii Chernyshchyk 19721f6e4f
Add neo-tree extension (#672)
* Add neo-tree extension

* Update README.md
2022-05-02 08:15:53 +06:00
shadmansaleh 030eb62bc4 chore: autogen (vimdocs+formating) 2022-04-30 10:11:22 +00:00
Daemon 1cdddc2456
feat: add option to invert component icon alignment (#666)
* feat: add option to invert component icon alignment

Invert component status icon if variable is set `icon_right = true`.

* refactor: use string for icon alignment

Change conditional variable for icon left/right alignment from Boolean
to `icon_alignment = 'right'`.

* refactor: check icon table for alignment variable

Determine component status output from icon_alignment variable.
Provides alignment variables for generic component and filetype
devicons.

`component = { 'name', icon = {'*', align = 'right'} }`
`component = { 'filetype', icon_alignment = 'right' }`

* style: restore previous formatting on line 79

* refactor: set `self.option.icon` as table

* fix: forgot non-color icon alignment

* fix: remove redundant variable assignment

* docs: add README examples for icon alignment

Include configuration examples for icon alignment to README file.

* test: add test for filetype components icon align

Ensure testability for filetype icons being aligned to right side.
2022-04-30 16:10:47 +06:00
shadmansaleh dfac736a01 enhance: respect laststatus from user
Users laststatus option is kept as is unless globalstatus option is set.

closes #670
2022-04-28 19:08:08 +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 13ead784c4 enhace: add create&format_hl to make hl easier for componemet 2022-04-18 05:20:29 +06:00
David van Munster 63f74ac069
feat: live filesize (#649) 2022-04-14 10:41:59 +06:00
shadmansaleh 19cbf69b2e fix: default diff & diagnostics color not changing with colorscheme
fixes #647
2022-04-13 11:26:31 +06:00
Jinq Qian c2165540a8
feat: show index in buffers component instead of bufnr (#628)
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
2022-04-13 11:01:42 +06:00
Mudox c9a974d912
feat: hide filename extension for buffers component (#629) 2022-04-13 10:59:53 +06:00
shadmansaleh bb8dd4c1c5 chore: autogen (vimdocs+formating) 2022-04-13 04:59:06 +00:00
Camille Dejoye f3dc0dcd4c
feat(themes): add automatic theme for nvim-base16 colorschemes(#597) 2022-04-13 10:58:31 +06:00
shadmansaleh c8e5a69085 fix: theme colors not applied as default when color option is incomplete
fixes #631
2022-04-01 13:46:09 +06:00
shadmansaleh 7345986fb4 fix: use appropriate default color for transitional separators. 2022-04-01 09:18:23 +06:00
Khang f14175e142
fix: typo (#626) 2022-03-27 14:03:24 +06:00
Camille Dejoye e9b935ccd6
feat: add windows component (#595)
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
2022-03-26 19:31:40 +06:00
shadmansaleh 4480d91e60 fix: transparent background throwing errors without termguicolors
fixes #623 #625
2022-03-26 10:00:51 +00:00
kylo252 5a91d816a0
chore(tests): move tests out of lua directory (#621) 2022-03-25 13:35:59 +00:00
Fitrah Muhammad 181b14348f
fix(filename): use columns for shortening if using global statusline (#617) 2022-03-18 20:08:52 +06:00
shadmansaleh 7db1db3cd9 fix: icons from different filetype component shareing same highlight group
fixes #610
2022-03-18 07:52:41 +06:00
shadmansaleh 399aaa564d fix: test errors in lualine_spec 2022-03-18 07:02:19 +06:00
Shadman 60b1d5dce9
feat: add support for global statusline (#613) 2022-03-18 06:59:01 +06:00
shadmansaleh 88a44ade81 fix: tabline causing neovims splash screen to disappear
Solution: set tabline option in setup() so we don't need to call
redrawtabline

fixes #542
2022-03-07 21:49:22 +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
shadmansaleh d2e0ac595b chore: autogen (vimdocs+formating) 2022-03-06 02:11:19 +00:00
Camille Dejoye 91142983d0
feat(diagnostics): add padding when using different background colors (#594)
* feat(diagnostics): add padding when using different background colors

When each "sub-section" of the diagnostics components have a different background the rendering is off when
multiple more than one of them is shown.

* chore: fix typo and spelling
2022-03-06 08:10:34 +06:00
shadmansaleh a1304ea8b6 chore: autogen (vimdocs+formating) 2022-03-05 13:41:08 +00:00
Shadman 747ef49b98
tests: add statusline test module & update lualine_spec accordingly(#588)
* enhance: add statusline test module

* update old tests to use statusline test setup

* show diff in statusline:expect

* Revert "show diff in statusline:expect"

This reverts commit cea25185fde1b99110759f198ef1fc724626306c.

* autoformat

* fix testcov reports

* update statusline test module

* revert lualine_spec

* update lualine_spec using statusline module

* apply formater

* add tabline support to statusline test module

* re enable tabline tests

* fix inconsistency in buffers mode test due to bufnr changing

Should we be showing bufnr/buffer_position in buffers component

* autoformat

* minor tweeks to stl test module

* use nvim_eval_statusline in nvim-0.6+

* fix tabs component on nvim-0.5

* enable disabled branch test
2022-03-05 19:40:36 +06:00
shadmansaleh 21fdf7b9fa don't max xyz->cba in create_component_highlight it's done while generating default hl values 2022-03-05 17:52:00 +06:00
Shadman 09f749cbb1
handle cases where filetype icon highlight is not set (#589) 2022-03-03 06:37:52 +06:00
shadmansaleh 32c85cd214 feat: add custom color support for icons 2022-03-02 20:02:58 +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
Michael Lan 016a20711e
feat: ayu adaptive background (#584)
* feat: Enable adaptive theme for ayu theme

* Update description of ayu theme

* doc: make formatting consistent
2022-02-21 08:05:43 +06:00
shadmansaleh 605a30f2fe feat: support transitional seperators with transparent background 2022-02-20 14:55:03 +06:00
shadmansaleh 00020dc3fd chore: allow runnibgs tests through vusted 2022-02-20 14:52:29 +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
yasudanaoya 6a3d367449
feat: add terminal mode color in onedark (#576)
* feat: add terminal mode color in onedark
2022-02-12 00:36:36 +06:00
shadmansaleh 98dc2dd3a2 fix: LualineRenameTab crashing lualine
fixes https://github.com/nvim-lualine/lualine.nvim/pull/574#pullrequestreview-874872853

Issue was neovim's tabpage handle used by rpc-api isn't same as tab no
in viml.
Now the tabpage handle is stores in self.tabId and tab no is stored in
self.tabnr in `Tab` so any can be used when necessary.
2022-02-07 22:13:42 +06:00
Tokubara d52ff470de
feature to rename tabs (#574)
* (feat) add rename

* remove tabname if LualineRenameTab is ran without args

* document LualineRenameTab

Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
2022-02-07 21:26:25 +06:00
yasudanaoya 2bddaf0508
feat: add onedark/onelight command mode color (#575)
* feat: add onedark/onelight command mode color

* fix: typo
2022-02-07 20:55:33 +06:00
Rocky Zhang d3c513a3fa
Extension for aerial.nvim (#572)
* Extension for aerial.nvim
2022-02-06 13:23:59 +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