Commit Graph

25 Commits

Author SHA1 Message Date
Rob Watson 46131d0a41 feat(diagnostics): accept functions as symbols 2023-10-22 08:16:17 +02:00
Shadman 343e1941ba
drop support for nvim-0.5, 0.6 (BREAKING) (#1002)
* chore: drop support for nvim-0.5, 0.6 (BREAKING)

Users of these versions can still use compatibility tags
compat-nvim-0.5 and compat-nvim-0.6 respectively.

BREAKING CHANGE

* add testing for 0.9
2023-10-18 11:00:32 +06:00
shadmansaleh 45e27ca739 chore: fix tests failing due to icon change 2023-08-03 13:03:30 +06:00
shadmansaleh 05d78e9fd0 fixup: fix tests 2023-05-04 21:17:02 +06:00
Eugene Oliveros 8912bea65d
fix: replace deprecated nerdfont icons (#1035)
Co-authored-by: Shadman <13149513+shadmansaleh@users.noreply.github.com>
2023-05-04 21:08:04 +06:00
Carl Johnson 9805076155
feat: add draw_empty option to always draw component event when it's empty (#964)
* feat: add draw_empty option to always draw component event when it's empty

Closes #963

* tests: add test for component draw_empty option

* docs: add docs for component draw_empty option

---------

Co-authored-by: Carl Johnson <carl.darick.johnson@gmail.com>
2023-03-30 10:42:48 +06:00
Zhizhen He 6bb1f80a98
fix: typo (#997) 2023-03-30 10:12:37 +06:00
zappolowski 9d177b668c
fix component(filetype) proper icon based on filetype (#810)
* Refactor tests to use stubs for nvim-web-devicons

* Simplify getting icon

`get_icon` does not need the 2nd parameter (`ext`) as it will derive it
from the given `name` (1st argument) itself.

* fix component(filetype) proper icon based on filetype

With https://github.com/kyazdani42/nvim-web-devicons/pull/125 a filetype
based lookup was implemented upstream which can be used to get an icon
when a file doesn't have an extension.

fixes #578
2022-10-23 20:41:12 +06:00
Antoine Cotten a52f078026 feat(utils): support extracting fallback color 2022-09-12 00:35:46 +06:00
Antoine Cotten 05f850d25f feat(utils): support extracting 'sp' scope hl color 2022-09-12 00:35:46 +06:00
Andrey Mishakin 2061fcbf3b
fix: display virtual column number in location component (#835) 2022-09-12 00:32:09 +06:00
zappolowski 5d133a1ef2
fix component(filename) add separator between filename and icons (#812)
This makes it behave like the default statusline.

fixes #794
2022-09-10 15:39:38 +06:00
zappolowski f10101ab04
feat(filename) Always use the first letter for hidden directories (#833)
Instead of shortening a path segment to just the dot, it is now always
using 2 characters.

E.g.

```
~/.config/nvim/lua/config/lualine.lua
```

is shortened to

```
~/.c/n/l/c/lualine.lua
```

This includes a rewrite of the shortening logic as it cannot be
expressed easily/readable using patterns. The current approach starts at
the beginning and replaces each segment by a shortened version and
keeping track of the overall length (basic book keeping on how many
characters were saved by the replacement).
2022-09-10 15:20:37 +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 8a9c97d111 fix: broken tests 2022-07-28 11:39:58 +06:00
shadmansaleh 5f68f070e4 chore: fix broken tests 2022-07-23 13:01:52 +06: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
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
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
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 13ead784c4 enhace: add create&format_hl to make hl easier for componemet 2022-04-18 05:20:29 +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
kylo252 5a91d816a0
chore(tests): move tests out of lua directory (#621) 2022-03-25 13:35:59 +00: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
Hubert Pelczarski 8572db014a
testing (#127)
* Add testing setup + CI
* Add tests for components and utils funtions

Co-authored-by: shadmansaleh <shadmansaleh3@gmail.com>
2021-05-06 00:04:16 +06:00