0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.1.1656: popup window width is wrong when using Tabs

Problem:    Popup window width is wrong when using Tabs. (Paul Jolly)
Solution:   Count tabs correctly. (closes #4637)
This commit is contained in:
Bram Moolenaar
2019-07-09 20:25:25 +02:00
parent 3dabd718f4
commit e089c3fd69
4 changed files with 11 additions and 7 deletions

View File

@@ -880,7 +880,9 @@ popup_adjust_position(win_T *wp)
wp->w_width = 1;
for (lnum = wp->w_topline; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum)
{
int len = vim_strsize(ml_get_buf(wp->w_buffer, lnum, FALSE));
// count Tabs for what they are worth
int len = win_linetabsize(wp, ml_get_buf(wp->w_buffer, lnum, FALSE),
(colnr_T)MAXCOL);
if (wp->w_p_wrap)
{

View File

@@ -1,10 +1,10 @@
>1+0&#ffffff0| @73
|2| @73
|3| @18|#+0#e000e06#e0e0e08|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000#ffffff0@36
|4| @18|i+0#00e0003#e0e0e08|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @3| +0&#ffffff0@36
|5| @18|{+0&#e0e0e08| @16| +0&#ffffff0@36
|6| @18| +0&#e0e0e08@3|p|r|i|n|t|f|(|5+0#e000002&|6|7|)+0#0000000&|;| @1| +0&#ffffff0@36
|7| @18|}+0&#e0e0e08| @16| +0&#ffffff0@36
|3| @18|#+0#e000e06#e0e0e08|i|n|c|l|u|d|e| |<+0#e000002&|s|t|d|i|o|.|h|>| +0#0000000&@1| +0&#ffffff0@34
|4| @18|i+0#00e0003#e0e0e08|n|t| +0#0000000&|m|a|i|n|(|v+0#00e0003&|o|i|d|)+0#0000000&| @5| +0&#ffffff0@34
|5| @18|{+0&#e0e0e08| @18| +0&#ffffff0@34
|6| @18| +0&#e0e0e08@7|p|r|i|n|t|f|(|5+0#e000002&|6|7|)+0#0000000&|;| +0&#ffffff0@34
|7| @18|}+0&#e0e0e08| @18| +0&#ffffff0@34
|8| @73
|9| @73
@57|1|,|1| @10|T|o|p|

View File

@@ -225,7 +225,7 @@ func Test_popup_with_syntax_setbufvar()
\ '#include <stdio.h>',
\ 'int main(void)',
\ '{',
\ ' printf(567);',
\ "\tprintf(567);",
\ '}',
\], {'line': 3, 'col': 21, 'highlight': 'PopupColor'})
call setbufvar(winbufnr(winid), '&syntax', 'cpp')

View File

@@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1656,
/**/
1655,
/**/