mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00

committed by
Justin M. Keyes

parent
a9c94f7bb0
commit
8d5a46e77b
@@ -450,7 +450,8 @@ static void update_attrs(UI *ui, HlAttrs attrs)
|
|||||||
int attr = ui->rgb ? attrs.rgb_ae_attr : attrs.cterm_ae_attr;
|
int attr = ui->rgb ? attrs.rgb_ae_attr : attrs.cterm_ae_attr;
|
||||||
bool bold = attr & HL_BOLD;
|
bool bold = attr & HL_BOLD;
|
||||||
bool italic = attr & HL_ITALIC;
|
bool italic = attr & HL_ITALIC;
|
||||||
bool reverse = attr & (HL_INVERSE | HL_STANDOUT);
|
bool reverse = attr & HL_INVERSE;
|
||||||
|
bool standout = attr & HL_STANDOUT;
|
||||||
bool underline = attr & (HL_UNDERLINE), undercurl = attr & (HL_UNDERCURL);
|
bool underline = attr & (HL_UNDERLINE), undercurl = attr & (HL_UNDERCURL);
|
||||||
|
|
||||||
if (unibi_get_str(data->ut, unibi_set_attributes)) {
|
if (unibi_get_str(data->ut, unibi_set_attributes)) {
|
||||||
@@ -478,6 +479,9 @@ static void update_attrs(UI *ui, HlAttrs attrs)
|
|||||||
if (underline || undercurl) {
|
if (underline || undercurl) {
|
||||||
unibi_out(ui, unibi_enter_underline_mode);
|
unibi_out(ui, unibi_enter_underline_mode);
|
||||||
}
|
}
|
||||||
|
if (standout) {
|
||||||
|
unibi_out(ui, unibi_enter_standout_mode);
|
||||||
|
}
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
unibi_out(ui, unibi_enter_reverse_mode);
|
unibi_out(ui, unibi_enter_reverse_mode);
|
||||||
}
|
}
|
||||||
|
@@ -186,6 +186,10 @@ Dictionary hlattrs2dict(const HlAttrs *aep, bool use_rgb)
|
|||||||
PUT(hl, "bold", BOOLEAN_OBJ(true));
|
PUT(hl, "bold", BOOLEAN_OBJ(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mask & HL_STANDOUT) {
|
||||||
|
PUT(hl, "standout", BOOLEAN_OBJ(true));
|
||||||
|
}
|
||||||
|
|
||||||
if (mask & HL_UNDERLINE) {
|
if (mask & HL_UNDERLINE) {
|
||||||
PUT(hl, "underline", BOOLEAN_OBJ(true));
|
PUT(hl, "underline", BOOLEAN_OBJ(true));
|
||||||
}
|
}
|
||||||
@@ -198,7 +202,7 @@ Dictionary hlattrs2dict(const HlAttrs *aep, bool use_rgb)
|
|||||||
PUT(hl, "italic", BOOLEAN_OBJ(true));
|
PUT(hl, "italic", BOOLEAN_OBJ(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & (HL_INVERSE | HL_STANDOUT)) {
|
if (mask & HL_INVERSE) {
|
||||||
PUT(hl, "reverse", BOOLEAN_OBJ(true));
|
PUT(hl, "reverse", BOOLEAN_OBJ(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -99,5 +99,14 @@ describe('highlight api',function()
|
|||||||
eq(false, err)
|
eq(false, err)
|
||||||
eq('Invalid highlight name: ',
|
eq('Invalid highlight name: ',
|
||||||
string.match(emsg, 'Invalid.*'))
|
string.match(emsg, 'Invalid.*'))
|
||||||
|
|
||||||
|
-- Test "standout" attribute. #8054
|
||||||
|
eq({ underline = true, },
|
||||||
|
meths.get_hl_by_name('cursorline', 0));
|
||||||
|
command('hi CursorLine cterm=standout,underline term=standout,underline gui=standout,underline')
|
||||||
|
command('set cursorline')
|
||||||
|
eq({ underline = true, standout = true, },
|
||||||
|
meths.get_hl_by_name('cursorline', 0));
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
@@ -312,7 +312,7 @@ describe('highlight defaults', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('guisp (special/undercurl)', function()
|
describe('highlight', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
@@ -321,7 +321,31 @@ describe('guisp (special/undercurl)', function()
|
|||||||
screen:attach()
|
screen:attach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('can be set and is applied like foreground or background', function()
|
it('cterm=standout gui=standout', function()
|
||||||
|
screen:detach()
|
||||||
|
screen = Screen.new(20,5)
|
||||||
|
screen:attach()
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[1] = {bold = true, foreground = Screen.colors.Blue1},
|
||||||
|
[2] = {standout = true, bold = true, underline = true,
|
||||||
|
background = Screen.colors.Gray90, foreground = Screen.colors.Blue1},
|
||||||
|
[3] = {standout = true, underline = true,
|
||||||
|
background = Screen.colors.Gray90}
|
||||||
|
})
|
||||||
|
feed_command('hi CursorLine cterm=standout,underline gui=standout,underline')
|
||||||
|
feed_command('set cursorline')
|
||||||
|
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
|
||||||
|
feed('i\t abcd <cr>\t abcd <cr><esc>k')
|
||||||
|
screen:expect([[
|
||||||
|
{1:>-------.}abcd{1:*¬} |
|
||||||
|
{2:^>-------.}{3:abcd}{2:*¬}{3: }|
|
||||||
|
{1:¬} |
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('guisp (special/undercurl)', function()
|
||||||
feed_command('syntax on')
|
feed_command('syntax on')
|
||||||
feed_command('syn keyword TmpKeyword neovim')
|
feed_command('syn keyword TmpKeyword neovim')
|
||||||
feed_command('syn keyword TmpKeyword1 special')
|
feed_command('syn keyword TmpKeyword1 special')
|
||||||
|
Reference in New Issue
Block a user