mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(ui): fixes incorrect rendering when virtual text is not visable and nowrap
This commit is contained in:
		| @@ -1743,12 +1743,12 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, | |||||||
|           DecorState *state = &decor_state; |           DecorState *state = &decor_state; | ||||||
|           for (size_t i = 0; i < kv_size(state->active); i++) { |           for (size_t i = 0; i < kv_size(state->active); i++) { | ||||||
|             DecorRange *item = &kv_A(state->active, i); |             DecorRange *item = &kv_A(state->active, i); | ||||||
|             if (!(item->start_row == state->row |             if (item->start_row != state->row | ||||||
|                   && kv_size(item->decor.virt_text) |                   || !kv_size(item->decor.virt_text) | ||||||
|                   && item->decor.virt_text_pos == kVTInline)) { |                   || item->decor.virt_text_pos != kVTInline) { | ||||||
|               continue; |               continue; | ||||||
|             } |             } | ||||||
|             if (item->win_col >= -1 && item->start_col <= v) { |             if (item->win_col >= -1 && item->start_col == v) { | ||||||
|               virt_inline = item->decor.virt_text; |               virt_inline = item->decor.virt_text; | ||||||
|               virt_inline_i = 0; |               virt_inline_i = 0; | ||||||
|               item->win_col = -2; |               item->win_col = -2; | ||||||
|   | |||||||
| @@ -1741,6 +1741,33 @@ bbbbbbb]]) | |||||||
|       {24:-- INSERT --}                                      | |       {24:-- INSERT --}                                      | | ||||||
|       ]]} |       ]]} | ||||||
|   end) |   end) | ||||||
|  |  | ||||||
|  |   it('no wrap is rendered correctly with multiple virtual text, where one is hidden', function() | ||||||
|  |     insert('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz') | ||||||
|  |     command("set nowrap") | ||||||
|  |     meths.buf_set_extmark(0, ns, 0, 50, | ||||||
|  |       { virt_text = { { 'virtual text', 'Special' } }, virt_text_pos = 'inline', right_gravity = false }) | ||||||
|  |     meths.buf_set_extmark(0, ns, 0, 2, | ||||||
|  |       { virt_text = { { 'virtual text', 'Special' } }, virt_text_pos = 'inline', right_gravity = false }) | ||||||
|  |     feed('$') | ||||||
|  |     screen:expect { grid = [[ | ||||||
|  |       opqrstuvwxyzabcdefghijklmnopqrstuvwx{28:virtual text}y^z| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |       {1:~                                                 }| | ||||||
|  |                                                         | | ||||||
|  |       ]]} | ||||||
|  |   end) | ||||||
| end) | end) | ||||||
|  |  | ||||||
| describe('decorations: virtual lines', function() | describe('decorations: virtual lines', function() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ibby
					Ibby