mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	fix(decorations): fix imbalanced sign count
This commit is contained in:
		@@ -179,11 +179,17 @@ DecorSignHighlight decor_sh_from_inline(DecorHighlightInline item, String concea
 | 
			
		||||
void buf_put_decor(buf_T *buf, DecorInline decor, int row)
 | 
			
		||||
{
 | 
			
		||||
  if (decor.ext) {
 | 
			
		||||
    if (decor.data.ext.vt) {
 | 
			
		||||
      buf_put_decor_virt(buf, decor.data.ext.vt);
 | 
			
		||||
    DecorVirtText *vt = decor.data.ext.vt;
 | 
			
		||||
    while (vt) {
 | 
			
		||||
      buf_put_decor_virt(buf, vt);
 | 
			
		||||
      vt = vt->next;
 | 
			
		||||
    }
 | 
			
		||||
    if (decor.data.ext.sh_idx != DECOR_ID_INVALID) {
 | 
			
		||||
      buf_put_decor_sh(buf, &kv_A(decor_items, decor.data.ext.sh_idx), row);
 | 
			
		||||
 | 
			
		||||
    uint32_t idx = decor.data.ext.sh_idx;
 | 
			
		||||
    while (idx != DECOR_ID_INVALID) {
 | 
			
		||||
      DecorSignHighlight *sh = &kv_A(decor_items, idx);
 | 
			
		||||
      buf_put_decor_sh(buf, sh, row);
 | 
			
		||||
      idx = sh->next;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -4628,6 +4628,27 @@ l5
 | 
			
		||||
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('can add a single sign and text highlight', function()
 | 
			
		||||
    insert(example_test3)
 | 
			
		||||
    feed 'gg'
 | 
			
		||||
 | 
			
		||||
    meths.buf_set_extmark(0, ns, 1, 0, {sign_text='S', hl_group='Todo', end_col=1})
 | 
			
		||||
    screen:expect{grid=[[
 | 
			
		||||
      {1:  }^l1                                              |
 | 
			
		||||
      S {3:l}2                                              |
 | 
			
		||||
      {1:  }l3                                              |
 | 
			
		||||
      {1:  }l4                                              |
 | 
			
		||||
      {1:  }l5                                              |
 | 
			
		||||
      {1:  }                                                |
 | 
			
		||||
      {2:~                                                 }|
 | 
			
		||||
      {2:~                                                 }|
 | 
			
		||||
      {2:~                                                 }|
 | 
			
		||||
                                                        |
 | 
			
		||||
    ]]}
 | 
			
		||||
 | 
			
		||||
    meths.buf_clear_namespace(0, ns, 0, -1)
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('can add multiple signs (single extmark)', function()
 | 
			
		||||
    insert(example_test3)
 | 
			
		||||
    feed 'gg'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user