comparison src/syntax.c @ 17214:079ce74ecaa5 v8.1.1606

patch 8.1.1606: on a narrow screen ":hi" output is confusing commit https://github.com/vim/vim/commit/548be7f126dc57ca861cb26dc6492c3b2a9e2c99 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 29 03:42:42 2019 +0200 patch 8.1.1606: on a narrow screen ":hi" output is confusing Problem: On a narrow screen ":hi" output is confusing. Solution: Insert a space between highlight group name and "xxx". (Masato Nishihaga, closes #4599)
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Jun 2019 03:45:06 +0200
parents b8fafffb537b
children 6d01f93a5f12
comparison
equal deleted inserted replaced
17213:d031972f6d0a 17214:079ce74ecaa5
9438 int outlen, /* length of string that comes */ 9438 int outlen, /* length of string that comes */
9439 int id) /* highlight group id */ 9439 int id) /* highlight group id */
9440 { 9440 {
9441 int endcol = 19; 9441 int endcol = 19;
9442 int newline = TRUE; 9442 int newline = TRUE;
9443 int name_col = 0;
9443 9444
9444 if (!did_header) 9445 if (!did_header)
9445 { 9446 {
9446 msg_putchar('\n'); 9447 msg_putchar('\n');
9447 if (got_int) 9448 if (got_int)
9448 return TRUE; 9449 return TRUE;
9449 msg_outtrans(HL_TABLE()[id - 1].sg_name); 9450 msg_outtrans(HL_TABLE()[id - 1].sg_name);
9451 name_col = msg_col;
9450 endcol = 15; 9452 endcol = 15;
9451 } 9453 }
9452 else if (msg_col + outlen + 1 >= Columns) 9454 else if (msg_col + outlen + 1 >= Columns)
9453 { 9455 {
9454 msg_putchar('\n'); 9456 msg_putchar('\n');
9469 msg_advance(endcol); 9471 msg_advance(endcol);
9470 9472
9471 /* Show "xxx" with the attributes. */ 9473 /* Show "xxx" with the attributes. */
9472 if (!did_header) 9474 if (!did_header)
9473 { 9475 {
9476 if (endcol == Columns - 1 && endcol <= name_col)
9477 msg_putchar(' ');
9474 msg_puts_attr("xxx", syn_id2attr(id)); 9478 msg_puts_attr("xxx", syn_id2attr(id));
9475 msg_putchar(' '); 9479 msg_putchar(' ');
9476 } 9480 }
9477 9481
9478 return newline; 9482 return newline;