comparison src/textprop.c @ 29621:f1ed6f520d09 v9.0.0151

patch 9.0.0151: a "below" aligned text property does not work with 'nowrap' Commit: https://github.com/vim/vim/commit/4d91d347e65a5621621ea1e3c97dce2c677ed71d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 6 13:48:20 2022 +0100 patch 9.0.0151: a "below" aligned text property does not work with 'nowrap' Problem: A "below" aligned text property does not work with 'nowrap'. Solution: Start a new screen line to display the virtual text. (closes #10851)
author Bram Moolenaar <Bram@vim.org>
date Sat, 06 Aug 2022 15:00:03 +0200
parents e1c370197030
children dd96f3d8ed85
comparison
equal deleted inserted replaced
29620:1e975951ffb7 29621:f1ed6f520d09
590 return 0; 590 return 0;
591 } 591 }
592 if (proplen > 0) 592 if (proplen > 0)
593 *props = text + textlen; 593 *props = text + textlen;
594 return (int)(proplen / sizeof(textprop_T)); 594 return (int)(proplen / sizeof(textprop_T));
595 }
596
597 /*
598 * Return the number of text properties with "below" alignment in line "lnum".
599 */
600 int
601 prop_count_below(buf_T *buf, linenr_T lnum)
602 {
603 char_u *props;
604 int count = get_text_props(buf, lnum, &props, FALSE);
605 int result = 0;
606 textprop_T prop;
607 int i;
608
609 if (count == 0)
610 return 0;
611 for (i = 0; i < count; ++i)
612 {
613 mch_memmove(&prop, props + i * sizeof(prop), sizeof(prop));
614 if (prop.tp_col == MAXCOL && (prop.tp_flags & TP_FLAG_ALIGN_BELOW))
615 ++result;
616 }
617 return result;
595 } 618 }
596 619
597 /** 620 /**
598 * Return the number of text properties on line "lnum" in the current buffer. 621 * Return the number of text properties on line "lnum" in the current buffer.
599 * When "only_starting" is true only text properties starting in this line will 622 * When "only_starting" is true only text properties starting in this line will