comparison src/textprop.c @ 30231:0d084880276a v9.0.0451

patch 9.0.0451: virtual text "above" does not work with 'nowrap' Commit: https://github.com/vim/vim/commit/c9dc03fff5acf6fb91a923fb95006f9c2bca6141 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 12 17:51:07 2022 +0100 patch 9.0.0451: virtual text "above" does not work with 'nowrap' Problem: Virtual text "above" does not work with 'nowrap'. Solution: Do wrap the line after. (closes https://github.com/vim/vim/issues/11084)
author Bram Moolenaar <Bram@vim.org>
date Mon, 12 Sep 2022 19:00:05 +0200
parents ed6f3d2593df
children 8d660a45299f
comparison
equal deleted inserted replaced
30230:aad84f731ef9 30231:0d084880276a
606 *props = text + textlen; 606 *props = text + textlen;
607 return (int)(proplen / sizeof(textprop_T)); 607 return (int)(proplen / sizeof(textprop_T));
608 } 608 }
609 609
610 /* 610 /*
611 * Return the number of text properties with "below" alignment in line "lnum". 611 * Return the number of text properties with "above" or "below" alignment in
612 * A "right" aligned property also goes below after a "below" or other "right" 612 * line "lnum". A "right" aligned property also goes below after a "below" or
613 * aligned property. 613 * other "right" aligned property.
614 */ 614 */
615 int 615 int
616 prop_count_below(buf_T *buf, linenr_T lnum) 616 prop_count_above_below(buf_T *buf, linenr_T lnum)
617 { 617 {
618 char_u *props; 618 char_u *props;
619 int count = get_text_props(buf, lnum, &props, FALSE); 619 int count = get_text_props(buf, lnum, &props, FALSE);
620 int result = 0; 620 int result = 0;
621 textprop_T prop; 621 textprop_T prop;
632 if ((prop.tp_flags & TP_FLAG_ALIGN_BELOW) 632 if ((prop.tp_flags & TP_FLAG_ALIGN_BELOW)
633 || (next_right_goes_below 633 || (next_right_goes_below
634 && (prop.tp_flags & TP_FLAG_ALIGN_RIGHT))) 634 && (prop.tp_flags & TP_FLAG_ALIGN_RIGHT)))
635 { 635 {
636 next_right_goes_below = TRUE; 636 next_right_goes_below = TRUE;
637 ++result;
638 }
639 else if (prop.tp_flags & TP_FLAG_ALIGN_ABOVE)
640 {
641 next_right_goes_below = FALSE;
637 ++result; 642 ++result;
638 } 643 }
639 else if (prop.tp_flags & TP_FLAG_ALIGN_RIGHT) 644 else if (prop.tp_flags & TP_FLAG_ALIGN_RIGHT)
640 next_right_goes_below = TRUE; 645 next_right_goes_below = TRUE;
641 } 646 }