A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/ba257d74b187e38cd591b2f4eb2a4f0f6483b358 below:

do not put empty virt_text (#17872) · neovim/neovim@ba257d7 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+34

-1

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+34

-1

lines changed Original file line number Diff line number Diff line change

@@ -4335,6 +4335,9 @@ static int draw_virt_text_item(buf_T *buf, int col, VirtText vt, HlMode hl_mode,

4335 4335

break;

4336 4336

}

4337 4337

}

4338 +

if (!*s.p) {

4339 +

continue;

4340 +

}

4338 4341

int attr;

4339 4342

bool through = false;

4340 4343

if (hl_mode == kHlModeCombine) {

Original file line number Diff line number Diff line change

@@ -437,6 +437,7 @@ describe('extmark decorations', function()

437 437

[22] = {foreground = tonumber('0xb20000'), background = tonumber('0xf13f3f')};

438 438

[23] = {foreground = Screen.colors.Magenta1, background = Screen.colors.LightGrey};

439 439

[24] = {bold = true};

440 +

[25] = {background = Screen.colors.LightRed};

440 441

}

441 442 442 443

ns = meths.create_namespace 'test'

@@ -456,6 +457,31 @@ for _,item in ipairs(items) do

456 457

end

457 458

end]]

458 459 460 +

it('empty virtual text at eol should not break colorcolumn #17860', function()

461 +

insert(example_text)

462 +

feed('gg')

463 +

command('set colorcolumn=40')

464 +

screen:expect([[

465 +

^for _,item in ipairs(items) do {25: } |

466 +

local text, hl_id_cell, count = unp{25:a}ck(item) |

467 +

if hl_id_cell ~= nil then {25: } |

468 +

hl_id = hl_id_cell {25: } |

469 +

end {25: } |

470 +

for _ = 1, (count or 1) do {25: } |

471 +

local cell = line[colpos] {25: } |

472 +

cell.text = text {25: } |

473 +

cell.hl_id = hl_id {25: } |

474 +

colpos = colpos+1 {25: } |

475 +

end {25: } |

476 +

end {25: } |

477 +

{1:~ }|

478 +

{1:~ }|

479 +

|

480 +

]])

481 +

meths.buf_set_extmark(0, ns, 4, 0, { virt_text={{''}}, virt_text_pos='eol'})

482 +

screen:expect_unchanged()

483 +

end)

484 + 459 485

it('can have virtual text of overlay position', function()

460 486

insert(example_text)

461 487

feed 'gg'

@@ -471,7 +497,9 @@ end]]

471 497

-- can "float" beyond end of line

472 498

meths.buf_set_extmark(0, ns, 5, 28, { virt_text={{'loopy', 'ErrorMsg'}}, virt_text_pos='overlay'})

473 499

-- bound check: right edge of window

474 -

meths.buf_set_extmark(0, ns, 2, 26, { virt_text={{'bork bork bork ' }, {'bork bork bork', 'ErrorMsg'}}, virt_text_pos='overlay'})

500 +

meths.buf_set_extmark(0, ns, 2, 26, { virt_text={{'bork bork bork '}, {'bork bork bork', 'ErrorMsg'}}, virt_text_pos='overlay'})

501 +

-- empty virt_text should not change anything

502 +

meths.buf_set_extmark(0, ns, 6, 16, { virt_text={{''}}, virt_text_pos='overlay'})

475 503 476 504

screen:expect{grid=[[

477 505

^for _,item in ipairs(items) do |

@@ -621,6 +649,8 @@ end]]

621 649

meths.buf_set_extmark(0, ns, 2, 10, { virt_text={{'Much', 'ErrorMsg'}}, virt_text_win_col=31, hl_mode='blend'})

622 650

meths.buf_set_extmark(0, ns, 3, 15, { virt_text={{'Error', 'ErrorMsg'}}, virt_text_win_col=31, hl_mode='blend'})

623 651

meths.buf_set_extmark(0, ns, 7, 21, { virt_text={{'-', 'NonText'}}, virt_text_win_col=4, hl_mode='blend'})

652 +

-- empty virt_text should not change anything

653 +

meths.buf_set_extmark(0, ns, 8, 0, { virt_text={{''}}, virt_text_win_col=14, hl_mode='blend'})

624 654 625 655

screen:expect{grid=[[

626 656

^for _,item in ipairs(items) do |

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4