comparison src/sign.c @ 15484:882bbbdc9c76 v8.1.0750

patch 8.1.0750: when the last sign is deleted the signcolumn may remain commit https://github.com/vim/vim/commit/8144acbec33b751788a7912e2d880c083c6cfe93 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 14 23:08:18 2019 +0100 patch 8.1.0750: when the last sign is deleted the signcolumn may remain Problem: When the last sign is deleted the signcolumn may not be removed even though 'signcolumn' is "auto". Solution: When deleting the last sign redraw the buffer. (Dominique Pelle, closes #3803, closes #3804)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Jan 2019 23:15:05 +0100
parents 55ccc2d353bd
children 98c35d312987
comparison
equal deleted inserted replaced
15483:09803c73b55c 15484:882bbbdc9c76
372 return (linenr_T)0; 372 return (linenr_T)0;
373 } 373 }
374 374
375 /* 375 /*
376 * Return the type number of the sign at line number 'lnum' in buffer 'buf' 376 * Return the type number of the sign at line number 'lnum' in buffer 'buf'
377 * which has the attribute specifed by 'type'. Returns 0 if a sign is not found 377 * which has the attribute specified by 'type'. Returns 0 if a sign is not
378 * at the line number or it doesn't have the specified attribute. 378 * found at the line number or it doesn't have the specified attribute.
379 */ 379 */
380 int 380 int
381 buf_getsigntype( 381 buf_getsigntype(
382 buf_T *buf, 382 buf_T *buf,
383 linenr_T lnum, 383 linenr_T lnum,
440 sign_group_unref(sign->group->sg_name); 440 sign_group_unref(sign->group->sg_name);
441 vim_free(sign); 441 vim_free(sign);
442 redraw_buf_line_later(buf, lnum); 442 redraw_buf_line_later(buf, lnum);
443 443
444 // Check whether only one sign needs to be deleted 444 // Check whether only one sign needs to be deleted
445 // If deleting a sign with a specific identifer in a particular 445 // If deleting a sign with a specific identifier in a particular
446 // group or deleting any sign at a particular line number, delete 446 // group or deleting any sign at a particular line number, delete
447 // only one sign. 447 // only one sign.
448 if (group == NULL 448 if (group == NULL
449 || (*group != '*' && id != 0) 449 || (*group != '*' && id != 0)
450 || (*group == '*' && atlnum != 0)) 450 || (*group == '*' && atlnum != 0))
453 else 453 else
454 lastp = &sign->next; 454 lastp = &sign->next;
455 } 455 }
456 456
457 // When deleting the last sign the cursor position may change, because the 457 // When deleting the last sign the cursor position may change, because the
458 // sign columns no longer shows. 458 // sign columns no longer shows. And the 'signcolumn' may be hidden.
459 if (buf->b_signlist == NULL) 459 if (buf->b_signlist == NULL)
460 {
461 redraw_buf_later(buf, NOT_VALID);
460 changed_cline_bef_curs(); 462 changed_cline_bef_curs();
463 }
461 464
462 return lnum; 465 return lnum;
463 } 466 }
464 467
465 468
892 else 895 else
893 semsg(_("E155: Unknown sign: %s"), name); 896 semsg(_("E155: Unknown sign: %s"), name);
894 } 897 }
895 898
896 /* 899 /*
897 * Place a sign at the specifed file location or update a sign. 900 * Place a sign at the specified file location or update a sign.
898 */ 901 */
899 int 902 int
900 sign_place( 903 sign_place(
901 int *sign_id, 904 int *sign_id,
902 char_u *sign_group, 905 char_u *sign_group,