mirror of
https://github.com/neovim/neovim.git
synced 2026-05-04 04:55:16 +00:00
feat(highlight): support more SGR attributes #37901
Problem:
TUI does not support several standard SGR text attributes:
- dim/faint (SGR 2)
- blink (SGR 5)
- conceal (SGR 8)
- overline (SGR 53)
This means that when a program running in the embedded terminal emits
one of these escape codes, we drop it and don't surface it to the
outer terminal.
Solution:
- Add support for those attributes.
- Also add corresponding flags to `nvim_set_hl` opts, so users can set
these attributes in highlight groups.
- refactor(highlight): widen `HlAttrFlags` from `int16_t` to `int32_t`
Widen the `rgb_ae_attr` and `cterm_ae_attr` fields in HlAttrs from
int16_t to int32_t to make room for new highlight attribute flags,
since there was only one spare bit left.
- The C flag is named HL_CONCEALED to avoid colliding with the
existing HL_CONCEAL in syntax.h (which is a syntax group flag, not
an SGR attribute).
- Also note that libvterm doesn't currently support the dim and overline
attributes, so e.g. `printf '\e[2mThis should be dim\n'` and `printf
'\e[53mThis should have an overline\n'` are still not rendered
correctly when run from the embedded terminal.
This commit is contained in:
committed by
GitHub
parent
57c6b61cf2
commit
cb8c9186e6
5
runtime/lua/vim/_meta/api.lua
generated
5
runtime/lua/vim/_meta/api.lua
generated
@@ -2208,6 +2208,11 @@ function vim.api.nvim_set_decoration_provider(ns_id, opts) end
|
||||
--- - sp: color name or "#RRGGBB"
|
||||
--- - blend: integer between 0 and 100
|
||||
--- - bold: boolean
|
||||
--- - altfont: boolean
|
||||
--- - blink: boolean
|
||||
--- - dim: boolean
|
||||
--- - conceal: boolean
|
||||
--- - overline: boolean
|
||||
--- - standout: boolean
|
||||
--- - underline: boolean
|
||||
--- - undercurl: boolean
|
||||
|
||||
8
runtime/lua/vim/_meta/api_keysets.lua
generated
8
runtime/lua/vim/_meta/api_keysets.lua
generated
@@ -306,6 +306,10 @@ error('Cannot require a meta file')
|
||||
--- @field italic? boolean
|
||||
--- @field reverse? boolean
|
||||
--- @field altfont? boolean
|
||||
--- @field dim? boolean
|
||||
--- @field blink? boolean
|
||||
--- @field conceal? boolean
|
||||
--- @field overline? boolean
|
||||
--- @field nocombine? boolean
|
||||
--- @field default? boolean
|
||||
--- @field cterm? vim.api.keyset.highlight_cterm
|
||||
@@ -338,6 +342,10 @@ error('Cannot require a meta file')
|
||||
--- @field italic? boolean
|
||||
--- @field reverse? boolean
|
||||
--- @field altfont? boolean
|
||||
--- @field dim? boolean
|
||||
--- @field blink? boolean
|
||||
--- @field conceal? boolean
|
||||
--- @field overline? boolean
|
||||
--- @field nocombine? boolean
|
||||
|
||||
--- @class vim.api.keyset.keymap
|
||||
|
||||
4
runtime/lua/vim/_meta/vimfn.lua
generated
4
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -10078,6 +10078,10 @@ function vim.fn.synID(lnum, col, trans) end
|
||||
--- "strikethrough" "1" if struckthrough
|
||||
--- "altfont" "1" if alternative font
|
||||
--- "nocombine" "1" if nocombine
|
||||
--- "dim" "1" if half-bright/dimmed
|
||||
--- "blink" "1" if blinking
|
||||
--- "conceal" "1" if concealed
|
||||
--- "overline" "1" if overlined
|
||||
---
|
||||
--- Returns an empty string on error.
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user