Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight Overhaul #2415

Closed
26 tasks done
alex-courtis opened this issue Sep 11, 2023 · 3 comments · Fixed by #2455
Closed
26 tasks done

Highlight Overhaul #2415

alex-courtis opened this issue Sep 11, 2023 · 3 comments · Fixed by #2455
Labels
feature request QOL Quality Of Life Improvement

Comments

@alex-courtis
Copy link
Member

alex-courtis commented Sep 11, 2023

#2410 demonstrated that highlighting can be additive e.g. add underline with a different colour.

There are some inconsistencies in how highlighting is applied e.g. highlight_opened_files vs highlight_git

  • Make all highlights additive as per feat(#1079): add renderer.highlight_clipboard default name, default undercurls #2410
    • git
    • diagnostics
    • opened
    • modified
    • bookmarks
    • clipboard
  • Make all highlights granular "none", "icon", "name", "all"
    • highlight_git
    • highlight_diagnostics
    • highlight_opened_files
    • highlight_modified
    • highlight_bookmarks
    • highlight_clipboard
  • Refactor highlight groups to be consistent and end with HL and Icon
    • git
    • diagnostics
    • opened
    • modified
    • bookmarks
    • clipboard
  • clean up and standardise get_colours
  • cterm compatibility
  • investigate term compatibility (e.g. linux) - colours and highlights are distinct and readable, just missing icons
  • legacy highlight group linking
  • simplify renderer builder for efficiency

Refactor may be silently done as per options.

@alex-courtis alex-courtis added feature request QOL Quality Of Life Improvement labels Sep 11, 2023
@alex-courtis
Copy link
Member Author

There is precedent for a Highlight suffix:

CocErrorHighlight
NeogitDiffAddHighlight
MasonHighlight

@alex-courtis
Copy link
Member Author

alex-courtis commented Sep 17, 2023

Colours are just not... correct e.g. green will always return a red:

local function get_colors()

Possible solutions:

  • just use the regular colours Green Red etc. as they are always present
  • link to the groups that are used and document as such

@alex-courtis
Copy link
Member Author

Strikethrough is not reliably coloured:
nvim --clean
:hi CursorLine guifg=red gui=strikethrough guisp=green

It should be used sparingly.

alex-courtis added a commit that referenced this issue Oct 21, 2023
* docs: update CONTRIBUTING.md (#2485)

* feat(#2415): granular highlight_git, normalise git groups
@alex-courtis alex-courtis changed the title Additive And Granular Highlighting Highlight Overhaul Oct 22, 2023
@alex-courtis alex-courtis pinned this issue Oct 22, 2023
alex-courtis added a commit that referenced this issue Oct 23, 2023
alex-courtis added a commit that referenced this issue Oct 23, 2023
alex-courtis added a commit that referenced this issue Nov 19, 2023
* simplify builder signs

* decorators take care of themselves and are priority ordered

* simplify builder hl groups

* refactor builder for icon arrays

* builder use decorators generically
alex-courtis added a commit that referenced this issue Nov 26, 2023
alex-courtis added a commit that referenced this issue Dec 9, 2023
* docs: update CONTRIBUTING.md (#2485)

* feat(#2415): granular highlight_git, normalise git groups
alex-courtis added a commit that referenced this issue Jan 29, 2024
…ght-overhaul (#2639)

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul
alex-courtis added a commit that referenced this issue Jan 29, 2024
#2656)

fix(#2415): fix NvimTreeIndentMarker highlight group: FileIcon->FolderIcon
alex-courtis added a commit to Confidenceman02/nvim-tree.lua that referenced this issue Jan 29, 2024
alex-courtis added a commit that referenced this issue Jan 29, 2024
… highest highlight precedence (#2642)

* fix: Add support for get_hl_defs in nvim 0.8

nvim-tree is using `nvim_get_hl` which was introduced in nvim 0.9 to
replace the unstable `get_hl_defs` in the following [commit](https://github.com/neovim/neovim/pull/22693/files).

Unfortunately this raises an error in 0.8 nvim versions due to the
function not existing.

```
Failed to run `config` for nvim-tree.lua
...are/nvim/lazy/nvim-tree.lua/lua/nvim-tree/appearance.lua:199: attempt to call field 'nvim_get_hl' (a nil value)
stacktrace:
  - ~/.config/nvim/lua/confidenceman02/plugins/nvim-tree.lua:14 _in_ **config**
  - ~/.config/nvim/lua/confidenceman02/lazy.lua:14
```

- Fall back to get_hl_defs when detecting 0.8
- Set the 'link' property to nil to emulate `link = false` in
  `builder.lua`

* fix(#2415): nvim 0.8 highlight overhaul support, limited to only show highest highlight precedence

---------

Co-authored-by: Jaime Terreu <jaime@terreu.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
juefeiyan pushed a commit to juefeiyan/nvim-tree.lua that referenced this issue Jan 30, 2024
…ee-highlight-overhaul (nvim-tree#2639)

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(nvim-tree#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul
juefeiyan pushed a commit to juefeiyan/nvim-tree.lua that referenced this issue Jan 30, 2024
…FolderIcon (nvim-tree#2656)

fix(nvim-tree#2415): fix NvimTreeIndentMarker highlight group: FileIcon->FolderIcon
juefeiyan pushed a commit to juefeiyan/nvim-tree.lua that referenced this issue Jan 30, 2024
…only show highest highlight precedence (nvim-tree#2642)

* fix: Add support for get_hl_defs in nvim 0.8

nvim-tree is using `nvim_get_hl` which was introduced in nvim 0.9 to
replace the unstable `get_hl_defs` in the following [commit](https://github.com/neovim/neovim/pull/22693/files).

Unfortunately this raises an error in 0.8 nvim versions due to the
function not existing.

```
Failed to run `config` for nvim-tree.lua
...are/nvim/lazy/nvim-tree.lua/lua/nvim-tree/appearance.lua:199: attempt to call field 'nvim_get_hl' (a nil value)
stacktrace:
  - ~/.config/nvim/lua/confidenceman02/plugins/nvim-tree.lua:14 _in_ **config**
  - ~/.config/nvim/lua/confidenceman02/lazy.lua:14
```

- Fall back to get_hl_defs when detecting 0.8
- Set the 'link' property to nil to emulate `link = false` in
  `builder.lua`

* fix(nvim-tree#2415): nvim 0.8 highlight overhaul support, limited to only show highest highlight precedence

---------

Co-authored-by: Jaime Terreu <jaime@terreu.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
alex-courtis added a commit that referenced this issue Feb 4, 2024
alex-courtis added a commit that referenced this issue Feb 11, 2024
* feat(#2415): add :NvimTreeHiTest

* feat(#2415): split out appearance diagnostics
@alex-courtis alex-courtis unpinned this issue Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request QOL Quality Of Life Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant