Mercurial > vim
comparison src/sign.c @ 17440:a5874fdc8f3a v8.1.1718
patch 8.1.1718: popup menu highlighting does not look good
commit https://github.com/vim/vim/commit/cb5ff34c1b8a89fcdb86653ab18d0aa53f665642
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 20 16:51:19 2019 +0200
patch 8.1.1718: popup menu highlighting does not look good
Problem: Popup menu highlighting does not look good.
Solution: Highlight the whole window line. Fix that sign line HL is not
displayed in a window with a background color.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Jul 2019 17:00:08 +0200 |
parents | 9843fbfa0ee5 |
children | 121bdff812b4 |
comparison
equal
deleted
inserted
replaced
17439:8be5444ee2cb | 17440:a5874fdc8f3a |
---|---|
1023 | 1023 |
1024 return OK; | 1024 return OK; |
1025 } | 1025 } |
1026 | 1026 |
1027 /* | 1027 /* |
1028 * Return TRUE if sign "name" exists. | |
1029 */ | |
1030 int | |
1031 sign_exists_by_name(char_u *name) | |
1032 { | |
1033 return sign_find(name, NULL) != NULL; | |
1034 } | |
1035 | |
1036 /* | |
1028 * Free the sign specified by 'name'. | 1037 * Free the sign specified by 'name'. |
1029 */ | 1038 */ |
1030 int | 1039 int |
1031 sign_undefine_by_name(char_u *name) | 1040 sign_undefine_by_name(char_u *name, int give_error) |
1032 { | 1041 { |
1033 sign_T *sp_prev; | 1042 sign_T *sp_prev; |
1034 sign_T *sp; | 1043 sign_T *sp; |
1035 | 1044 |
1036 sp = sign_find(name, &sp_prev); | 1045 sp = sign_find(name, &sp_prev); |
1037 if (sp == NULL) | 1046 if (sp == NULL) |
1038 { | 1047 { |
1039 semsg(_("E155: Unknown sign: %s"), name); | 1048 if (give_error) |
1049 semsg(_("E155: Unknown sign: %s"), name); | |
1040 return FAIL; | 1050 return FAIL; |
1041 } | 1051 } |
1042 sign_undefine(sp, sp_prev); | 1052 sign_undefine(sp, sp_prev); |
1043 | 1053 |
1044 return OK; | 1054 return OK; |
1074 } | 1084 } |
1075 | 1085 |
1076 /* | 1086 /* |
1077 * Place a sign at the specified file location or update a sign. | 1087 * Place a sign at the specified file location or update a sign. |
1078 */ | 1088 */ |
1079 static int | 1089 int |
1080 sign_place( | 1090 sign_place( |
1081 int *sign_id, | 1091 int *sign_id, |
1082 char_u *sign_group, | 1092 char_u *sign_group, |
1083 char_u *sign_name, | 1093 char_u *sign_name, |
1084 buf_T *buf, | 1094 buf_T *buf, |
1589 else if (idx == SIGNCMD_LIST) | 1599 else if (idx == SIGNCMD_LIST) |
1590 // ":sign list {name}" | 1600 // ":sign list {name}" |
1591 sign_list_by_name(name); | 1601 sign_list_by_name(name); |
1592 else | 1602 else |
1593 // ":sign undefine {name}" | 1603 // ":sign undefine {name}" |
1594 sign_undefine_by_name(name); | 1604 sign_undefine_by_name(name, TRUE); |
1595 | 1605 |
1596 vim_free(name); | 1606 vim_free(name); |
1597 return; | 1607 return; |
1598 } | 1608 } |
1599 } | 1609 } |
2510 | 2520 |
2511 for (li = l->lv_first; li != NULL; li = li->li_next) | 2521 for (li = l->lv_first; li != NULL; li = li->li_next) |
2512 { | 2522 { |
2513 retval = -1; | 2523 retval = -1; |
2514 name = tv_get_string_chk(&li->li_tv); | 2524 name = tv_get_string_chk(&li->li_tv); |
2515 if (name != NULL && (sign_undefine_by_name(name) == OK)) | 2525 if (name != NULL && (sign_undefine_by_name(name, TRUE) == OK)) |
2516 retval = 0; | 2526 retval = 0; |
2517 list_append_number(retlist, retval); | 2527 list_append_number(retlist, retval); |
2518 } | 2528 } |
2519 } | 2529 } |
2520 | 2530 |
2549 // Free only the specified sign | 2559 // Free only the specified sign |
2550 name = tv_get_string_chk(&argvars[0]); | 2560 name = tv_get_string_chk(&argvars[0]); |
2551 if (name == NULL) | 2561 if (name == NULL) |
2552 return; | 2562 return; |
2553 | 2563 |
2554 if (sign_undefine_by_name(name) == OK) | 2564 if (sign_undefine_by_name(name, TRUE) == OK) |
2555 rettv->vval.v_number = 0; | 2565 rettv->vval.v_number = 0; |
2556 } | 2566 } |
2557 } | 2567 } |
2558 | 2568 |
2559 /* | 2569 /* |